contact form not translating + solution

hi. I make a french gallery, and I noticed that for some contact form elements like Name, E-mail, etc the text didn't get translated, they were still in english.

I also found the solution: in /zp-core/plugins/contact-form/form.php there are columns (":") missing in some of the gettext calls.

For example, it should be gettext("Name%s:") instead of gettext("Name%s" - otherwise it doesn't correspond to the original english text, and I suppose that's why it doesn't automatically get translated.

Comments

  • sorry: the text above should read:

    For example, it should be `gettext("Name%s:")` instead of `gettext("Name%s")` - otherwise it doesn't correspond to the original english text, and I suppose that's why it doesn't automatically get translated.
  • I am not really sure what you are getting at. The text within the `gettext()` function is ALWAYS what will be displayed in English. Also, I see no cases where there is a ':' missing from the text.

    So, since you have not given us any information on your configuration (http://www.zenphoto.org/support/topic.php?id=3760) I can only suggest that the translation files you are using do not match the version of zenphoto you are running.
  • acrylian Administrator, Developer
    I second that, gettext does not care if there is a ":" or not. If you parse the file it takes what is there in the gettext call and if you add a translation you can even translate "nonsense" like "Name" with "City". That said translation and original sentence of course do not have to match exactly.

    Besides that I also noticed that sometime the field names are not translated. I had the suspicion that it might be related to the printf/sprintf() calls but I see no reason why that should happen or what do to differently.
  • I guess you are right - I am actually not able to reproduce what happened! Trying to do so actually made things worse: now only the original english text appears again, but I'm not able to make the french translation reappear. Adding or deleting the ":" doesn't change a thing. I'm confused. I should have kept the things like they were, it was working. (I'm using Zenphoto 1.2.2, and I added zenpage plugin but later decided to deactivate it) - I'll let you know when it works again.
  • My french translations are visible again. Deactivating ZenPage did the trick.
  • acrylian Administrator, Developer
    Then I probably know what was happening. The contact-form plugin is an official one so that its translation is included within the main zenphoto translation.

    Zenpage or more exactly the zenpage default theme differently as being a optional plugin has its own translation file (both have their own actually) that is switched to on the theme pages. This means the contact form translation is basically left out even if it is there.

    This is an actually unsolved matter with the gettext locale stuff, not really a true bug but we don't know how to workaround that yet.
  • ok, thanks.
Sign In or Register to comment.