Language changes suddenly - MarkusDippold - 11-10-2009
Hi,
from one second to the next, the admin-panel and the user-panel change their languages to english.
I have no idea, what has happend.
Changing the language in the options-folder in the admin-panel seems to have an effect only to the name of the month, that is shown in the gallery. All texts of mouse-over, titles, buttons is in english.
In moment the language-option is set to "http accept language".
Link to the gallery: http://modellbahn.dippold.org/
Have anyone an idea, what to do?
Regards,
Markus
Language changes suddenly - sbillard - 12-10-2009
With HTTP accept language set, the language selection will be based on what the browser says is the prefered language. If no prefered language translation exists then Zenphoto will select English.
please see http://www.zenphoto.org/2009/03/troubleshooting-zenphoto/#3 for a script which might help you figure out what is happening.
Language changes suddenly - MarkusDippold - 12-10-2009
Hi,
the result of list_locales.php is this:
`
Http Accept Languages:
Key code coef morecode fullcode
1.0-de de 1.0 de de_de
0.8-de de 0.8 de
0.5-en en 0.5 us en_us
0.3-en en 0.3 en
Supported locales:
C
cs_CZ cs_CZ.iso88592 cs_CZ.utf8
czech
da_DK da_DK.iso88591 da_DK.utf8
danish dansk
de_DE de_DE@euro de_DE.iso88591 de_DE.iso885915@euro de_DE.utf8
deutsch
en_US en_US.iso88591 en_US.iso885915 en_US.utf8
es_ES es_ES.iso88591 es_ES.utf8
français
french
fr_FR fr_FR@euro fr_FR.iso88591 fr_FR.iso885915@euro fr_FR.utf8
german
hu_HU hu_HU.iso88592 hu_HU.utf8
hungarian
nl_NL@euro nl_NL.iso885915@euro nl_NL.utf8
pl_PL pl_PL.iso88592 pl_PL.utf8
polish
portuguese
POSIX
pt_PT pt_PT.iso88591 pt_PT.utf8
ru_RU ru_RU.koi8r ru_RU.utf8
russian
spanish
sv_SE sv_SE.iso88591 sv_SE.utf8
swedish
tr_TR tr_TR.iso88599 tr_TR.utf8
turkish
`
But the prefered language of my browser is german.
Setting the language in the option-folder if ZenPhoto to german, the texts are still in english.
Setting the language in the option-folder to french, the texts are still in english.
Setting the language in the option-folder to polish, the texts are still in english.
Only the name of the months changes the language.
I'm uploading in moment the locales-directory. Maybe this will work.
Regards,
Markus
Language changes suddenly - MarkusDippold - 12-10-2009
Copying the files doesn't work.
So I do a little trick: I copied the LC_MESSAGES-directory from de_DE to en_US.
The en_US-directory was empty before except the file select_files_button.png .
Regards,
Markus
Language changes suddenly - sbillard - 12-10-2009
You can try setting the DEBUG_LOCALE define to true in function-i18n.php. This will log the language selection process into the debug log. Also, were there any warnings from setup.php?
Language changes suddenly - MarkusDippold - 13-10-2009
"Also, were there any warnings from setup.php?"
No, the gallery worked fine during the last few weeks.
Last sunday all texts are in german. I've uploaded a new picture, all texts are still in german. I clicked through the gallery, all texts are in ... german.
I clicked to the next picture: All texts are in english.
Seems to be a little bit strange.
Yesterday I have tested, if gettext() is available with my hoster. It is.
The if-conditions is NOT called, so the dummy-function of the gettext.inc will be not used. To be absolutly sure, I added to the return-string a few letters. The dummy-function in gettext.inc is definitely not used.
As I wrote above, I copied the Messages-directory from de_de to en_us. This is a workaround for me. I don't expect a lot of foreign visitors to my gallery. All my descriptions are in german also.
Today in the evening, I will set the DEBUG_LOCALE.
Regards,
Markus
Language changes suddenly - MarkusDippold - 13-10-2009
Ok, I deleted the message-directory en_US, so the original state for this is established.
This ist the output. I changed the language from English (not traced here) to HTTP Accept Language to German to French to English. The texts are always shown in english.
Backtrace: getUserLocale() getUserLocale called from setMainDomain (functions-i18n.php [212]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] locale from option: de_DE; dynamic locale= Returning locale: de_DE Backtrace: setupCurrentLocale(, ): locale=de_DE, $result=de_DE.UTF-8 setupCurrentLocale called from setMainDomain (functions-i18n.php [213]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] Backtrace: getUserLocale() getUserLocale called from setMainDomain (functions-i18n.php [212]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] locale from option: ; dynamic locale= parseHttpAcceptLanguage(de-de,de;q=0.8,en-us;q=0.5,en;q=0.3) $accepted => ( 1.0-de => ( code => de, coef => 1.0, morecode => de, fullcode => de_de ), 0.8-de => ( code => de, coef => 0.8, morecode => , fullcode => de ), 0.5-en => ( code => en, coef => 0.5, morecode => us, fullcode => en_us ), 0.3-en => ( code => en, coef => 0.3, morecode => , fullcode => en ), ) locale set from HTTP Accept Language: de_DE Returning locale: de_DE Backtrace: setupCurrentLocale(, ): locale=de_DE, $result=de_DE.UTF-8 setupCurrentLocale called from setMainDomain (functions-i18n.php [213]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] Backtrace: getUserLocale() getUserLocale called from setMainDomain (functions-i18n.php [212]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] locale from option: ; dynamic locale= parseHttpAcceptLanguage(de-de,de;q=0.8,en-us;q=0.5,en;q=0.3) $accepted => ( 1.0-de => ( code => de, coef => 1.0, morecode => de, fullcode => de_de ), 0.8-de => ( code => de, coef => 0.8, morecode => , fullcode => de ), 0.5-en => ( code => en, coef => 0.5, morecode => us, fullcode => en_us ), 0.3-en => ( code => en, coef => 0.3, morecode => , fullcode => en ), ) locale set from HTTP Accept Language: de_DE Returning locale: de_DE Backtrace: setupCurrentLocale(, ): locale=de_DE, $result=de_DE.UTF-8 setupCurrentLocale called from setMainDomain (functions-i18n.php [213]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] Backtrace: getUserLocale() getUserLocale called from setMainDomain (functions-i18n.php [212]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] locale from option: de_DE; dynamic locale= Returning locale: de_DE Backtrace: setupCurrentLocale(, ): locale=de_DE, $result=de_DE.UTF-8 setupCurrentLocale called from setMainDomain (functions-i18n.php [213]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] Backtrace: getUserLocale() getUserLocale called from setMainDomain (functions-i18n.php [212]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] locale from option: de_DE; dynamic locale= Returning locale: de_DE Backtrace: setupCurrentLocale(, ): locale=de_DE, $result=de_DE.UTF-8 setupCurrentLocale called from setMainDomain (functions-i18n.php [213]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] Backtrace: getUserLocale() getUserLocale called from setMainDomain (functions-i18n.php [212]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] locale from option: fr_FR; dynamic locale= Returning locale: fr_FR Backtrace: setupCurrentLocale(, ): locale=fr_FR, $result=fr_FR.UTF-8 setupCurrentLocale called from setMainDomain (functions-i18n.php [213]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] Backtrace: getUserLocale() getUserLocale called from setMainDomain (functions-i18n.php [212]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] locale from option: fr_FR; dynamic locale= Returning locale: fr_FR Backtrace: setupCurrentLocale(, ): locale=fr_FR, $result=fr_FR.UTF-8 setupCurrentLocale called from setMainDomain (functions-i18n.php [213]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] Backtrace: getUserLocale() getUserLocale called from setMainDomain (functions-i18n.php [212]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10] locale from option: en_US; dynamic locale= Returning locale: en_US Backtrace: setupCurrentLocale(, ): locale=en_US, $result=en_US.UTF-8 setupCurrentLocale called from setMainDomain (functions-i18n.php [213]) from require_once (functions.php [44]) from require_once (admin-functions.php [12]) from admin-options.php [10]
For me, this looks fine.
I have uploaded the locales-directories yesterday. This should be ok.
Regards,
Markus
Language changes suddenly - sbillard - 13-10-2009
I do not know why it is not working. The trace shows that it is finding the correct HTTP accept language and setting locale to it. So I guess there is a problem with setting the locale on your server.
Language changes suddenly - itaymesh - 29-05-2010
I not sure if it related to the problem above, but I also used dynamic locale plugin (which great) and the languages also switched suddenly.
I tested it some more (especially in IE 7 & 8) and found out that there a cache problem: the browser loads the page with the language that been used must recently.
I had to disable browser caching (which is not so good I think) in zenphoto index.php page (at root directory):
/**
- Invoke the controller to handle requests
*/
require_once(dirname(FILE). "/".ZENFOLDER.'/controller.php');
header ('Content-Type: text/html; charset=' . getOption('charset'));
// disable browser caching so dynamic locale will function properly
header( "Cache-Control: no-cache, must-revalidate" );
header( "Expires: Mon, 20 Dec 1998 01:00:00 GMT" );
header( "Pragma: no-cache" );
I will try to find a more optimized solution for this problem.
Any suggestions meanwhile?
Language changes suddenly - itaymesh - 29-05-2010
by the way sorry about the bad English. I the post quickly :)
|