i18n_ui 0.2.126

Terminal UI for translation progress with interactive concurrent panels and line-by-line fallback
Documentation
// DON'T EDIT, GEN BY i18ngen

pub use ::i18n_nt::{Cfg, I18N};

#[doc(hidden)]
pub use self::_i18n_::_ctor_::*;
pub use self::_i18n_::Lang;
use self::_i18n_::{self as ø, AsVal, Cow};

/// Preferred entry: import `T` directly (`use i18n::T;` -> `T.key()`), following global [`I18N`] (`I18N << lang` switches all crates); for per-task language isolation, bind any struct via `let t = I18n << lang;` (or `SubStruct << lang`).
pub static T: I18n = I18n {
  ui: Ui { ø: I18N }
};

#[derive(Clone, Copy, Debug)]
pub struct I18n {
  pub ui: Ui,
}

#[derive(Clone, Copy, Debug)]
pub struct Ui {
  ø: Cfg,
}

// ../i18n/zh/ui.nt
impl Ui {
  /// Cancelled
  pub fn cancel(&self) -> &'static str {
    ø::ui::cancel(self.ø)
  }
  /// Estimating
  pub fn estimating(&self) -> &'static str {
    ø::ui::estimating(self.ø)
  }
  /// Remaining $\[eta\]
  pub fn eta(&self, eta: impl AsVal) -> Cow<'static, str> {
    ø::ui::eta(self.ø, eta)
  }
  /// # Translation Complete Translated $\[ok\] Cache hits $\[hit\] Failed $\[fail\] Tokens $\[tok\] Elapsed $\[dur\]
  pub fn summary(
    &self,
    ok: impl AsVal,
    hit: impl AsVal,
    fail: impl AsVal,
    tok: impl AsVal,
    dur: impl AsVal,
  ) -> Cow<'static, str> {
    ø::ui::summary(self.ø, ok, hit, fail, tok, dur)
  }
  /// Started $\[tag\]
  pub fn start(&self, tag: impl AsVal) -> Cow<'static, str> {
    ø::ui::start(self.ø, tag)
  }
  /// Retry $\[tag\] │ Round $\[nth\]/$\[total\] $\[base\] Failed: $\[err\]
  pub fn retry(
    &self,
    tag: impl AsVal,
    nth: impl AsVal,
    total: impl AsVal,
    base: impl AsVal,
    err: impl AsVal,
  ) -> Cow<'static, str> {
    ø::ui::retry(self.ø, tag, nth, total, base, err)
  }
  /// Done $\[dur\]  $\[src\] → $\[dst\]  $\[count\]  $\[percent\]  $\[eta\]
  pub fn done(
    &self,
    dur: impl AsVal,
    src: impl AsVal,
    dst: impl AsVal,
    count: impl AsVal,
    percent: impl AsVal,
    eta: impl AsVal,
  ) -> Cow<'static, str> {
    ø::ui::done(self.ø, dur, src, dst, count, percent, eta)
  }
  /// Failed $\[tag\]  $\[msg\]
  pub fn fail(&self, tag: impl AsVal, msg: impl AsVal) -> Cow<'static, str> {
    ø::ui::fail(self.ø, tag, msg)
  }
  /// Tip $\[text\]
  pub fn log(&self, text: impl AsVal) -> Cow<'static, str> {
    ø::ui::log(self.ø, text)
  }
  /// Tip
  pub fn note(&self) -> &'static str {
    ø::ui::note(self.ø)
  }
  /// Retries $\[n\]
  pub fn retry_n(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::retry_n(self.ø, n)
  }
  /// Cached $\[n\]
  pub fn count_cache(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::count_cache(self.ø, n)
  }
  /// Retries $\[n\]
  pub fn count_retry(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::count_retry(self.ø, n)
  }
  /// Failed $\[n\]
  pub fn count_fail(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::count_fail(self.ø, n)
  }
  /// Scanning cache…
  pub fn scan(&self) -> &'static str {
    ø::ui::scan(self.ø)
  }
  /// Ctrl+C to exit
  pub fn quit_hint(&self) -> &'static str {
    ø::ui::quit_hint(self.ø)
  }
  /// Round $\[n\]/$\[total\]
  pub fn retry_badge(&self, n: impl AsVal, total: impl AsVal) -> Cow<'static, str> {
    ø::ui::retry_badge(self.ø, n, total)
  }
  /// retry in
  pub fn retry_after(&self) -> &'static str {
    ø::ui::retry_after(self.ø)
  }
  /// Reconnecting…
  pub fn reconnect(&self) -> &'static str {
    ø::ui::reconnect(self.ø)
  }
  /// Progress panel unavailable: $\[err\]
  pub fn no_ui(&self, err: impl AsVal) -> Cow<'static, str> {
    ø::ui::no_ui(self.ø, err)
  }
  /// Concurrency
  pub fn conc_word(&self) -> &'static str {
    ø::ui::conc_word(self.ø)
  }
  /// Tokens
  pub fn tok_word(&self) -> &'static str {
    ø::ui::tok_word(self.ø)
  }
  /// Idle
  pub fn phase_idle(&self) -> &'static str {
    ø::ui::phase_idle(self.ø)
  }
  /// Fast start ↑↑
  pub fn phase_fast(&self) -> &'static str {
    ø::ui::phase_fast(self.ø)
  }
  /// Speed probe ↑
  pub fn phase_probe(&self) -> &'static str {
    ø::ui::phase_probe(self.ø)
  }
  /// Cruise
  pub fn phase_cruise(&self) -> &'static str {
    ø::ui::phase_cruise(self.ø)
  }
  /// Cooldown $\[sec\]
  pub fn phase_cool(&self, sec: impl AsVal) -> Cow<'static, str> {
    ø::ui::phase_cool(self.ø, sec)
  }
  /// Liveness check
  pub fn phase_recover(&self) -> &'static str {
    ø::ui::phase_recover(self.ø)
  }
  /// Disabled ($\[code\])
  pub fn phase_dead(&self, code: impl AsVal) -> Cow<'static, str> {
    ø::ui::phase_dead(self.ø, code)
  }
  /// Disabled
  pub fn phase_dead_plain(&self) -> &'static str {
    ø::ui::phase_dead_plain(self.ø)
  }
  /// $\[n\] more tokens ($\[info\])
  pub fn pool_more(&self, n: impl AsVal, info: impl AsVal) -> Cow<'static, str> {
    ø::ui::pool_more(self.ø, n, info)
  }
  /// Concurrency $\[n\]
  pub fn pool_conc(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::pool_conc(self.ø, n)
  }
  /// Cooldown $\[n\]
  pub fn pool_cool(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::pool_cool(self.ø, n)
  }
  /// Idle $\[n\]
  pub fn pool_idle(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::pool_idle(self.ø, n)
  }
  /// Disabled $\[n\]
  pub fn pool_dead(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::pool_dead(self.ø, n)
  }
  /// $\[tok\] tokens
  pub fn pool_tok(&self, tok: impl AsVal) -> Cow<'static, str> {
    ø::ui::pool_tok(self.ø, tok)
  }
  /// $\[n\] more tasks are being translated concurrently
  pub fn task_more(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::task_more(self.ø, n)
  }
  /// $\[n\] more tasks are being translated concurrently ($\[q\] queued)
  pub fn task_more_q(&self, n: impl AsVal, q: impl AsVal) -> Cow<'static, str> {
    ø::ui::task_more_q(self.ø, n, q)
  }
  /// $\[n\] $\[name\] files are being translated
  pub fn sec_run(&self, n: impl AsVal, name: impl AsVal) -> Cow<'static, str> {
    ø::ui::sec_run(self.ø, n, name)
  }
  /// $\[n\] $\[name\] files are being translated · $\[q\] in queue
  pub fn sec_run_q(&self, n: impl AsVal, name: impl AsVal, q: impl AsVal) -> Cow<'static, str> {
    ø::ui::sec_run_q(self.ø, n, name, q)
  }
  /// Completed ($\[ok\])
  pub fn sec_done(&self, ok: impl AsVal) -> Cow<'static, str> {
    ø::ui::sec_done(self.ø, ok)
  }
  /// Completed ($\[ok\] · Failed $\[fail\])
  pub fn sec_done_fail(&self, ok: impl AsVal, fail: impl AsVal) -> Cow<'static, str> {
    ø::ui::sec_done_fail(self.ø, ok, fail)
  }
  /// Concurrency $\[n\]
  pub fn foot_conc(&self, n: impl AsVal) -> Cow<'static, str> {
    ø::ui::foot_conc(self.ø, n)
  }
  /// Tokens $\[tok\]
  pub fn foot_tok(&self, tok: impl AsVal) -> Cow<'static, str> {
    ø::ui::foot_tok(self.ø, tok)
  }
  /// No changes found, no translation needed
  pub fn no_change(&self) -> &'static str {
    ø::ui::no_change(self.ø)
  }
}

::i18n_nt_macro::include!(fallback = "zh");