mirror of
https://github.com/django/django.git
synced 2025-10-29 08:36:09 +00:00
Fixed #21209 -- .po file path comments on Windows.
Literals from source files with Django template language syntax don't have a '.py' suffix anymore. Also, the '.\' prefix is preserved to respect GNU gettext behavior on that platform. Refs #16903.
This commit is contained in:
@@ -135,8 +135,14 @@ class TranslatableFile(object):
|
||||
command.stdout.write(errors)
|
||||
if msgs:
|
||||
if is_templatized:
|
||||
old = '#: ' + work_file[2:]
|
||||
new = '#: ' + orig_file[2:]
|
||||
# Remove '.py' suffix
|
||||
if os.name =='nt':
|
||||
# Preserve '.\' prefix on Windows to respect gettext behavior
|
||||
old = '#: ' + work_file
|
||||
new = '#: ' + orig_file
|
||||
else:
|
||||
old = '#: ' + work_file[2:]
|
||||
new = '#: ' + orig_file[2:]
|
||||
msgs = msgs.replace(old, new)
|
||||
write_pot_file(potfile, msgs)
|
||||
if is_templatized:
|
||||
|
||||
Reference in New Issue
Block a user