Closed Bug 492823 Opened 15 years ago Closed 15 years ago

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

Categories

(Websites Graveyard :: mozillaservice.org, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED

People

(Reporter: stas, Assigned: stas)

Details

Attachments

(3 files)

      No description provided.
Attachment #377229 - Flags: review?(ozten.bugs)
Attached file 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.
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?
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 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+
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.
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".
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
Stas great work. Closing bug.
Status: NEW → RESOLVED
Closed: 15 years ago
Resolution: --- → FIXED
Target Milestone: --- → 1.0
Verified FIXED.
Status: RESOLVED → VERIFIED
Product: Websites → Websites Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: