L10n issues in confirmation e-mail #2212

gion-andri opened this Issue Aug 3, 2012 · 14 comments

5 participants


The new HTML mails seem to have some problems:

  • One string contains some strange caracters: #~
  • And one string apparently is untranslatable.
@lloyd lloyd was assigned Aug 3, 2012

reproduced, 5 star issue, assigned to me. I'll get to it within 24 hours.


for reference, this issue is not present in our dev branch using debug locale it-CH, expect it's a matter of finding the commit that fixes it and backporting into train-2012.07.30


po2json.js is not properly parsing lines with #~ prepended to them in the pofiles. I don't really understand the conditions under which such a thing is pre-pended.

The fix is a commit to svn:

$ svn diff
Index: po2json.js
--- po2json.js  (revision 108004)
+++ po2json.js  (working copy)
@@ -207,7 +207,7 @@

 var parse_po_dequote = function(str) {
   var match;
-  if (match = str.match(/^"(.*)"/)) {
+  if (match = str.match(/^(?:#~ )?"(.*)"/)) {
     str = match[1]; 
   str = str.replace(/\\"/g, '"');

/cc @zaach (original author of po2json.js)
/cc @mathjazz || @ozten - can one of you make this commit to svn?


@lloyd r+ for this fix

Mozilla member

My understanding of the po file form... tells me this is a bad idea.

Does this only happen in 1 locale? Let's reach out to that author.

If it happens in all locales, it's that gettext thinks we've removed the string and it's keeping a copy so that locale doesn't lose it's work if the string ever comes back.

@lloyd can you work closely with @mathjazz before making a technical decision on how to fix it?


@lloyd did I say r+? I meant r-
@ozten do you think it's bug in the translation?

Mozilla member

I think I know what the bug is.

These strings were moved into email templates under resources/email_templates (I see 4 copies of the string)

The extract script wasn't updated to look for ejs:


Since this is email (server side gettext), these strings should be added to the first block of messages.po commands.


xgettext -j -L PHP --keyword=_ --output-dir=locale/templates/LC_MESSAGES --output=messages.pot `find resources/email_templates -name '*.ejs'`

ok, @mathjazz please find me on irc or email and I can explain the issue in depth, here's irclogs where I explain it to @ozten:


The question is why are these strings being extracted and added to po files with a #~ prefix?


@ozten good call. Your example should replace line 12, since the templates have moved.

Mozilla member

@zaach - cool

The merge step is what causes the

#~ "I'm an old string"

Merge takes messages.pot (which doesn't have this string) and pushes it into the existing messages.po file. Any "deleted" strings are prefixed with #~.


AHA! nice @zaach - yeah, email templates now live under resources/email_templates I will fix the patch in a couple hours unless someone else beats me to it.

Is there any reason not to also fix po2json.js? Because without my change, the #~ prefixes get included in the msgid, which is almost certainly wrong.

@zaach zaach was assigned Aug 3, 2012

@lloyd though seeing #~ does serve as a nice warning that we probably screwed something up.


@zaach I'm sold. we're good.

@mathjazz, this requires a string re-extraction against commits pushed to train-2012.07.30! if this means we don't get translations done in time, then so be it, we will follow your lead on what is reasonable to expect from l10n folks.

@lloyd lloyd closed this Aug 3, 2012

I re-extracted the strings and notified localizers, some of them will translate them, the others will do that for the next release.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment