Closed codebuger closed 8 years ago
I'm not clear on what you are asking. Is the French language special in this regard? What do you mean by alignment issues?
Are you saying that you are including '
in a nugget and the corresponding message being stored in the PO files is being HTML-decoded, but you want it left as it is?
For example, I have included a button in jquery like this, $('<input class="btn" type="button" value="[[[Click]]]" title="" /> ');
I am getting error in script that ')' is missing because the translated french text has single quotes(').
After translated PO file to french in google translator, I got po file which has translated text of french language. In this file I have replaced single quote(') by html code('
). And it is working fine.
What I am asking is, we cannot tell customer to manually change this single quotes. Is there any other option in i18n plugin ?
I am getting error in script that ')' is missing because the translated french text has single quotes(').
Sorry to be thick here, but I really don't understand what you mean or what is going on. Perhaps if you would be more precise about what is in source code, what is the corresponding message in the PO file (i.e. the actual entry for the message intems of msgid and msgstr) etc.. Thanks.
Ok. Leave that line. I am getting below line in po file after translated to french.
"Ajouter L'autorisation de l'utilisateur"
. I need to change this single quotes to '
programatically. It is possible in i18n ?
No, not at present. If you are using an automated translation facility, you might look at processing the output from that as appropriate before uploading it to your locale folder. (If there is an issue with i18n then I'm willing to look into that.)
I have below doubts. Please clarify me
I am also looking for option to escape apostrophe in translated strings. Apostrophe cause JS exception in minified java-scripts files because it is reserved symbol by default. Easy to reproduce:
Have you tried l'abonnement
?
Is there any reason for not doing that?
Please re-open if still an issue. Thanks.
@turquoiseowl hello there!
It seams that I'm having issues with apostrophe '
inside i18n translation file inside a Rails App ( ruby '2.7.4'and rails '6.0.3.3')
When I add a translation to a file content/fr.yml, for example: title: "contenu recommandé l'abi"
, it render the string correctly for the concerned content.html.erb file.
However when I add a similar translation to an another file booking/fr.yml, for example content: "l'heure de l'échange."
, it doesn't render the translation properly for the concerned file booking.html.erb
The only known difference to me, is that the second file booking.html.erb is rendered using javascript (specifically jQuery)
The render I have for this transaltion is: l'heure de l'échange
I've tried your syntaxe with '
and also title: 'contenu recommandé l''abi'
but with no success until now.
It seems that I'm missing something here but I cannot figure out what is...
Any clues ?
Update! I have finally found a solution using _html https://guides.rubyonrails.org/i18n.html#using-safe-html-translations
In my application I have used html codes for designing web pages. While using french language, the generated po files having single quotes(') so this leads to alignment issue in webpage. Is there any option to change this in generated po file ?
Note: If I change single quotes(') to html code(
'
) in po file, it is working fine. But I don't want to do this manually.