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

Review URL: https://codereview.chromium.org/1258833004 .

Patch from Conley Owens <conleyo@google.com>.

git-svn-id: http://grit-i18n.googlecode.com/svn/trunk@192 7262f16d-afe8-6277-6482-052fa10e57b1
2 files changed