Always add Plural metadata to dummy translations.

When this was conditional, we'd have plural info in some files, not in
others. Then we'd merge them, and msgcat would add wacky markers to
indicate the difference, and the metadata wouldn't parse.
This commit is contained in:
Ned Batchelder
2014-01-24 16:17:46 -05:00
parent 4c1df70434
commit 2abd647375

View File

@@ -42,11 +42,9 @@ def main(file, locale):
for msg in pofile:
converter.convert_msg(msg)
# If any message has a plural, then the file needs plural information.
# Apply declaration for English pluralization rules so that ngettext will
# do something reasonable.
if any(m.msgid_plural for m in pofile):
pofile.metadata['Plural-Forms'] = 'nplurals=2; plural=(n != 1);'
pofile.metadata['Plural-Forms'] = 'nplurals=2; plural=(n != 1);'
new_file = new_filename(file, locale)
create_dir_if_necessary(new_file)