Gossamer Forum
Home : Products : DBMan SQL : Discussion :

multi-language messages (language.txt)

Quote Reply
multi-language messages (language.txt)
Hi,

I have one db and several customized language templates for it (English, French, Italian and German). These "User Templates" are called templatename_e, templatename_f, templatename_i and templatename_g. After having added "&t=templatename_?" to the language links, everything worked fine. Different language interfaces could be displayed for one db as expected.

Unfortunately, the "User Language" messages (stored in language.txt of the different template sets) are only displayed in one language. I've realized that DBMan SQL is just choosing the language.txt file of the "configured" db template (each db can just have one template). Since I wanted that the language.txt messages fit to the User template language, I had to find a solution. I've modified Home.pm in sub _language like this:

replace
$template_set = $self->{cfg}->{template} || 'default';

with
my $template_set;
if ( defined $self->{cgi}->{t} ) { $template_set = $self->{cgi}->{t}; }
else { $template_set = $self->{cfg}->{template} || 'default'; }

This small modification has the effect that the template name passed via URL (&t=templatename) has more importance than the configured templatename of the database (actually it's overwritten). That's why it's now displaying the user language messages from language.txt in the correct language.

Any comments/corrections?

Cheers,
Oliver
Quote Reply
Re: [olivers] multi-language messages (language.txt) In reply to
Wink oops, forgot something

replace
my $template_set = $self->{cfg}->{template} || 'default';
...
Quote Reply
Re: [olivers] multi-language messages (language.txt) In reply to
Download Home.pm from this thread (prepared by webmaster33). It solves the problem.

Smileliver