Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

L10n issues in confirmation e-mail #2212

Closed
gion-andri opened this Issue · 14 comments

5 participants

Gion-Andri Cantieni Lloyd Hilaiel Zach Carter Austin King Matjaž Horvat
Gion-Andri Cantieni

The new HTML mails seem to have some problems:
http://imgur.com/NAyKO

  • One string contains some strange caracters: #~
  • And one string apparently is untranslatable.
Lloyd Hilaiel lloyd was assigned
Lloyd Hilaiel

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

Lloyd Hilaiel

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

Lloyd Hilaiel

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?

Zach Carter
Owner

@lloyd r+ for this fix

Austin King
Collaborator

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?

Zach Carter
Owner

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

Austin King
Collaborator

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:

https://github.com/mozilla/browserid/blob/dev/scripts/extract_po.sh#L8

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

Example:

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

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:

http://irclog.gr/#show/irc.mozilla.org/identity/134140

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

Zach Carter
Owner

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

Austin King
Collaborator

@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 #~.

Lloyd Hilaiel

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.

Zach Carter zaach was assigned
Zach Carter
Owner

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

Lloyd Hilaiel

@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 Hilaiel lloyd closed this
Matjaž Horvat
Collaborator

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
Something went wrong with that request. Please try again.