{"id":18853117,"url":"https://github.com/dsolartec/languages-rs","last_synced_at":"2026-05-27T21:31:07.537Z","repository":{"id":48762109,"uuid":"351909004","full_name":"dsolartec/languages-rs","owner":"dsolartec","description":"An internationalization library for your projects","archived":false,"fork":false,"pushed_at":"2021-07-13T02:23:01.000Z","size":44,"stargazers_count":3,"open_issues_count":1,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-12-13T21:34:47.170Z","etag":null,"topics":["accessibility","internationalization","localization","rust","rust-lang"],"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/dsolartec.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null}},"created_at":"2021-03-26T20:52:07.000Z","updated_at":"2022-04-19T03:27:33.000Z","dependencies_parsed_at":"2022-08-30T12:31:44.854Z","dependency_job_id":null,"html_url":"https://github.com/dsolartec/languages-rs","commit_stats":null,"previous_names":["daschdev/languages-rs"],"tags_count":2,"template":false,"template_full_name":null,"purl":"pkg:github/dsolartec/languages-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsolartec%2Flanguages-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsolartec%2Flanguages-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsolartec%2Flanguages-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsolartec%2Flanguages-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/dsolartec","download_url":"https://codeload.github.com/dsolartec/languages-rs/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/dsolartec%2Flanguages-rs/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33585203,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-26T15:22:16.424Z","status":"online","status_checked_at":"2026-05-27T02:00:06.184Z","response_time":53,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["accessibility","internationalization","localization","rust","rust-lang"],"created_at":"2024-11-08T03:43:01.119Z","updated_at":"2026-05-27T21:31:07.518Z","avatar_url":"https://github.com/dsolartec.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# languages-rs \u0026emsp; ![Crates.io version][crates.io] ![CI workflow status][ci]\n\n[crates.io]: https://img.shields.io/crates/v/languages-rs\n[ci]: https://img.shields.io/github/workflow/status/danielsolartech/languages-rs/CI\n\nAn internationalization library for Rust.\n\n## Installation\n\nUse with JSON language files:\n\n```toml\n[dependencies]\nlanguages-rs = { version = \"0.2.0\", features = [\"with-json\"] }\n```\n\nUse with TOML language files:\n\n```toml\n[dependencies]\nlanguages-rs = { version = \"0.2.0\", features = [\"with-toml\"] }\n```\n\n## Basic Usage\n\n`languages/en.json`\n\n```json\n{\n  \"hello_world\": \"Hello world!\"\n}\n```\n\n`src/main.rs`\n\n```rust\nuse languages_rs::{Config, Languages, load, Value};\n\nfn main() -\u003e Result\u003c()\u003e {\n    let mut configuration: Config = Config::default().unwrap();\n    configuration.add_language(\"en\").unwrap();\n\n    // Load all default languages.\n    let texts: Languages = load(configuration).unwrap();\n\n    // Get the English texts from `/languages/en.json`.\n    let texts_en: LanguagesTexts = texts.try_get_language(\"en\").unwrap();\n\n    // Get the `hello_world` text from English texts.\n    let en_hello_world: Value = texts_en.try_get_text(\"hello_world\").unwrap();\n    assert!(en_hello_world.is_string());\n\n    // Another alternative to get the `hello_world` text from English texts is:\n    let en_hello_world_2: Value = texts.try_get_text_from_language(\"en\", \"hello_world\").unwrap();\n    assert!(en_hello_world_2.is_string());\n\n    assert_eq!(en_hello_world, en_hello_world_2);\n    assert_eq!(en_hello_world.get_string(), en_hello_world_2.get_string());\n}\n```\n\n## Examples\n\n- [json_files](./examples/json_files.rs) - Languages files with JSON.\n\n  ```console\n  $ cargo run --example json_files --features \"with-json\"\n  ```\n\n- [toml_files](./examples/toml_files.rs) - Languages files with TOML.\n  ```console\n  $ cargo run --example toml_files --features \"with-toml\"\n  ```\n\n## Testing\n\n```console\n$ cargo test\n```\n\n## Authors\n\n- [@daschdev](https://github.com/daschdev) - Initial project\n\n## Changelog\n\nView the lastest repository changes in the [CHANGELOG.md](./CHANGELOG.md) file.\n\n## Copyright\n\nLicense: MIT\n\nRead file [LICENSE](./LICENSE) for more information.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsolartec%2Flanguages-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdsolartec%2Flanguages-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdsolartec%2Flanguages-rs/lists"}