1
0
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:
Ramiro Morales
2013-10-01 20:23:36 -03:00
parent 1d0fc61b1c
commit 4b715fc05a
2 changed files with 27 additions and 5 deletions

View File

@@ -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: