python汉化之后好用吗_关于Python写的程序汉化心得和所走过的各种坑儿
本帖最后由 冥界3大法王 于 2020-11-27 12:33 編輯
本文以wing ide for python 8.0來說
image.png (208.33 KB, 下載次數(shù): 0)
2020-11-27 11:10 上傳
對于這種語言開發(fā)的程序,本人認為這就是個大雜燴。
image.png (21.15 KB, 下載次數(shù): 0)
2020-11-27 11:12 上傳
image.png (67.99 KB, 下載次數(shù): 0)
2020-11-27 11:12 上傳
image.png (53.11 KB, 下載次數(shù): 0)
2020-11-27 11:14 上傳
這些MO、PO文件是需要漢化的,但是盡管你漢化過了,但還是有些不顯示中文
接下來要說的是編碼問題: # -*- coding: UTF-8 -*-這個是一定最好是加的,不然漢化過的程序會導致主程序運行不起來!
[Python] 純文本查看 復制代碼_kLanguages = [
(
_('System Default'), None),
('English', 'en'),
('Chinese(ZhongWen', 'de'),
(u'Fran\xe7ais (French)', 'fr'),
(u'\u0420\u0443\u0441\u0441\u043a\u0438\u0439 (Russian)', 'ru')]
kDisplayLanguage = CTextIOValueDef('main', 'display-language', _('The language to use for the user interface. Either the default for this system, or set to a specific supported language.'), None, CValue(*[ l[1] for l in _kLanguages ]), CPopupChoiceGui(_kLanguages))
kDocumentationLanguage = CTextIOValueDef('main', 'documentation-language', _('The language to use for the documentation, when available (not all documentation is translated into all supported languages).'), 'en', CValue(*[ l[1] for l in _kLanguages ]), CPopupChoiceGui(_kLanguages))
kAutoReopenLastProject = CTextIOValueDef('main', 'auto-reopen-last-project', _('Controls whether most recent project is reopened at startup, in the absence of any other project on the command line.'), 1, CBoolean(), CBooleanGui())
from guiutils import scintilla
上面的這些行來說
u'是一定得加上的,不然給你打臉,其他文件中,
出現(xiàn)這類的行打頭也得加,不然漢化就完蛋
System Default能不能,把后面的空(NONE)改成別的呢? 建議別來試,不行的。
可以修改English行,en為語言文件夾(可以把漢化的文件替換進去),這樣打開就是中文的了。
image.png (71.97 KB, 下載次數(shù): 0)
2020-11-27 11:20 上傳
經(jīng)過“改!改!改“,一大通折騰,你們終于變成中文的了。費勁,好費勁吶。
PYO要轉換成PY文件,漢化完之后,再轉換回來
在線utf-8轉換:在線反編譯pyo:(也可以使用上面提到的命令行工具;兩種方法都是可以的)
注意輸出的版本號信息(反編譯在線 或 使用相關的命令行工具等),這個很重要,不然就會有以上問題
C:\Python27\python.exe -O -m py_compile C:\U\prefs2.py
搜索字符串時要注意? ?_字母??,相當于首字母大寫,注意利用ALT鍵,不然會搜索不到的。
總結
以上是生活随笔為你收集整理的python汉化之后好用吗_关于Python写的程序汉化心得和所走过的各种坑儿的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: 《Java技术》第八次作业
- 下一篇: python汉化idle_idle py