Skip to content
This repository has been archived by the owner on May 11, 2021. It is now read-only.

Commit

Permalink
Munge text to make i18n singular forms unique.
Browse files Browse the repository at this point in the history
Summary:
For ngettext strings ("1 test"/"{{num}} tests"), our translation tools
get upset if we see the same singular text in two places, but with two
different plural texts ("1 test"/"{{num}} tests") vs ("1
test"/"%(num)s tests").

There were two places this happened in khan-exercises, one because
a weird line-breaking choice made two plurals look different that were
actually the same, and the other because of a distinct varname.  We
solve the second in the normal way of replacing '1' with 'varname', so
that the singular forms now differ.

Task T1562

Test Plan:
Ran
   tools/pybabel extract -F tools/babel.ini khan-exercises
without errors.

Reviewers: james, eater, alpert

Reviewed By: alpert

CC: alpert

Maniphest Tasks: T1562

Differential Revision: http://phabricator.khanacademy.org/D4139
  • Loading branch information
csilvers committed Sep 13, 2013
1 parent 3f959d5 commit 5022d17
Show file tree
Hide file tree
Showing 3 changed files with 4 additions and 4 deletions.
4 changes: 2 additions & 2 deletions exercises/area_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,8 +149,8 @@
<span data-if="isSingular(L)">
The length is <var>L</var> <var>UNIT_TEXT</var>.
</span><span data-else="">
The length is <var>L</var> <var>plural_form(UNIT_TEXT, L)
</var>.</span>
The length is <var>L</var> <var>plural_form(UNIT_TEXT, L)</var>.
</span>
<span data-if="isSingular(W)">
The width is <var>W</var> <var>UNIT_TEXT</var>.
</span><span data-else="">
Expand Down
2 changes: 1 addition & 1 deletion exercises/decimals_on_the_number_line_1.html
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@
<p><code>\pink{<var>SOLN_TXT</var>} = \purple{<var>MARK_INCREMENT</var>} \times \green{<var>TENTHS</var>}</code></p>

<p data-if="isSingular(TENTHS)">
Therefore, moving the orange dot <code>\green{1}</code>
Therefore, moving the orange dot <code>\green{<var>TENTHS</var>}</code>
place will put it at the position <code>\pink{<var>SOLN_TXT</var>}</code>.
</p>
<p data-else="">
Expand Down
2 changes: 1 addition & 1 deletion exercises/decimals_on_the_number_line_2.html
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</code></p>

<p data-if="isSingular(HUNDRETHS)">
Therefore, moving the orange dot <code>\green{1}</code>
Therefore, moving the orange dot <code>\green{<var>HUNDRETHS</var>}</code>
place will put it at the position <code>\pink{<var>SOLN_TXT</var>}</code>.
</p>
<p data-else="">
Expand Down

0 comments on commit 5022d17

Please sign in to comment.