| Crates.io | fa18n |
| lib.rs | fa18n |
| version | 0.1.0 |
| created_at | 2025-11-12 13:43:07.976167+00 |
| updated_at | 2025-11-12 13:43:07.976167+00 |
| description | Modern i18n support library base on faml |
| homepage | https://github.com/fawdlstty/fa18n |
| repository | https://github.com/fawdlstty/fa18n |
| max_upload_size | |
| id | 1929378 |
| size | 20,410 |
Modern i18n support library base on faml
Steps:
fa18n to your Cargo.toml[build-dependencies]
fa18n = 0.1.0
i18n/
en.faml
zh.faml
en.faml:
[i18n.en]
hello0 = "hello world"
Hello = "hello {name:str}"
zh.faml:
[i18n.zh]
hello0 = "你好,世界"
Hello = "你好,{name:str}"
build.rs and add code:fn main() {
fa18n::generate_rust("i18n/", "src/i18n.rs").unwrap();
}
main.rs code:pub mod i18n;
use crate::i18n::*;
fn main() {
let hello = I18n::hello("maria".to_string());
println!("{}", hello.translate(I18nLocale::Zh));
}