Skip to content

v0.2.0

Latest

Choose a tag to compare

@xangelix xangelix released this 18 Oct 23:56
e074e73

⚠️ Breaking: keep fluent-zero and fluent-zero-build on the same version; generated code now checks this at compile time.

  • Public API trimmed: lookup functions, CacheStore, BundleCollection and dependency re-exports (phf, fluent_syntax, FluentError, bundle types) moved behind the hidden __private module. Use t! / t_in!. get_lang() returns Arc<LocaleState>; LocaleState has id() and key().
  • Fallible builder: try_generate() returns fluent_zero_build::Error (parse errors with path:line:col, duplicate IDs, missing or invalid fallback locale, denied missing translations, I/O); generate() panics with the same message. crate_path(...) supports renamed dependencies.
  • Locales: negotiation with a fallback chain (set_lang("pt-BR") finds pt-PT), configurable fallback_locale, per-call t_in!, generated CATALOG.
  • Correctness: charset covers select variants, attributes and terms; quotes in static messages no longer break the build; duplicate IDs are reported with both locations; message attributes via message.attribute keys; deterministic generated output.
  • Compile-time checks: literal keys passed to t! / t_in! must exist; generated keys module with one constant per key.
  • Diagnostics: set_error_handler / LookupError (or the tracing feature) for missing keys and arguments; translation coverage warnings via missing_translations.
  • Options: use_isolating(false) to drop U+2068/U+2069 bidi marks.
  • Packaging: MIT LICENSE shipped in both crates, MSRV 1.88, hardened CI, benchmarks and a zero-allocation test.
  • Dependency upgrades: arc-swap 1.9. fluent-langneg stays on 0.13 to match fluent-bundle 0.16 (0.14 moved to ICU4X identifiers).