1
0
mirror of https://github.com/django/django.git synced 2025-10-31 09:41:08 +00:00

[1.6.x] 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.

4b715fc05a from master.
This commit is contained in:
Ramiro Morales
2013-10-01 20:23:36 -03:00
parent 9972a101e6
commit d16753eecd
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: