Skip to main content

set_translator

Function set_translator 

Source
pub fn set_translator<F>(f: F)
where F: Fn(&str) -> Option<String> + Send + Sync + 'static,
Expand description

Install the process-wide translator, replacing any previous one.

The runtime calls this after loading <app_dir>/locale/*.ftl. Reloading a catalogue needs no second call: a translator that closes over shared state sees the new bundles immediately.