Change localization to use English strings as msgid's (for gettext)

VERIFIED FIXED in 1.0

Status

Websites Graveyard
mozillaservice.org
VERIFIED FIXED
9 years ago
7 years ago

People

(Reporter: stas, Assigned: stas)

Tracking

unspecified
x86
All

Details

Attachments

(3 attachments)

(Assignee)

Description

9 years ago
Created attachment 377229 [details] [diff] [review]
Use English strings inside gettext's _() function
Attachment #377229 - Flags: review?(ozten.bugs)
(Assignee)

Comment 1

9 years ago
Created attachment 377231 [details]
New messages.po

After applying the patch from comment #0, you can run web/applications/locale/extract-po.sh as many times you want, and it will give you a PO file like this one.

Comment 2

9 years ago
This looks really good, thanks for your help!

Some questions:
I had put comments into the previous messages.po, to explain what %1$s was, etc. How do I do this now?

Comment 3

9 years ago
Once I change some copy and rerun extra, I see that I have two strings (old and new).

Running the process in the README.txt, this merges into other locales. The locale get's a new string that hasn't been translated.

Is this the processes for updates down the road?
Should I manually delete the old string before merging?
Do I need to manually delete the old string from all the locale po files?

Comment 4

9 years ago
Comment on attachment 377229 [details] [diff] [review]
Use English strings inside gettext's _() function

Please commit your patch! Thanks for the great work. I'll have some follow up questions, so I understand the tooling around this processes.
Attachment #377229 - Flags: review?(ozten.bugs) → review+
(Assignee)

Comment 5

9 years ago
Patch from comment #0 committed in r25675.

I'm trying to figure out how to add comments to the PO file automatically, thus leaving the bug open.
(Assignee)

Comment 6

9 years ago
Created attachment 377312 [details] [diff] [review]
Example of how to add comments

OK, got it. Adding comments is easy. You'll just have to modify the extract-po.sh script to use the "--add-comments" option to xgettext. Then, gettext will automatically pick up any PHP comments preceding _() function calls.

I attach a working example of such a comment for one of the strings.

If there are other, non-l10n-related comments in the PHP that shouldn't be picked up by gettext, you can use for example "--add-comments=L10N" in extract-po.sh and then begin each l10n-comment with "L10N".
(Assignee)

Comment 7

9 years ago
Patch landed (see comment 5), stage displays correctly English strings instead of ids and I chatted with Austin on IRC about the next steps and preparing the PO files for localization with msginit, as well as updating them if necessary with msgmerge.

Can we close this bug now?
Assignee: nobody → stas

Comment 8

9 years ago
Stas great work. Closing bug.
Status: NEW → RESOLVED
Last Resolved: 9 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
Verified FIXED.
Status: RESOLVED → VERIFIED

Updated

7 years ago
Component: mozillaservice.org → mozillaservice.org
Product: Websites → Websites Graveyard
You need to log in before you can comment on or make changes to this bug.