rimloc-validate

Crates.iorimloc-validate
lib.rsrimloc-validate
version0.1.0
created_at2025-09-25 18:18:52.066338+00
updated_at2025-09-25 18:18:52.066338+00
descriptionValidation helpers for RimLoc to catch duplicates/placeholders issues
homepage
repositoryhttps://github.com/0-danielviktorovich-0/RimLoc
max_upload_size
id1854959
size22,261
Daniel Viktorovich (0-danielviktorovich-0)

documentation

https://0-danielviktorovich-0.github.io/RimLoc/

README

rimloc-validate

Validation helpers for RimLoc to catch duplicate keys and placeholder mismatches.

Usage

[dependencies]
rimloc-validate = "0.1.0"
rimloc-core = "0.1.0"

Validate scanned units:

use rimloc_core::TransUnit;
use rimloc_validate::validate;
use std::path::PathBuf;

fn main() -> color_eyre::Result<()> {
    let units = vec![TransUnit {
        key: "Greeting".into(),
        source: Some("Hello %s".into()),
        path: PathBuf::from("/Mods/My/Languages/English/Keyed/A.xml"),
        line: Some(3),
    }];
    let msgs = validate(&units)?;
    for m in msgs {
        eprintln!("{}:{} [{}] {}", m.path, m.line.unwrap_or(0), m.kind, m.message);
    }
    Ok(())
}

Links

Commit count: 167

cargo fmt