Cannot enable second language

I'd like to enable Spanish as second language on my zenphoto 1.4.12 installation, but Spanish cannot be enabled in the Options -> General -> Language list (the checkbox is grayed out).

I have enabled "Multi-lingual" in Options -> General -> Language, Spanish translations are installed in `zp-core/locale/es_ES/` and `locale -a` lists `es_ES.utf8`.

Current locale setting as shown in toe "Overview" tab is `en_US.UTF8`.

Did I miss anything?

Thanks a lot in advance,
Christoph

Comments

  • fretzl Administrator
    No idea. I can't reproduce this.
    Any errors in the Zenphoto logs or in the server logs?
  • acrylian Administrator
    Actually the file names should matter but within the translation files it is indeed marked as Argentinian Spanish so technically it is `es_AR`.

    Besides the request for errors by fretzl: Do you have any other locales on your server that do work?
  • vlc Member
    Thank for the replies!

    I checked the normal logs and only found tons of GET requests from zenphoto in "apache2/access.log", but no warnings, errors or failures.

    In "zp-data/setup.log" I found the following:

    `Warn: PHP setlocale() failed Locale functionality is not implemented on your platform or the specified locale does not exist. Language translation may not work.See the user guide on zenphoto.org for details.`

    I also installed German language support (de_DE.utf8) on my server, but same result.

    Concerning es_AR: The Spanish locale is called "es_ES" in "zp-data/locale", not "es_AR" (?).
  • vlc Member
    I just deleted the installation and dropped the database to start all over again and now it works.

    The only thing I could imagine is that during the first installation the only English locale installed on the server was en_IE and not en_US, but my browser requests en_US as locale. Maybe this caused some kind of glitch during installation which prevented enabling other languages (?).
  • acrylian Administrator
    The error is interesting since `setlocale` is a server PHP setting. If that is missing, just dropping a database would not fix if it is missing. But whatever worked for your ;-)
    browser requests en_US as locale
    What the browser itself requests is actually a browser setting.
    But besides that the default language (that without any translation) of Zenphoto is indeed `en_US`. But you could add an empty `en_IE` folder to the `/zp-core/locale/` folder to enable any locale even without translation files. If there are not translations present you will just get the default English instead.
    Concerning es_AR: The Spanish locale is called "es_ES" in "zp-data/locale", not "es_AR" (?).
    I just looked into the translation file catalog. That's what the authors set back then as they were located in Argentinia. But i think they translated in quite "general Spanish" if I recall talk about that.
    Technically the file name should indicated the language. I am offhand just not sure if the PHP gettest functions pay atention to the internal language set within the file somehow, too.
  • vlc Member
    It seems I cannot select any language which isn't available on the system, i.e. only being available in "zp-core/locale" isn't sufficient.

    Now I installed Russian (ru_RU.utf8) on the server (and rebooted it in case of need), but Russian can still not be selected under Options -> General -> Language (checkbox is grayed out). It seems that I can only select languages that have been available on my system at installation / setup of zenphoto.
  • vlc Member
    It seems I have to run a new setup from Overview -> Utility functions for a newly installed language to be available.

    If this is the intended behavior one could maybe mention it on "http://www.zenphoto.org/news/multi-lingual-sites/".
  • acrylian Administrator
    I probably replied misunderstandable. I was just referring to use an English variant if you have en_IE but en_US is present.

    Besides that you of course need the locale installed on your server for the language you wish to use. That's PHP requirement.

    That is noted on the multilingual article you linked in a separate box just a bit below in the page. Probably we should move that right to the beginning of the article. Will do that.
  • vlc Member
    I knew that I needed the corresponding language installed on my system. That wasn't the problem. I was not aware that I have to run setup again after I installed a new language on the system.
  • acrylian Administrator
    Actually you should not need to re-run setup for a new translation file to work…
  • vlc Member
    With translation file do you refer to a new translation under "zp-core/locale"? There I haven't touched anything.

    Maybe it's not completely clear what I've done:
    1. Copy zenphoto to the server.
    2. Run initial setup.
    3. Install new language (ru_RU) on server (on my Debian box with `dpkg-reconfigure locales`).
    4. New language cannot be selected under Options -> General -> Language.
    5. Run setup again from Overview -> Utility functions.
    6. Now the new language can be selected under Options -> General -> Language.
  • acrylian Administrator
    In Zenphoto terms translation means a folder with `.mo`/`.po` translation files within `/zp-core/locale/`. You were referring to the server locale which is not a translation. It just provides some capabilities for automatically generated output like month/day names etc.

    If you instal a new locale on a server it would not be surprising if you would need to restart the server itself. But Zenphoto's setup should not be related, unless I missed something. But I never isntalled locales on a server as I am not server admin.
  • vlc Member
    Sorry for the confusion ...

    I just checked again by installing French locale: the setup step is necessary; plus restarting the server.

    To complete my list from above:
    1. Copy zenphoto to the server.
    2. Run initial setup.
    3. Install new locale on server (on my Debian box with `dpkg-reconfigure locales`).
    4. New language cannot be selected under Options -> General -> Language.
    5. Restart server (`service apache2 restart` for me)
    6. Run setup again from Overview -> Utility functions.
    7. Now the new language can be selected under Options -> General -> Language.
    Restarting only the server doesn't do the trick.
  • acrylian Administrator
    Sure. that no browser or any server cache played tricks on your here? I did test a lot of translation files and I never had to re-run setup for them. But again I never installed any locales on the server myself. Possibly servers are different here as in many other things . But in the end it now works for your and that's what counts, right? :-)

    We could add a section to the article that this might be a reason. but this is not really zenphoto specific I think. gettext and locales are used by a lot of other systems as well.
  • vlc Member
    For me the issue is closed, thanks a lot!

    I just wanted to leave some details in case someone else runs into the same problem and knows how to use a search engine.
  • acrylian Administrator
    All right, thanks!
Sign In or Register to comment.