Last Comment Bug 774234 - [bedrock] need to be able to define per locale l10n blocks
: [bedrock] need to be able to define per locale l10n blocks
Status: RESOLVED FIXED
u=localizer c=l10n p=0
:
Product: www.mozilla.org
Classification: Other
Component: Bedrock (show other bugs)
: unspecified
: All All
: P1 normal
: Future
Assigned To: Paul [:pmac] McLanahan
:
Mentors:
Depends on:
Blocks: bedrock-l10n
  Show dependency treegraph
 
Reported: 2012-07-16 05:18 PDT by Pascal Chevrel:pascalc
Modified: 2013-02-14 12:06 PST (History)
6 users (show)
See Also:
Locale:
QA Whiteboard:
Iteration: ---
Points: ---


Attachments

Description Pascal Chevrel:pascalc 2012-07-16 05:18:10 PDT
You can define an l10n block for a template that allow customization of a portion of the page, here is an example in the Firefox 14 whatsnew page where we added a specific paragraph to the Russian page to announce a partnership change affecting users of this locale:
https://github.com/mozilla/bedrock/commit/45e285c3b2962f425449d82f37d65ec9c47e4c85#L0R39

Extracting this template just for Russian is easy:
manage.py l10_check ru

But the next time I run an l10n_check for all locales, that l10n block is going to be extracted in the locale folder for all of our locales.

We need a way to define in the l10n block that this only affect one locale or a set of locales, something like:

{% l10n whatsnew_feature ; locales=ru,uk,es-ES ; 20120712 %}
Comment 1 Ben (:bensternthal) 2012-09-18 13:51:48 PDT
Triaging, these needs analysis by bedrock devs.
Comment 2 Kushal Das 2012-11-07 03:07:33 PST
Pull request created in https://github.com/mozilla/bedrock/pull/455
Comment 3 Anthony Ricaud (:rik) 2012-11-13 08:34:54 PST
I think a better syntax for this would be:
{% l10n whatsnew_feature locales=ru,uk,es-ES 20120712 %}

Separator is a space. This will require changing the existing usage of this tag but it's a quick thing.
Comment 4 Jennifer Bertsch [:jbertsch] 2012-12-06 16:27:35 PST
We'll most likely need this functionality as part of the MWC wave.
Comment 5 Paul [:pmac] McLanahan 2013-01-28 13:46:25 PST
Taking this and finishing up the work started by Kushal. Thanks again for the help Kushal!
Comment 6 [github robot] 2013-02-04 19:12:52 PST
Commits pushed to master at https://github.com/mozilla/bedrock

https://github.com/mozilla/bedrock/commit/106ba2120f95b56771f6a4e7ab7e39a3f1592401
Bug 774234: we can now define per locale l10n blocks

The blocks can be any of these 3 style:

{% l10n whatsnew_feature locales=ru,bn-IN 20120712 %}
{% l10n whatsnew_feature 20120712 %}
{% l10n whatsnew_feature, 20120712 %}

For the First example we will have templates in the given two
languages.
2nd and 3rd example, we will have the templates for all locales.

https://github.com/mozilla/bedrock/commit/872e98b11ec533a508a328d7a65705b33f8433c7
Bug 774234: Add tests for l10n blocks and langs support.

Refactor template handling and parsing.

https://github.com/mozilla/bedrock/commit/28bdd5e4ed5f6fae275d2bc8901568b8ed4bf97a
Merge pull request #614 from pmclanahan/bug-774234-l10n-block-locales-support

Bug 774234: Add langs definition to l10n blocks.
Comment 7 Paul [:pmac] McLanahan 2013-02-14 12:06:08 PST
This is in production.

Note You need to log in before you can comment on or make changes to this bug.