Posted: June 21, 2015 at 4:52 pm
Hi! Once again I get back to you looking for help with some text string that I’m unable to translate to portuguese: The string that I’m unable to translate is – “Please note that a maximum number of %d tickets can be purchased for this event per order”. (I have translated it in the language file but it remains in English. Just to be sure I have downloaded and merged the latest language files). Thanks,
|
|
|
Hi, I tested with the following function and the translation seems fine:
I also tested with a random language file (Dutch) from our Glotpress account and that translated the text too. In your translation, did you include the ending period (.)? It was missing from your question. |
Hi Dean! I have checked this and got it working. The difference was in the variable value that is defined as “%d” in the language file but shows as “%1$d” in the gettext function. The missing period was a typo error in my post. Either way, your suggestion helped me to find the issue. Thanks. |
|
Hi Gonçalo, were you able to translate this phrase in your updated language file? — |
|
Hi! I was unable to use the language file for it because the sentence isn’t equal to the one that is returned by the gettext function. |
|
Sorry, My last reply lost the link to the language file: |
|
Hi Gonçalo, I checked this and “Please note that a maximum number of %d tickets can be purchased for this event per order.” is the correct string. |
|
Hi! Sorry for the late reply,… I have checked this also but, for some reason, the translation, using the sentence above in the language file, isn’t working. Only when I inserted the sentence “Please note that a maximum number of %1$d tickets can be purchased for this event per order.” in the local function it worked. Perhaps debugging it with my local language file may shed some light on this… let me know if you are interested in it. Thanks for your help. |
|
Hello, there is a filter available for that messaging. Could you give that a try? https://gist.github.com/lorenzocaum/38baf9ceb1188185187d — |
|
Hello, I’ve replaced the sample function for changing the messaging. Please use this one instead: https://gist.github.com/38baf9ceb1188185187d — |
|
Hi Lorenzo! The function you provided worked just fine. |
|
The support post ‘Untranslated Text (2)’ is closed to new replies.
Have a question about this support post? Create a new support post in our support forums and include a link to this existing support post so we can help you.