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() 保留为“构建并连接”的兼容入口。

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.1.tar.gz (11.5 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.1-py3-none-any.whl (12.4 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: akari_bot_i18n-0.1.1.tar.gz
  • Upload date:
  • Size: 11.5 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.1.tar.gz
Algorithm Hash digest
SHA256 c290ad9766c0b67eea5fc8a12c57f20106f26202d04bc2788e13e575a791994d
MD5 c7c18bcb2fdf09c672e28357b96517b6
BLAKE2b-256 86e65dc2448a88a76d1a39d65abac407dd050cfbf964a7178a0525277e678f20

See more details on using hashes here.

Provenance

The following attestation bundles were made for akari_bot_i18n-0.1.1.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.1-py3-none-any.whl.

File metadata

  • Download URL: akari_bot_i18n-0.1.1-py3-none-any.whl
  • Upload date:
  • Size: 12.4 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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 5c29b81fec029eb597d7487db59ffcf4b758c6ff50de3cb4a0cb1b17ecfc5876
MD5 c503e7c1476c5ae7d8c3e174a47feb03
BLAKE2b-256 2df9a946005a581da6d2c6e3e4ee88b89f49c9c839affa1199534eb872906fdf

See more details on using hashes here.

Provenance

The following attestation bundles were made for akari_bot_i18n-0.1.1-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

0.1.2

2 files

This release

0.1.1 This release

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