Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(94)

Issue 1258833004: Compile plural strings to android <plurals> elem (Closed)

Created:
5 years, 4 months ago by conleyo
Modified:
5 years, 4 months ago
Reviewers:
newt (away)
CC:
grit-developer_googlegroups.com
Base URL:
https://chromium.googlesource.com/external/grit-i18n.git@master
Target Ref:
refs/heads/master
Visibility:
Public.

Description

Compile plural strings to android <plurals> elem In a .grd file, we can write a plural string like this: <message name="IDS_THINGS"> {NUM_THINGS, plural, =1 {1 thing} other {# things}} </message> The android equivalent looks like this: <plurals name="things"> <item quantity="one">1 thing</item> <item quantity="other">%d things</item> </plurals> However, currently the raw value is being stored as a <string> element. This change introduces some basic (certainly not fool-proof) parsing of the plural message in a .grd file and outputs it in the proper android format. BUG= R=newt@chromium.org Committed: https://code.google.com/p/grit-i18n/source/detail?r=192

Patch Set 1 #

Total comments: 18

Patch Set 2 : Handled comments #

Total comments: 6

Patch Set 3 : Handled new review comments #

Patch Set 4 : Removed debugging output (whoops) #

Patch Set 5 : Added a test #

Total comments: 3

Patch Set 6 : Removed debugging output again again again (sorry) #

Unified diffs Side-by-side diffs Delta from patch set Stats (+75 lines, -1 line) Patch
M grit/format/android_xml.py View 1 2 3 4 5 chunks +66 lines, -1 line 0 comments Download
M grit/format/android_xml_unittest.py View 1 2 3 4 5 2 chunks +9 lines, -0 lines 0 comments Download

Messages

Total messages: 23 (5 generated)
newt (away)
Thanks for this change. I think it'll nice to have this available for Android strings. ...
5 years, 4 months ago (2015-08-03 23:06:40 UTC) #2
conleyo
Quick and thorough review. Thanks! https://codereview.chromium.org/1258833004/diff/1/grit/format/android_xml.py File grit/format/android_xml.py (right): https://codereview.chromium.org/1258833004/diff/1/grit/format/android_xml.py#newcode106 grit/format/android_xml.py:106: sys.stderr.write('outputting to %s\n' % ...
5 years, 4 months ago (2015-08-04 00:27:53 UTC) #3
newt (away)
https://codereview.chromium.org/1258833004/diff/20001/grit/format/android_xml.py File grit/format/android_xml.py (right): https://codereview.chromium.org/1258833004/diff/20001/grit/format/android_xml.py#newcode143 grit/format/android_xml.py:143: """Compile ICU plural syntax to the body of an ...
5 years, 4 months ago (2015-08-04 03:14:26 UTC) #4
conleyo
https://codereview.chromium.org/1258833004/diff/20001/grit/format/android_xml.py File grit/format/android_xml.py (right): https://codereview.chromium.org/1258833004/diff/20001/grit/format/android_xml.py#newcode143 grit/format/android_xml.py:143: """Compile ICU plural syntax to the body of an ...
5 years, 4 months ago (2015-08-04 16:53:03 UTC) #5
newt (away)
Looks good. Just waiting for changes to android_xml_unittest.py.
5 years, 4 months ago (2015-08-04 17:32:54 UTC) #6
conleyo
On 2015/08/04 17:32:54, newt wrote: > Looks good. Just waiting for changes to android_xml_unittest.py. Test ...
5 years, 4 months ago (2015-08-04 18:09:10 UTC) #7
newt (away)
lgtm after one last comment https://codereview.chromium.org/1258833004/diff/70001/grit/format/android_xml_unittest.py File grit/format/android_xml_unittest.py (right): https://codereview.chromium.org/1258833004/diff/70001/grit/format/android_xml_unittest.py#newcode83 grit/format/android_xml_unittest.py:83: self.assertEqual(output.strip(), expected.strip(), msg=output.strip() + ...
5 years, 4 months ago (2015-08-04 18:15:11 UTC) #8
conleyo
https://codereview.chromium.org/1258833004/diff/70001/grit/format/android_xml_unittest.py File grit/format/android_xml_unittest.py (right): https://codereview.chromium.org/1258833004/diff/70001/grit/format/android_xml_unittest.py#newcode83 grit/format/android_xml_unittest.py:83: self.assertEqual(output.strip(), expected.strip(), msg=output.strip() + '\n' + expected.strip()) On 2015/08/04 ...
5 years, 4 months ago (2015-08-04 18:53:55 UTC) #9
conleyo
https://codereview.chromium.org/1258833004/diff/70001/grit/format/android_xml_unittest.py File grit/format/android_xml_unittest.py (right): https://codereview.chromium.org/1258833004/diff/70001/grit/format/android_xml_unittest.py#newcode83 grit/format/android_xml_unittest.py:83: self.assertEqual(output.strip(), expected.strip(), msg=output.strip() + '\n' + expected.strip()) On 2015/08/04 ...
5 years, 4 months ago (2015-08-04 22:56:14 UTC) #10
conleyo
On 2015/08/04 22:56:14, conleyo wrote: > https://codereview.chromium.org/1258833004/diff/70001/grit/format/android_xml_unittest.py > File grit/format/android_xml_unittest.py (right): > > https://codereview.chromium.org/1258833004/diff/70001/grit/format/android_xml_unittest.py#newcode83 > ...
5 years, 4 months ago (2015-08-07 18:00:30 UTC) #11
newt (away)
still lgtm. Do you need me to land this?
5 years, 4 months ago (2015-08-07 19:17:38 UTC) #12
conleyo
On 2015/08/07 19:17:38, newt wrote: > still lgtm. Do you need me to land this? ...
5 years, 4 months ago (2015-08-07 22:54:18 UTC) #13
commit-bot: I haz the power
Commit queue rejected this change because it did not recognize the base URL. Please commit ...
5 years, 4 months ago (2015-08-07 23:10:03 UTC) #18
conleyo
On 2015/08/07 19:17:38, newt wrote: > still lgtm. Do you need me to land this? ...
5 years, 4 months ago (2015-08-07 23:18:49 UTC) #19
newt (away)
Committed patchset #6 (id:90001) manually as 192.
5 years, 4 months ago (2015-08-07 23:35:46 UTC) #20
newt (away)
Committed here: https://code.google.com/p/grit-i18n/source/detail?r=192
5 years, 4 months ago (2015-08-07 23:37:00 UTC) #21
newt (away)
On 2015/08/07 23:37:00, newt wrote: > Committed here: https://code.google.com/p/grit-i18n/source/detail?r=192 (Committing to grit works differently than ...
5 years, 4 months ago (2015-08-07 23:38:33 UTC) #22
conleyo
5 years, 4 months ago (2015-08-07 23:41:40 UTC) #23
Message was sent while issue was closed.
On 2015/08/07 23:38:33, newt wrote:
> On 2015/08/07 23:37:00, newt wrote:
> > Committed here: https://code.google.com/p/grit-i18n/source/detail?r=192
> 
> (Committing to grit works differently than committing to chromium. You have to
> commit the change via the command line, and you have to be whitelisted to make
> changes to the grit project.)

OK, well thanks for all your help!

Powered by Google App Engine
This is Rietveld 408576698