Crates.io | rimloc-export-csv |
lib.rs | rimloc-export-csv |
version | 0.1.0 |
created_at | 2025-09-25 17:58:08.031708+00 |
updated_at | 2025-09-25 17:58:08.031708+00 |
description | CSV exporter for RimLoc toolkit |
homepage | |
repository | https://github.com/0-danielviktorovich-0/RimLoc |
max_upload_size | |
id | 1854923 |
size | 16,311 |
CSV exporter for the RimLoc toolkit.
[dependencies]
rimloc-export-csv = "0.1.0"
rimloc-core = "0.1.0"
csv = "1"
Write a CSV with optional lang
column:
use rimloc_core::TransUnit;
use rimloc_export_csv::write_csv;
use std::path::PathBuf;
fn main() -> color_eyre::Result<()> {
let units = vec![TransUnit {
key: "Greeting".into(),
source: Some("Hello".into()),
path: PathBuf::from("/Mods/My/Languages/English/Keyed/A.xml"),
line: Some(3),
}];
let mut out = Vec::new();
write_csv(&mut out, &units, Some("ru"))?;
println!("{}", String::from_utf8(out).unwrap());
Ok(())
}