Skip to main content

compiled_key

Function compiled_key 

Source
pub fn compiled_key(msgid: &str, msgctxt: Option<&str>) -> String
Expand description

Derives the default stable runtime lookup key for msgid and msgctxt.

This public helper uses the same FerrocatV1 key contract as NormalizedParsedCatalog::compile and compile_catalog_artifact.

use ferrocat_po::compiled_key;

let without_context = compiled_key("Save", None);
let with_context = compiled_key("Save", Some("menu"));

assert_eq!(without_context.len(), 11);
assert_ne!(without_context, with_context);