Skip to main content

tr_with

Function tr_with 

Source
pub fn tr_with(ctx: &Context, key: &StrKey, args: &[(&str, Arg<'_>)]) -> String
Expand description

The text of a key with its { $name } placeholders filled with typed arguments: text verbatim, numbers formatted for the language.

use egui_pop_core::strings::{self, StrKey};

const OPENED: StrKey = StrKey::new("opened", "{ $folder }: { $count } items");
let ctx = egui::Context::default();
let text = strings::tr_with(&ctx, &OPENED, &[("folder", "2026".into()), ("count", 3.into())]);
assert_eq!(text, "2026: 3 items");