Skip to main content

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

Project description

Python Module: a2y_i18n

这个模块提供一个类似gettext的功能:文本显示前的翻译。 与传统gettext分散存储不同语言文本的方式不同,i18n在一个CSV文档中存储所有的语言文本。 其中的每一列(第一列除外)对应一种语言的文本。用一个整数序号表示要启用的那种语言。其中序号 0 表示默认的语言。

本模块除了提供用于翻译的gettext函数,也提供了用于从源码中提取待翻译文本的函数,parseparse_directory

parse类函数目前只支持使用_作为函数关键字,只支持使用单个双引号"括住的字符串。 即是说,待翻译的文本需要满足这样的格式:_("Text to translate")

另外,像wxFormbuilder这样的工具,生成的代码默认使用标准gettext。 为了方便替换代码中导入的模块名称,提供了函数replace_gettextreplace_gettext函数目前仅适用于Python代码。

ChangeLog

  • 2025-10-21 发布一个初步验证可用的版本。版本 0.9.4。

  • 2025-10-20 初始项目,开始编码,未到可用状态。版本 0.8.0。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

a2y_i18n-0.9.4-cp312-cp312-win_amd64.whl (58.0 kB view details)

Uploaded CPython 3.12Windows x86-64

File details

Details for the file a2y_i18n-0.9.4-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: a2y_i18n-0.9.4-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 58.0 kB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.8

File hashes

Hashes for a2y_i18n-0.9.4-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 8b3873301bf2c079a957e4b5a9c3ca8d67806ff38862cf262ca00aecacf69e78
MD5 f7ac050acbb81950b35e77073ed7ef2e
BLAKE2b-256 0c728f7f7d7d1157efff4e6ada9d3198d1947cba8707e79dfd7cd5b072ba5ecb

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page