[TYPO3-english] Select language at login, based on language preference in fe_users table

Loek Hilgersom hilgersom at xs4all.nl
Thu Apr 16 19:34:07 CEST 2009


Hi,

I'm working on a multi-language site where users have a setting 'preferred 
language' in their user profile, which is stored in the fe_users table.

Is there a way I can automatically select that preferred language at the moment 
the user logs in?

I was thinking of using a bit of typoscript like this:

# detect a succesful login
[globalVar = GP:pass > 0] && [loginUser = *]
# get the preferred language from fe_users table and set appropriate config
config.sys_language_uid = ...
....
[global]

The problem with that is that it won't change the TS conditions based on the 
L-var used elsewhere to change certain parts of the site depending on the 
language chosen, so you'll end up with pages containing a mixture of 2 languages.

Suggestions welcome!
Loek


More information about the TYPO3-english mailing list