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.3.tar.gz (29.8 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.3-py3-none-any.whl (30.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: akari_bot_i18n-0.1.3.tar.gz
  • Upload date:
  • Size: 29.8 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.3.tar.gz
Algorithm Hash digest
SHA256 aeeda94c53f39982451123d032231220d8d6f227208dceea5610efd77ee324d8
MD5 7b7de179f53faae2d7494459617599a1
BLAKE2b-256 77fb51005ef724268c9590931a0227d23da115f1e2664faf8fdbf94e53be5cd1

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: akari_bot_i18n-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 30.3 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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 c99719baa103e04db5324e849866dc10893ad672da3eedcf98a312f6983d74dd
MD5 e09643ccdb98be5562c13333457c8be9
BLAKE2b-256 a17c612cf71a7686d391e93fca9e03586f242dbace878caa3666bad38504eec7

See more details on using hashes here.

Provenance

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

This release

0.1.3 This release

2 files

0.1.2

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