| Crates.io | rimloc-export-po |
| lib.rs | rimloc-export-po |
| version | 0.1.0 |
| created_at | 2025-09-25 17:58:16.364715+00 |
| updated_at | 2025-09-25 17:58:16.364715+00 |
| description | PO exporter for RimWorld mods (RimLoc toolkit) |
| homepage | |
| repository | https://github.com/0-danielviktorovich-0/RimLoc |
| max_upload_size | |
| id | 1854924 |
| size | 25,553 |
PO exporter used by RimLoc to produce hand-off files for translators.
[dependencies]
rimloc-export-po = "0.1.0"
rimloc-core = "0.1.0"
Write a .po file with header, references and msgctxt:
use rimloc_core::TransUnit;
use rimloc_export_po::write_po;
use std::path::Path;
fn main() -> color_eyre::Result<()> {
let units = vec![TransUnit {
key: "Greeting".into(),
source: Some("Hello".into()),
path: "/Mods/My/Languages/English/Keyed/A.xml".into(),
line: Some(3),
}];
write_po(Path::new("./out.po"), &units, Some("ru"))?;
Ok(())
}