3 ms·
I'm not opposed to unicode in source code, but we do put all string literals in external files, by using gettext. Your example would be: print(_("Hello Wo
by icebraining 9y ago
I'm not opposed to unicode in source code, but we do put all string literals in external files, by using gettext.
Your example would be:
print(_("Hello World!"))
And then a zh.po file with:
#: file.py:1
msgid "Hello World!"
msgstr "你好,世界!"
- saurik 9y agoThis assumes then programmer speaks English and Chinese is a "translation".
- masklinn 9y agoOr even just the second part. One could imagine software with chinese as the reference and english as the translation. I guess that's one good thing about Java's resource bundles, though they don't help source readability.
- icebraining 9y agoIt's just a placeholder, you can use anything. The company I work for, and its clients, are not in English-speaking countries either.