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
Subject Author Views Date
Thread multi-language messages (language.txt) olivers 4391 Jul 25, 2003, 2:21 PM
Thread Re: [olivers] multi-language messages (language.txt)
olivers 4297 Jul 26, 2003, 12:40 AM
Post Re: [olivers] multi-language messages (language.txt)
olivers 3567 Nov 29, 2007, 1:04 PM