Skip to main content

AkariBot-I18N

小可使用的本地化组件。

运行时存储

load_locale_file() 会把 JSON 语言文件编译为版本化 SQLite 快照。多个进程使用同一组语言目录时会共享快照文件,并在其他进程发布新版本后自动刷新只读连接。

快照默认保存在当前用户的临时目录。可通过 AKARI_BOT_I18N_CACHE_DIR 指定本机缓存目录;所有 worker 必须使用相同配置。Locale.data 和模块级 locale_data 现在是只读映射。

加载和使用也可以完全分离。只有 loader 需要访问 JSON:

build_locale_snapshot(["zh_cn", "en_us"], locale_paths, "akari-bot")

其他 worker 只连接同一命名空间,不需要调用 load_locale_file() 或访问语言目录:

connect_locale_snapshot("akari-bot")

命名空间连接会自动跟随 loader 后续发布的新 generation。reader 调用 Locale.reload() 时也只会强制重连 manifest,不会读取 JSON。原有 load_locale_file() 保留为“构建并连接”的兼容入口。

每个 namespace 默认只保留当前和上一个 generation。更老的数据库会在 build 或 reader 完成版本切换时清理;Windows 上仍被其他进程打开的文件会在后续操作中重试删除。

Download files

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

Source Distribution

akari_bot_i18n-0.1.2.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

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

akari_bot_i18n-0.1.2-py3-none-any.whl (12.6 kB view details)

Uploaded Python 3

File details

Details for the file akari_bot_i18n-0.1.2.tar.gz.

File metadata

  • Download URL: akari_bot_i18n-0.1.2.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for akari_bot_i18n-0.1.2.tar.gz
Algorithm Hash digest
SHA256 8a868f1a957676a9f7fe5466492055750a3664b308a52e90a3b081c0a2713e26
MD5 33801e7859aa0807f30df873223ab938
BLAKE2b-256 654ffbf9432f902791ef7f5dc4a12f3a4ece41944221b4cbb9bd2d4aa639ae78

See more details on using hashes here.

Provenance

The following attestation bundles were made for akari_bot_i18n-0.1.2.tar.gz:

Publisher: python-publish.yml on Teahouse-Studios/akari-bot-i18n

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file akari_bot_i18n-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: akari_bot_i18n-0.1.2-py3-none-any.whl
  • Upload date:
  • Size: 12.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for akari_bot_i18n-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 36f45752c2f09ab67d5da52b391bc5d62f6768aaf1c164b846b62e7b7cbab207
MD5 536acdcd3032478385ee107653dcba8f
BLAKE2b-256 af6c829096138497eb38da56097cb6cdfcfd3089df887eaaa79ea5a4a712bc43

See more details on using hashes here.

Provenance

The following attestation bundles were made for akari_bot_i18n-0.1.2-py3-none-any.whl:

Publisher: python-publish.yml on Teahouse-Studios/akari-bot-i18n

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

0.1.3

2 files

This release

0.1.2 This release

2 files

0.1.1

2 files

0.1.0

2 files

0.0.4

2 files

0.0.3

2 files

0.0.2

2 files

0.0.1

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page