Closed
Bug 783202
Opened 12 years ago
Closed 12 years ago
Make l10n_utils.dotlang._ able to extract strings to specific file
Categories
(www.mozilla.org :: Bedrock, defect, P2)
Tracking
(Not tracked)
RESOLVED
FIXED
People
(Reporter: Milos, Assigned: pmac)
References
(Blocks 1 open bug)
Details
(Whiteboard: u=localizer c=l10n p=2)
Currently, our l10n_utils.dotlang._ method extract strings straight into main.lang files. We'd need that method to accept another parameter to pick which .lang file we want the string to be extracted to.
Updated•12 years ago
|
Blocks: bedrock-l10n
Comment 1•12 years ago
|
||
To make the request clearer, we can define in a template which .lang file to use for a page, for example {% add_lang_files "whatsnew" %}. But there are strings that are not part of a template because they are not in a pure web context (email strings for example), and then bedrock falls back to main.lang which is not what we want.
Updated•12 years ago
|
Component: www.mozilla.org → General
Product: Websites → www.mozilla.org
Comment 2•12 years ago
|
||
ok, this bug is actually impacting our work on the contribute page, we are currently targetting a few locales until we feel confortable going large scale (that means having a native speaker per locale volunteering to manage incoming form requests, so that will be gradual) and currently the strings for the contact form are extracted into main.lang shared by all locales, sending the signal to localizers that we are ready to have that page in 90 languages, which I don't think is realistic as of today :).
CCing Ben,
Ben could we put this bug into the next sprint? Thanks
Blocks: 755351
Updated•12 years ago
|
Whiteboard: u=localizer c=l10n p=2 [sb-sprint]
Updated•12 years ago
|
Component: General → L10N
Summary: [bedrock] Make l10n_utils.dotlang._ able to extract strings to specific file → Make l10n_utils.dotlang._ able to extract strings to specific file
Updated•12 years ago
|
Component: L10N → Bedrock
Updated•12 years ago
|
Assignee: nobody → pmac
Assignee | ||
Comment 4•12 years ago
|
||
Would you want to specify this per call to `_()`, or would it be better to be able to specify per python file, like with a function call `set_lang_file('blah')` at the top of the file?
Comment 5•12 years ago
|
||
ideally both ? ;) But setting that at the top of a python file would already be a great step forward.
Updated•12 years ago
|
Whiteboard: u=localizer c=l10n p=2 [sb-sprint] → u=localizer c=l10n p=2
Assignee | ||
Comment 6•12 years ago
|
||
Submitted https://github.com/mozilla/bedrock/pull/394
This adds the ability to add a `LANG_FILES` constant to python files that will work like the `add_lang_files` tag in templates. The value can be a single name (e.g. 'firefoxos') or a list of strings (e.g. ['firefoxos', 'b2g']). The docs are updated with more info.
It turned out that adding an extra argument to the `_` function was impossible without patching multiple external libraries. I think this works better anyway.
Status: NEW → ASSIGNED
Assignee | ||
Updated•12 years ago
|
Component: Bedrock → L10N
Updated•12 years ago
|
Component: L10N → Bedrock
Comment 7•12 years ago
|
||
Commit pushed to master at https://github.com/mozilla/bedrock
https://github.com/mozilla/bedrock/commit/e3a5eae6250215eed0e1a92fb0aa380a19106010
Add ability to specify lang files in python src.
* Fix bug 783202.
* Update docs.
Updated•12 years ago
|
Status: ASSIGNED → RESOLVED
Closed: 12 years ago
Resolution: --- → FIXED
Comment 8•12 years ago
|
||
Commit pushed to master at https://github.com/mozilla/bedrock
https://github.com/mozilla/bedrock/commit/c6240235249f956dc2070eb3257b91cc1169f690
Use SkipTest from nose as skip is only in Py 2.7+.
bug 783202.
Comment 9•12 years ago
|
||
awesome, thanks pmac ! :)
You need to log in
before you can comment on or make changes to this bug.
Description
•