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-25 删除函数i18n,把原来的隐藏变量_i18n显化为i18n。版本升级为 1.0.0。

  • 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-1.0.0-cp312-cp312-win_amd64.whl (57.9 kB view details)

Uploaded CPython 3.12Windows x86-64

File details

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

File metadata

  • Download URL: a2y_i18n-1.0.0-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 57.9 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-1.0.0-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 9639a5acbe56ae7624c203b6bf5e883566b696c53b1581044209c4effbd9b18d
MD5 1e04de8beab75127d77619cf10bbf9b7
BLAKE2b-256 a41cf75c44d5287bc7fa283f6fa621579746ef0ac98229ea107738547f4a1fda

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