From cdf26640308371f5e8776f276e928c757e4d5704 Mon Sep 17 00:00:00 2001 From: Umair Khan Date: Fri, 8 Jul 2016 15:06:08 +0500 Subject: [PATCH] `makemessages` command should not remove plurals. --- zerver/management/commands/makemessages.py | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/zerver/management/commands/makemessages.py b/zerver/management/commands/makemessages.py index ca4a842e3c..7720b6cd49 100644 --- a/zerver/management/commands/makemessages.py +++ b/zerver/management/commands/makemessages.py @@ -209,6 +209,13 @@ class Command(makemessages.Command): k = k.replace('\\n', '\n') new_strings[k] = old_strings.get(k, k) + plurals = {k: v for k, v in old_strings.items() if k.endswith('_plural')} + for plural_key, value in plurals.items(): + components = plural_key.split('_') + singular_key = '_'.join(components[:-1]) + if singular_key in new_strings: + new_strings[plural_key] = value + return new_strings def write_translation_strings(self, translation_strings):