[Python-Dev] Translating sample programs in documentation

Xuan Wu fromwheretowhere.service at gmail.com
Sun Apr 15 12:41:16 EDT 2018

Excuse me if this was discussed before, but in French and Japanese 
translations, all the sample programs seem to have identifiers in 
English still. According to "PEP 545 -- Python Documentation 
Translations", as I understand .po files are used for translations. May 
I ask if there's technical restrictions causing translations being only 
applied to the text parts?

For example, here's the first sample program in 4.2:

>>># Measure some strings:
... words  =  ['cat',  'window',  'defenestrate']
>>>for  w  in  words:
...      print(w,  len(w))
cat 3
window 6
defenestrate 12

Here's a possible translation in Chinese:

>>> # 丈量一些字符串
... 词表 = ['猫', '窗户', '丢出窗户']
>>> for 词 in 词表:
...     print(词, len(词))
猫 1
窗户 2
丢出窗户 4

As you may notice the strings differ in size if they are translated 
directly. Obviously that does add extra burden to review the new sample 
programs to assure effectiveness and readability.
Any suggestion or comments are welcome.

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/python-dev/attachments/20180415/bb47aa01/attachment.html>

More information about the Python-Dev mailing list