Hi everybody,
My customer asked me to change the default French text translation, from "Ajouter photo au panier" to "Cliquer sur la photo désirée" (the English text is "Add photo To Cart").
I already know that to change the text I need to edit fr.po, save it, then rename the resulting fr.mo to modules_checkout.mo, then put the new file to the right folder. I have been able to change many other text.
I'm facing problem in changing the translate this specific text, where the original text contains "%s". It should represent a variable for "photo" or "album", depend on the page context, I think. So, I tried to change the French part to: "Cliquer sur la %s désirée". But this didn't run well.
I have tested "Ajouter %s désirée", and it run well (I don't know about the meaning of the resulting French text).
But this: "Cliquer %s désirée" didn't run well.
Are there any specific things that I need to consider in translating this kind of text (the one with "%s")?
FYI, I don't know French at all, I just change the text per customer's request.
Thanks in advance.
Regards,
Albert
Posts: 4342
"Cliquer %s désirée" should work ok. Make sure you have the "#, c-format" comment line too.
A quick look at the latest fr.po suggests it's well out of date, though - a lot of the text has changed and not been re-translated, and therefore will only show up in English. Any volunteers?
Posts: 7
Hi Alec,
The problem is, the text "Cliquer %s désirée" is not what the customer want. They want "Cliquer sur la photo désirée" or in the po file "Cliquer sur la %s désirée", which is not working. Why is it not working?
I also have tried, just to fulfill my curiosity, "BAjouter %s au panier" (see the additional B in the beginning of the sentence?). And it was not working also.
What I mean with "not working" is, the text being shown was back to English, while the rest of the page still in French.
Regards,
Albert
Posts: 7
Oh, and about "#, c-format", where should I put it?
I suppose I don't need to edit anything else, beside the po, since the original French text also uses "%s". CMIIW
Posts: 4342
I have no idea.
In general you need to:
-make sure the original text in the module matches the original text in the .po
-recompile the .po
-rename the .mo to modules_checkout.mo
-move it to the g2data/locale/fr/LC_MESSAGES/ directory
-possibly flush the relevant Apache/gettext cache (I have no information about this)
Same places as in the original .po file - just make sure you haven't disturbed it.
By the way, see all the lines that begin with "#, fuzzy"? They won't be translated. Like I said, a French-speaker needs to go through that file and bring things up to date before it's worth using. All the lines that begin with ~ can be deleted too.
Posts: 7
Hmmm..
This is a working French website. They only need to replace some text with another ones.
I get all po files from the working modules. Then I edit the po files, get new mo files, rename it to modules_checkout.mo (or other name, depend on the module name), put it to the g2data/locale/fr/LC_MESSAGES/.
So far, I don't need to flush the cache, as the changes has been shown.
I'm using Poedit, that's why I didn't see the "#, c-format". I just saw it after I opened the po files in regular text editor.
Poedit doesn't touch "#, c-format", does it?
Posts: 4342
I understand. But I'd like someone to provide an up-to-date translation. I'm asking if you can help.
Posts: 7
I'm really sorry Alec. I don't know anything about French.
The changes that my customer requested are the existing ones. There's no new original English text that are translated.
Of course I can send you the po files that I edit. But it wouldn't add new translated text.
Thanks for your explanation for me.
Posts: 4342
Well good luck with getting the translation of that line sorted ... I loathe translation problems. Please post if you find the reason.