1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
// Copyright (c) 2026 Kirky.X🌠
// SPDX-License-Identifier: MIT
//! Internationalization for limiteron: Fluent message catalog + locale
//! detection + ICU4X-backed formatting.
//!
//! # Layout (unified per change `unify-rust-i18n`)
//!
//! - [`catalog`]: `locales/{en,zh}/messages.ftl` embedded via `include_str!`
//! into concurrent `FluentBundle`s; `t()`/`translate()` lookup chain
//! terminates in English.
//! - [`locale`]: detection chain `LIMITERON_LANG` → `LC_ALL` → `LC_MESSAGES`
//! → `LANG` → `sys-locale` → `en`; only `en`/`zh` are supported.
//! - [`error_ext`]: error dual-track — canonical English `Display` plus
//! `to_localized_string()` via the catalog (dbnexus pattern).
//! - `i18n_impl` (feature `i18n`): ICU4X DecimalFormatter/PluralRules/
//! Collator/DateTimeFormatter behind `LimiterI18nFormatter`.
//! (该类型受 `i18n` feature 门控,零特性文档构建下无法解析,故不用 intra-doc 链接)
//!
//! The catalog/locale/error-ext base is always compiled (the error dual
//! track and the CLI/admin exits consume it without feature gating); only
//! the ICU formatter requires the `i18n` feature:
//! ```toml
//! [dependencies]
//! limiteron = { version = "...", features = ["i18n"] }
//! ```
//!
//! # Example
//!
//! ```rust,ignore
//! use limiteron::i18n::{t, I18nExt};
//!
//! limiteron::i18n::init();
//! let msg = t("rate-limit-exceeded", &[]);
//! let localized = some_error.to_localized_string();
//! ```
use Error;
pub use ;
pub use ;
pub use ;
/// Errors returned by locale handling and (feature `i18n`) formatter
/// operations.
/// ICU4X-backed formatter module (feature-gated).
pub use LimiterI18nFormatter;