Language changes suddenly

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

Comments

  • 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.
  • 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
  • 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
  • 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?
  • "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
  • 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
  • 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.
  • 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?
  • by the way sorry about the bad English. I the post quickly :)
  • I know that IE8 does seem to be overly agressive in retaining cache pages. I can change CSS files and not get IE to render the changes whereas FF will notice the change and do things correctly.
  • acrylian Administrator, Developer
    You probably could also use our html_meta_tags plugin to disable the browser caching.
  • mikeque Member
    I am experiencing something somewhat similar. I am working on a multi-language website that allows the user to switch between English and Spanish. Switching the language works on accessing the pulldown, but doesn't stick. As soon as I navigate to another page, the language selection is lost.

    In trying to isolate the problem, I even tried create a new database from the setup page and switched to the default theme, and the problem persists. I regressed the installation to 1.2.9, and the problem goes away. Could there be something in the 1.3 release causing this?
  • Well, the language setting should be remembered by a cookie. I do not think that changed from 1.2.9 to 1.3, but of coures it is possible that something has impacted it.

    At any rate, there is a define, `DEBUG_LOCALE`, in functions-i18n that if you set to true will record all sorts of information on how the language selection is being made.
  • I did find the problem. Somehow the saving of the language to a cookie was lost. That is restored in tonight's build. For the adventurous, the change is isolated to the functions-i18n.php script. That script may be used to replace the one that is included with the 1.3.0 release with no problems.
  • great! thanks
Sign In or Register to comment.