diff --git a/django/core/management/commands/makemessages.py b/django/core/management/commands/makemessages.py
index 060def5..fe08379 100644
a
|
b
|
class TranslatableFile(object):
|
74 | 74 | '--keyword=ngettext_lazy:1,2', |
75 | 75 | '--keyword=pgettext:1c,2', |
76 | 76 | '--keyword=npgettext:1c,2,3', |
77 | | '--from-code=UTF-8', |
78 | | '--add-comments=Translators', |
79 | 77 | '--output=-' |
80 | | ] |
81 | | if command.wrap: |
82 | | args.append(command.wrap) |
83 | | if command.location: |
84 | | args.append(command.location) |
| 78 | ] + command.xgettext_options |
85 | 79 | args.append(work_file) |
86 | 80 | elif domain == 'django' and (file_ext == '.py' or file_ext in command.extensions): |
87 | 81 | thefile = self.file |
… |
… |
class TranslatableFile(object):
|
109 | 103 | '--keyword=npgettext:1c,2,3', |
110 | 104 | '--keyword=pgettext_lazy:1c,2', |
111 | 105 | '--keyword=npgettext_lazy:1c,2,3', |
112 | | '--from-code=UTF-8', |
113 | | '--add-comments=Translators', |
114 | 106 | '--output=-' |
115 | | ] |
116 | | if command.wrap: |
117 | | args.append(command.wrap) |
118 | | if command.location: |
119 | | args.append(command.location) |
| 107 | ] + command.xgettext_options |
120 | 108 | args.append(work_file) |
121 | 109 | else: |
122 | 110 | return |
… |
… |
class Command(NoArgsCommand):
|
192 | 180 | requires_model_validation = False |
193 | 181 | leave_locale_alone = True |
194 | 182 | |
| 183 | msgmerge_options = ['-q', '--previous'] |
| 184 | msguniq_options = ['--to-code=utf-8'] |
| 185 | msgattrib_options = ['--no-obsolete'] |
| 186 | xgettext_options = ['--from-code=UTF-8', '--add-comments=Translators'] |
| 187 | |
195 | 188 | def handle_noargs(self, *args, **options): |
196 | 189 | locale = options.get('locale') |
197 | 190 | self.domain = options.get('domain') |
… |
… |
class Command(NoArgsCommand):
|
203 | 196 | if options.get('use_default_ignore_patterns'): |
204 | 197 | ignore_patterns += ['CVS', '.*', '*~', '*.pyc'] |
205 | 198 | self.ignore_patterns = list(set(ignore_patterns)) |
206 | | self.wrap = '--no-wrap' if options.get('no_wrap') else '' |
207 | | self.location = '--no-location' if options.get('no_location') else '' |
| 199 | if options.get('no_wrap'): |
| 200 | self.msgmerge_options.append('--no-wrap') |
| 201 | self.msguniq_options.append('--no-wrap') |
| 202 | self.msgattrib_options.append('--no-wrap') |
| 203 | self.xgettext_options.append('--no-wrap') |
| 204 | if options.get('no_location'): |
| 205 | self.msgmerge_options.append('--no-location') |
| 206 | self.msguniq_options.append('--no-location') |
| 207 | self.msgattrib_options.append('--no-location') |
| 208 | self.xgettext_options.append('--no-location') |
208 | 209 | self.no_obsolete = options.get('no_obsolete') |
209 | 210 | self.keep_pot = options.get('keep_pot') |
210 | 211 | |
… |
… |
class Command(NoArgsCommand):
|
325 | 326 | |
326 | 327 | Uses mguniq, msgmerge, and msgattrib GNU gettext utilities. |
327 | 328 | """ |
328 | | args = ['msguniq', '--to-code=utf-8'] |
329 | | if self.wrap: |
330 | | args.append(self.wrap) |
331 | | if self.location: |
332 | | args.append(self.location) |
333 | | args.append(potfile) |
| 329 | args = ['msguniq'] + self.msguniq_options + [potfile] |
334 | 330 | msgs, errors, status = popen_wrapper(args) |
335 | 331 | if errors: |
336 | 332 | if status != STATUS_OK: |
… |
… |
class Command(NoArgsCommand):
|
347 | 343 | if os.path.exists(pofile): |
348 | 344 | with open(potfile, 'w') as fp: |
349 | 345 | fp.write(msgs) |
350 | | args = ['msgmerge', '-q'] |
351 | | if self.wrap: |
352 | | args.append(self.wrap) |
353 | | if self.location: |
354 | | args.append(self.location) |
355 | | args.extend([pofile, potfile]) |
| 346 | args = ['msgmerge'] + self.msgmerge_options + [pofile, potfile] |
356 | 347 | msgs, errors, status = popen_wrapper(args) |
357 | 348 | if errors: |
358 | 349 | if status != STATUS_OK: |
… |
… |
class Command(NoArgsCommand):
|
368 | 359 | fp.write(msgs) |
369 | 360 | |
370 | 361 | if self.no_obsolete: |
371 | | args = ['msgattrib', '-o', pofile, '--no-obsolete'] |
372 | | if self.wrap: |
373 | | args.append(self.wrap) |
374 | | if self.location: |
375 | | args.append(self.location) |
376 | | args.append(pofile) |
| 362 | args = ['msgattrib'] + self.msgattrib_options + ['-o', pofile, pofile] |
377 | 363 | msgs, errors, status = popen_wrapper(args) |
378 | 364 | if errors: |
379 | 365 | if status != STATUS_OK: |