Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
D
django
Proje
Proje
Ayrıntılar
Etkinlik
Cycle Analytics
Depo (repository)
Depo (repository)
Dosyalar
Kayıtlar (commit)
Dallar (branch)
Etiketler
Katkıda bulunanlar
Grafik
Karşılaştır
Grafikler
Konular (issue)
0
Konular (issue)
0
Liste
Pano
Etiketler
Kilometre Taşları
Birleştirme (merge) Talepleri
0
Birleştirme (merge) Talepleri
0
CI / CD
CI / CD
İş akışları (pipeline)
İşler
Zamanlamalar
Grafikler
Paketler
Paketler
Wiki
Wiki
Parçacıklar
Parçacıklar
Üyeler
Üyeler
Collapse sidebar
Close sidebar
Etkinlik
Grafik
Grafikler
Yeni bir konu (issue) oluştur
İşler
Kayıtlar (commit)
Konu (issue) Panoları
Kenar çubuğunu aç
Batuhan Osman TASKAYA
django
Commits
002a8ffe
Kaydet (Commit)
002a8ffe
authored
Ara 29, 2014
tarafından
Ramiro Morales
Kaydeden (comit)
Ramiro Morales
Ara 30, 2014
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Fixed breakage by
6fb9dee4
under Python2+Windows.
Refs #23271
üst
2d638893
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
5 additions
and
10 deletions
+5
-10
makemessages.py
django/core/management/commands/makemessages.py
+5
-10
No files found.
django/core/management/commands/makemessages.py
Dosyayı görüntüle @
002a8ffe
...
...
@@ -33,15 +33,16 @@ def check_programs(*programs):
def
gettext_popen_wrapper
(
args
,
os_err_exc_type
=
CommandError
):
"""
Makes sure text obtained from stdout of gettext utilities contains valid
Unicode on Windows.
Makes sure text obtained from stdout of gettext utilities is Unicode.
"""
stdout
,
stderr
,
status_code
=
popen_wrapper
(
args
,
os_err_exc_type
=
os_err_exc_type
)
if
os
.
name
==
'nt'
:
if
os
.
name
==
'nt'
and
six
.
PY3
:
# This looks weird because it's undoing what subprocess.Popen(universal_newlines=True).communicate()
# does when capturing PO files contents from stdout of gettext command line programs. See ticket #23271
# for details.
# for details.
No need to do anything on Python 2 because it's already a UTF-8-encoded byte-string there
stdout
=
stdout
.
encode
(
locale
.
getpreferredencoding
(
False
))
.
decode
(
'utf-8'
)
if
six
.
PY2
:
stdout
=
stdout
.
decode
(
'utf-8'
)
return
stdout
,
stderr
,
status_code
...
...
@@ -142,8 +143,6 @@ class TranslatableFile(object):
# Print warnings
command
.
stdout
.
write
(
errors
)
if
msgs
:
if
six
.
PY2
:
msgs
=
msgs
.
decode
(
'utf-8'
)
# Write/append messages to pot file
potfile
=
os
.
path
.
join
(
self
.
locale_dir
,
'
%
s.pot'
%
str
(
domain
))
if
is_templatized
:
...
...
@@ -350,8 +349,6 @@ class Command(BaseCommand):
continue
args
=
[
'msguniq'
]
+
self
.
msguniq_options
+
[
potfile
]
msgs
,
errors
,
status
=
gettext_popen_wrapper
(
args
)
if
six
.
PY2
:
msgs
=
msgs
.
decode
(
'utf-8'
)
if
errors
:
if
status
!=
STATUS_OK
:
raise
CommandError
(
...
...
@@ -442,8 +439,6 @@ class Command(BaseCommand):
if
os
.
path
.
exists
(
pofile
):
args
=
[
'msgmerge'
]
+
self
.
msgmerge_options
+
[
pofile
,
potfile
]
msgs
,
errors
,
status
=
gettext_popen_wrapper
(
args
)
if
six
.
PY2
:
msgs
=
msgs
.
decode
(
'utf-8'
)
if
errors
:
if
status
!=
STATUS_OK
:
raise
CommandError
(
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment