Catalog PyPI
PACKAGE EXPLORERView in registry

a2y-i18n

PyPI

这个模块提供一个类似`gettext`的功能:文本显示前的翻译。

Versions collected1
Direct dependencies0From release 1.0.0
Last observed20 Oct, 16:36 UTC

README

Version 1.0.0 documentation

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。

Downloads & popularity

Awaiting observations

No metric observations yet

Download counts and popularity will appear here as the collector receives them.

Versions 1

Collected releases
VersionPublishedDirect dependenciesOpen version
1.0.026 Oct 20250

Package advisories

0
No matching advisories collected

This describes our collected data; it is not a security assessment.

Metadata history

Meaningful changes
Current collected state Current

Observed since 20 Oct, 16:36 UTC

No superseded metadata states collected. Unchanged observations do not create new revisions.

Record identity

package:faf52bec52dda962b916163c0b0b2fd8f489f4176ada76d51f8caa1d2f4df4db