| Crates.io | brutal_i18n |
| lib.rs | brutal_i18n |
| version | 0.3.1 |
| created_at | 2025-05-08 13:36:30.405809+00 |
| updated_at | 2025-05-08 13:50:31.369369+00 |
| description | A nonchalant i18n library, inspired by rust-i18n; load a YAML file for some compile time action, get translation texts at runtime. |
| homepage | |
| repository | |
| max_upload_size | |
| id | 1665352 |
| size | 14,279 |
A nonchalant, disturbingly simplistic and brutal i18n library, directly inspired by rust-i18n.
t!(<key>, locale=<locale>) wherever you need to replace text blocks.as_ref.// Give it the translation file first:
brutal_i18n::i18n!(
"localization/translations.yaml",
fallback = "en"
);
// Then use it somewhere:
brutal_i18n::t!(
"tennis",
locale = "en"
);
// Get a list of all locales:
let locales = brutal_i18n::available_locales!();
// Do stuff with it...
Only supports one yaml translation file. All translation keys must be found, otherwise panic.
key:
en: key
fi: avain
ko: 열쇠