diff options
| author | Ramiro Morales <cramm0@gmail.com> | 2013-06-22 18:39:14 -0300 |
|---|---|---|
| committer | Ramiro Morales <cramm0@gmail.com> | 2013-06-22 18:45:41 -0300 |
| commit | 1559f84d8b5c2d4d088a27fc0edf02f01a1d65f0 (patch) | |
| tree | a296ef216910bd294ad74c25d8e9e93e8f9a8402 /django | |
| parent | ecf63d5d89c5b511a023a4dcc32a142e1eed97e6 (diff) | |
Fixed #20311 -- Make sure makemessages doesn't create duplicate Plural-Forms .po file headers.
Thanks naktinis for the report and initial patch.
Diffstat (limited to 'django')
| -rw-r--r-- | django/core/management/commands/makemessages.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py index 060def5d5a..695cad419b 100644 --- a/django/core/management/commands/makemessages.py +++ b/django/core/management/commands/makemessages.py @@ -402,11 +402,11 @@ class Command(NoArgsCommand): if self.verbosity > 1: self.stdout.write("copying plural forms: %s\n" % m.group('value')) lines = [] - seen = False + found = False for line in msgs.split('\n'): - if not line and not seen: + if not found and (not line or plural_forms_re.search(line)): line = '%s\n' % m.group('value') - seen = True + found = True lines.append(line) msgs = '\n'.join(lines) break |
