Translation problems

I try to install zenphoto on my NAS (Synology DS211j). This server doesn't support locale function and I think that it doesn't support gettext too. I only want to make a website in french. So I would like to translate words in zenphoto in french. I think that it's necessary to use the file gettext.inc in zp-core\lib-gettext, remove the character "/" in some part of the code and place the beginning by a copy of the translation available in zenphoto.po. I'm newbie in this type of software. I do like that and nothing works. Can you help me to do the right thing? Thank you.

Comments

  • All of the language support of Zenphoto relies on both locale support on the server and gettext() function support in PHP. There is a translators tutorial on how we do this. See the bottom of this page.

    While I suppose it would be possible for you to manually translate the strings within the Zenphoto code it really is not a good idea for several reasons:

    First: there are a whole bunch of strings that need translation. Over 3000 if my memory is correct.

    Second: we have a good ongoing French translaton, so your work would be redundant.

    Third: Things like dates, currency, etc. depend on the locale working within PHP, no way for you to translate them.

    Finally: any time we update Zenphoto your work will be dashed.

    You would be better advised to figure out how to get the built-in translations working either by figuring out how to get locale and gettext onto your server or by finding a different server.

    I am not so sure that the Synology DS211j is really the issue. Presumably it is running some form of Linux and Apache. Those should be configurable to have the needed support.

    For PHP it is just a matter of having the php_gettext module enabled. Sorry, but I do not know how to be sure Apache is properly set for locales. (I use the Windows based WAMP server that is packages with working PHP and Apache.)
  • I'm sure that the best way is to do like you told me. I've tested that my NAS supports gettext function. It's OK.

    So my only problem is now to force the data which register the language to french to avoid using locale() because I've received this message during the setup:
    PHP setlocale() failed Locale functionality is not implemented on your platform or the specified locale does not exist. Language translation may not work.

    But when I run the function phpinfo(), I've received this information:

    HTTP Headers Information
    Cookie stay_login=0; zenphoto_auth=f736b7b5f6c2541ec2257750912e42e142c91591; dynamic_locale=fr_FR; uploadtype=httpupload

    PHP Variables
    _COOKIE["dynamic_locale"] fr_FR
    _SERVER["HTTP_COOKIE"] stay_login=0; zenphoto_auth=f736b7b5f6c2541ec2257750912e42e142c91591; dynamic_locale=fr_FR; uploadtype=httpupload
    Apache Environment

    HTTP_COOKIE stay_login=0; zenphoto_auth=f736b7b5f6c2541ec2257750912e42e142c91591; dynamic_locale=fr_FR; uploadtype=httpupload

    With that, in fact, I don't understand if set locale run or not? What do you think about that?
  • acrylian Administrator, Developer
    The values you got are about cookies set by Zenphoto to store the language. Fact is without the locale functionality and an locale for French (the language(s) you wish to use) installed you will not be able to use gettext and the translation capability.
  • fretzl Administrator, Developer
    Synology has no easy built-in support for locales.
    The only way to add a language I found is on this blog:
    `http://www.jfpblog.fr/index.php?post/2011/08/18/Add-Locale-to-synology-DSM3.1`.
    And I'm not even sure if it works.

    Maybe the best thing to do is email Synology directly and ask them if they have a solution by now. You'll not be the first to ask ;-)
Sign In or Register to comment.