Skip to main content

i18n_next/
lib.rs

1#![doc = include_str!("../README.md")]
2#![forbid(unsafe_code)]
3
4#[macro_use]
5mod macros;
6mod args;
7mod catalog;
8mod change;
9mod check;
10mod error;
11mod evict;
12#[cfg(feature = "format")]
13mod format;
14mod hash;
15mod i18n;
16mod intern;
17mod json;
18mod key;
19mod lazy;
20mod linked;
21mod loader;
22#[cfg(feature = "payload")]
23pub mod payload;
24mod plural;
25mod remote;
26mod scope;
27mod source;
28#[cfg(all(feature = "tauri-guest", target_arch = "wasm32", target_os = "unknown"))]
29pub mod tauri_guest;
30mod text;
31mod trace;
32#[cfg(feature = "tz")]
33#[allow(
34    dead_code,
35    reason = "backends of other platforms (Android, browser) and items only tests read"
36)]
37mod tz;
38#[cfg(all(
39    feature = "watch",
40    not(all(target_arch = "wasm32", target_os = "unknown"))
41))]
42mod watch;
43
44pub use args::{Arg, Args, Count};
45pub use change::{Change, Subscription};
46pub use check::{CheckItem, CheckReport, LinkError};
47pub use error::Error;
48#[cfg(feature = "format")]
49pub use format::api::{td, td_as, tdr, tn, tn_as};
50#[cfg(feature = "format")]
51pub use format::{DateArg, Number, RelativeOptions, Timestamp};
52pub use i18n::{Builder, I18n, LocaleInfo, View};
53#[doc(hidden)]
54pub use macros::__ident;
55pub use scope::{Scope, Scoped, locale, negotiate, page, scope, set_locale, t};
56#[cfg(feature = "global")]
57pub use scope::{global, install};
58pub use text::{Key, Part, PluralCtx, Text};
59#[cfg(all(
60    feature = "watch",
61    not(all(target_arch = "wasm32", target_os = "unknown"))
62))]
63pub use watch::WatchGuard;
64
65/// The crate version, as published (`CARGO_PKG_VERSION`).
66///
67/// ```
68/// assert_eq!(i18n_next::version(), env!("CARGO_PKG_VERSION"));
69/// ```
70#[must_use]
71pub fn version() -> &'static str {
72    env!("CARGO_PKG_VERSION")
73}