Skip to content
Projeler
Gruplar
Parçacıklar
Yardım
Yükleniyor...
Oturum aç / Kaydol
Gezinmeyi değiştir
C
cpython
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
cpython
Commits
5aafc174
Kaydet (Commit)
5aafc174
authored
Haz 04, 2010
tarafından
Martin v. Löwis
Dosyalara gözat
Seçenekler
Dosyalara Gözat
İndir
Eposta Yamaları
Sade Fark
Issue #5464: Implement plural forms in msgfmt.py.
üst
26eec587
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
31 additions
and
2 deletions
+31
-2
NEWS
Misc/NEWS
+6
-0
msgfmt.py
Tools/i18n/msgfmt.py
+25
-2
No files found.
Misc/NEWS
Dosyayı görüntüle @
5aafc174
...
...
@@ -123,6 +123,12 @@ Build
- Issues #1759169, #8864: Drop _XOPEN_SOURCE on Solaris, define it for
multiprocessing only.
Tools/Demos
-----------
- Issue #5464: Implement plural forms in msgfmt.py.
What's New in Python 2.7 beta 2?
================================
...
...
Tools/i18n/msgfmt.py
Dosyayı görüntüle @
5aafc174
...
...
@@ -133,16 +133,39 @@ def make(filename, outfile):
if
l
[
0
]
==
'#'
:
continue
# Now we are in a msgid section, output previous section
if
l
.
startswith
(
'msgid'
):
if
l
.
startswith
(
'msgid'
)
and
not
l
.
startswith
(
'msgid_plural'
)
:
if
section
==
STR
:
add
(
msgid
,
msgstr
,
fuzzy
)
section
=
ID
l
=
l
[
5
:]
msgid
=
msgstr
=
''
is_plural
=
False
# This is a message with plural forms
elif
l
.
startswith
(
'msgid_plural'
):
if
section
!=
ID
:
print
>>
sys
.
stderr
,
'msgid_plural not preceeded by msgid on
%
s:
%
d'
%
\
(
infile
,
lno
)
sys
.
exit
(
1
)
l
=
l
[
12
:]
msgid
+=
'
\0
'
# separator of singular and plural
is_plural
=
True
# Now we are in a msgstr section
elif
l
.
startswith
(
'msgstr'
):
section
=
STR
l
=
l
[
6
:]
if
l
.
startswith
(
'msgstr['
):
if
not
is_plural
:
print
>>
sys
.
stderr
,
'plural without msgid_plural on
%
s:
%
d'
%
\
(
infile
,
lno
)
sys
.
exit
(
1
)
l
=
l
.
split
(
']'
,
1
)[
1
]
if
msgstr
:
msgstr
+=
'
\0
'
# Separator of the various plural forms
else
:
if
is_plural
:
print
>>
sys
.
stderr
,
'indexed msgstr required for plural on
%
s:
%
d'
%
\
(
infile
,
lno
)
sys
.
exit
(
1
)
l
=
l
[
6
:]
# Skip empty lines
l
=
l
.
strip
()
if
not
l
:
...
...
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