{"id":28753189,"url":"https://github.com/dioxus-community/dioxus-i18n","last_synced_at":"2025-06-17T00:39:00.028Z","repository":{"id":255437373,"uuid":"850259994","full_name":"dioxus-community/dioxus-i18n","owner":"dioxus-community","description":"i18n (localization) support for all Dioxus apps and renderers","archived":false,"fork":false,"pushed_at":"2025-05-26T17:34:29.000Z","size":76,"stargazers_count":24,"open_issues_count":5,"forks_count":3,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-05-26T18:39:13.999Z","etag":null,"topics":["dioxus","i18n","localization"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/dioxus-community.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2024-08-31T09:42:18.000Z","updated_at":"2025-05-26T17:34:32.000Z","dependencies_parsed_at":null,"dependency_job_id":"13c8d3ea-1e35-412e-b3d8-165c0e2093cc","html_url":"https://github.com/dioxus-community/dioxus-i18n","commit_stats":null,"previous_names":["dioxus-community/dioxus-i18n"],"tags_count":10,"template":false,"template_full_name":null,"purl":"pkg:github/dioxus-community/dioxus-i18n","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-i18n","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-i18n/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-i18n/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-i18n/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dioxus-community","download_url":"https://codeload.github.com/dioxus-community/dioxus-i18n/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dioxus-community%2Fdioxus-i18n/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":260268635,"owners_count":22983601,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["dioxus","i18n","localization"],"created_at":"2025-06-17T00:38:58.757Z","updated_at":"2025-06-17T00:39:00.016Z","avatar_url":"https://github.com/dioxus-community.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# dioxus-i18n 🌍\r\n\r\ni18n integration for Dioxus apps based on the [Project Fluent](https://github.com/projectfluent/fluent-rs).\r\n\r\n\u003e This crate used to be in the [Dioxus SDK](https://github.com/DioxusLabs/sdk).\r\n\r\n## Support\r\n\r\n- **Dioxus v0.6** 🧬\r\n- Renderers:\r\n  - [web](https://dioxuslabs.com/learn/0.6/guides/web/),\r\n  - [desktop](https://dioxuslabs.com/learn/0.6/guides/desktop/),\r\n  - [freya](https://github.com/marc2332/freya)\r\n- Both WASM and native targets\r\n\r\n## Example:\r\n\r\n```ftl\r\n# en-US.ftl\r\n\r\nhello = Hello, {$name}!\r\n```\r\n\r\n```rs\r\n// main.rs\r\n\r\nfn app() -\u003e Element {\r\n    let i18 = use_init_i18n(|| {\r\n        I18nConfig::new(langid!(\"en-US\"))\r\n            // implicit [`Locale`]\r\n            .with_locale(( // Embed\r\n                langid!(\"en-US\"),\r\n                include_str!(\"./en-US.ftl\")\r\n            ))\r\n            .with_locale(( // Load at launch\r\n                langid!(\"es-ES\"),\r\n                PathBuf::from(\"./es-ES.ftl\"),\r\n            ))\r\n            .with_locale((     // Locales will share duplicated locale_resources\r\n                langid!(\"en\"), // which is useful to assign a specific region for\r\n                include_str!(\"./en-US.ftl\") // the primary language\r\n            ))\r\n            // explicit [`Locale`]\r\n            .with_locale(Locale::new_static( // Embed\r\n                langid!(\"en-US\"),\r\n                include_str!(\"./en-US.ftl\"),\r\n            ))\r\n            .with_locale(Locale::new_dynamic( // Load at launch\r\n                langid!(\"es-ES\"),\r\n                PathBuf::from(\"./es-ES.ftl\"),\r\n            ))\r\n    });\r\n\r\n    rsx!(\r\n        label { { t!(\"hello\", name: \"World\") } }\r\n    )\r\n}\r\n```\r\n\r\n## Further examples\r\n\r\nThe examples folder contains a number of working examples:\r\n\r\n* Desktop examples:\r\n  * [Dioxus](./examples/dioxus-desktop.rs)\r\n  * [Freya](./examples/freya.rs)\r\n* Configuration variants:\r\n  * [Auto locales](./examples/config-auto-locales.rs)\r\n  * [Dynamic (PathBuf)](./examples/config-dynamic-pathbuf.rs)\r\n  * [Static (include_str!)](./examples/config-static-includestr.rs)\r\n* Fluent grammer:\r\n  * [Application](./examples/fluent-grammar.rs)\r\n  * [FTL file](./examples/data/fluent/en.ftl)\r\n\r\n## Development\r\n\r\n```bash\r\n# Checks clean compile against `#[cfg(not(target_arch = \"wasm32\"))]`\r\ncargo build --target wasm32-unknown-unknown\r\n\r\n# Runs all tests\r\ncargo test\r\n```\r\n\r\n[MIT License](./LICENSE.md)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdioxus-community%2Fdioxus-i18n","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdioxus-community%2Fdioxus-i18n","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdioxus-community%2Fdioxus-i18n/lists"}