[TYPO3-core] RFC #11293: Login page is not translatable

Martin Kutschker masi-no at spam-typo3.org
Mon Jun 8 09:24:14 CEST 2009


Benjamin Mack schrieb:
> Hey team,
> 
> I am very happy to see all the positive and constructive comments about
> this RFC. Haven't felt this in a long time.
> 
> @Masi: Thanks for your suggestions.
> 
> a) About the implementation of the accept languages. Yes, I have read
> about this before I started coding, but actually I wanted a quick first
> version to get this done, it worked for me and I forgot to change it.
> I'll add the quality parameter and do proper sorting. I will also try
> using your preliminary code to return the proper language code we need.
> 
> b) I like having this functionality in the t3lib_cs or lang.php, haven't
> thought of it, but I am willing to move the code to the lang.php class,
> is that ok with you? One question though: How do you want the $LANG
> object to decide whether to use the detected method or the parameter
> given in the init() function? As an additional parameter in the init()
> function?
> 
> Option #1: (functionality that overrides init again)
> 
>   $LANG->init('default');
>   // later
>   $browserLang = $LANG->getPreferredBrowserLanguage();

I would prefer "client" instead of "browser". This is the word used in
specs for a reason. On the other side of the connection could eg be a
screen reader or a braille device or whatever.

>   $LANG->init($browserLang);
> 
> Option #2: (additional parameter in init)
> 
>   $LANG->init($lang = 'default', $overrideWithBrowserLanguage = false);
> 
> What do you think? Have you an option #3?

$clientLanguage = $LANG->csConvObj->getPreferredLanguage(
		t3lib_div::getIndpEnv('HTTP_ACCEPT_LANGUAGE')
);
$LANG->init($clientLanguage);

Note: passing HTTP_ACCEPT_LANGUAGE as parameter allows language dection
for other IETF protocols.

Masi


More information about the TYPO3-team-core mailing list