Python Module: a2y_i18n
这个模块提供一个类似gettext的功能:文本显示前的翻译。
与传统gettext分散存储不同语言文本的方式不同,i18n在一个CSV文档中存储所有的语言文本。
其中的每一列(第一列除外)对应一种语言的文本。用一个整数序号表示要启用的那种语言。其中序号 0 表示默认的语言。
本模块除了提供用于翻译的gettext函数,也提供了用于从源码中提取待翻译文本的函数,parse和parse_directory。
parse类函数目前只支持使用_作为函数关键字,只支持使用单个双引号"括住的字符串。
即是说,待翻译的文本需要满足这样的格式:_("Text to translate")。
另外,像wxFormbuilder这样的工具,生成的代码默认使用标准gettext。
为了方便替换代码中导入的模块名称,提供了函数replace_gettext。
replace_gettext函数目前仅适用于Python代码。
ChangeLog
-
2025-10-25 删除函数
i18n,把原来的隐藏变量_i18n显化为i18n。版本升级为 1.0.0。 -
2025-10-21 发布一个初步验证可用的版本。版本 0.9.4。
-
2025-10-20 初始项目,开始编码,未到可用状态。版本 0.8.0。
Metadata
Release files for a2y-i18n 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| a2y_i18n-1.0.0-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details for a2y_i18n-1.0.0-cp312-cp312-win_amd64.whl |
Release files / a2y_i18n-1.0.0-cp312-cp312-win_amd64.whl
| Download URL | a2y_i18n-1.0.0-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 57.9 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
9639a5acbe56ae7624c203b6bf5e883566b696c53b1581044209c4effbd9b18d
|
|
BLAKE2b-256 checksum How to use checksums |
a41cf75c44d5287bc7fa283f6fa621579746ef0ac98229ea107738547f4a1fda
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.12.8
|
Security for a2y-i18n 1.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.