Crates
/
fission-i18n
fission-i18n
v0.10.0
Internationalization primitives for Fission applications
Install
cargo add fission-i18n
Copy
Platform support
Declared by the crate author and captured when this directory was generated.
Android
Supported
iOS
Supported
Linux
Supported
macOS
Supported
Windows
Supported
Web
Supported
Terminal
Supported
Static site
Supported
Server-rendered
Supported
Package metadata
crates.io
View package
Documentation
Not provided
Repository
Open link
License
MIT
Latest version
0.10.0
Downloads
1751
Last updated
2026-08-02T15:07:44.846614Z
Categories
gui
localization
Keywords
fission
i18n
localization
translations
ui-framework
Published versions
0.10.0
0.9.2
0.9.1
0.9.0
0.8.0
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.1
0.5.0
Dependencies
Dependency metadata is not indexed yet.
README

fission-i18n

Internationalization (i18n) support for Fission applications.
This crate provides a simple, registry-based translation system. It stores locale-specific string bundles and retrieves messages by key and locale at runtime.

Core types

Locale

A newtype wrapper around String representing a BCP 47 locale identifier (e.g., "en-US", "ja-JP"). Defaults to "en-US".
use fission_i18n::Locale;

let locale = Locale::default();          // "en-US"
let locale = Locale::from("fr-FR");      // French
let locale = Locale("de-DE".to_string()); // German

TranslationBundle

A collection of key-value message pairs for a single locale. Load these from JSON, TOML, or construct them programmatically.
use fission_i18n::{TranslationBundle, Locale};
use std::collections::HashMap;

let bundle = TranslationBundle {
    locale: Locale::from("es-ES"),
    messages: HashMap::from([
        ("greeting".to_string(), "Hola".to_string()),
        ("farewell".to_string(), "Adios".to_string()),
    ]),
};

I18nRegistry

The central registry that holds all translation bundles. Supports multiple locales simultaneously and merges bundles for the same locale (later entries overwrite earlier ones for the same key).
use fission_i18n::{I18nRegistry, TranslationBundle, Locale};

let mut registry = I18nRegistry::new();
registry.add_bundle(english_bundle);
registry.add_bundle(spanish_bundle);

let locale = Locale::from("es-ES");
let greeting = registry.get(&locale, "greeting"); // Some("Hola")
let missing = registry.get(&locale, "unknown");   // None

Serialization

All types implement Serialize and Deserialize, so bundles can be loaded from JSON files:
{
  "locale": "ja-JP",
  "messages": {
    "save": "保存",
    "cancel": "キャンセル",
    "delete": "削除"
  }
}

Design notes

The registry uses HashMap<Locale, HashMap<String, String>> internally.
Lookups are O(1) per locale and O(1) per key.
There is no fallback chain (e.g., en-US does not fall back to en). The caller is responsible for implementing fallback logic if needed.
The registry is not global -- it is owned by the application and passed through the Env or state.
README

fission-i18n

Internationalization (i18n) support for Fission applications.
This crate provides a simple, registry-based translation system. It stores locale-specific string bundles and retrieves messages by key and locale at runtime.

Core types

Locale

A newtype wrapper around String representing a BCP 47 locale identifier (e.g., "en-US", "ja-JP"). Defaults to "en-US".
use fission_i18n::Locale;

let locale = Locale::default();          // "en-US"
let locale = Locale::from("fr-FR");      // French
let locale = Locale("de-DE".to_string()); // German

TranslationBundle

A collection of key-value message pairs for a single locale. Load these from JSON, TOML, or construct them programmatically.
use fission_i18n::{TranslationBundle, Locale};
use std::collections::HashMap;

let bundle = TranslationBundle {
    locale: Locale::from("es-ES"),
    messages: HashMap::from([
        ("greeting".to_string(), "Hola".to_string()),
        ("farewell".to_string(), "Adios".to_string()),
    ]),
};

I18nRegistry

The central registry that holds all translation bundles. Supports multiple locales simultaneously and merges bundles for the same locale (later entries overwrite earlier ones for the same key).
use fission_i18n::{I18nRegistry, TranslationBundle, Locale};

let mut registry = I18nRegistry::new();
registry.add_bundle(english_bundle);
registry.add_bundle(spanish_bundle);

let locale = Locale::from("es-ES");
let greeting = registry.get(&locale, "greeting"); // Some("Hola")
let missing = registry.get(&locale, "unknown");   // None

Serialization

All types implement Serialize and Deserialize, so bundles can be loaded from JSON files:
{
  "locale": "ja-JP",
  "messages": {
    "save": "保存",
    "cancel": "キャンセル",
    "delete": "削除"
  }
}

Design notes

The registry uses HashMap<Locale, HashMap<String, String>> internally.
Lookups are O(1) per locale and O(1) per key.
There is no fallback chain (e.g., en-US does not fall back to en). The caller is responsible for implementing fallback logic if needed.
The registry is not global -- it is owned by the application and passed through the Env or state.
Package metadata
crates.io
View package
Documentation
Not provided
Repository
Open link
License
MIT
Latest version
0.10.0
Downloads
1751
Last updated
2026-08-02T15:07:44.846614Z
Categories
gui
localization
Keywords
fission
i18n
localization
translations
ui-framework
Published versions
0.10.0
0.9.2
0.9.1
0.9.0
0.8.0
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.1
0.5.0
Dependencies
Dependency metadata is not indexed yet.