Skip to content

Latest commit

 

History

History
41 lines (23 loc) · 1.15 KB

localization.rst

File metadata and controls

41 lines (23 loc) · 1.15 KB

Localization and Internationalization

console

When building obfuscated scripts

For example:

pyarmor gen foo.py

Pyarmor first searches file messages.cfg in the local path, then searches in the global path

If messages.cfg exists, then read this file and save customized message to runtime key

If this file is not encoded by utf-8, set the right encoding XXX by this command:

$ pyarmor cfg messages=messages.cfg:XXX

runtime errors

When launching obfuscated scripts

For example:

python dist/foo.py

When something is wrong, the obfuscated script need report error which has an error code:

First decide default language by checking the following items in turn

  • PYARMOR_LANG
  • First part of LANG. For example, en_US or zh_CN

Then search error message table in the runtime key, if there is an error message both of language code and error code are matched, then return it.

Otherwise return default error message.