From 54d057bacc752da17a4d895358ec2237de5c46bd Mon Sep 17 00:00:00 2001 From: Varphone Wong Date: Sat, 20 Jan 2024 22:28:18 +0800 Subject: [PATCH] examples/app-tr: Cleanup --- examples/app-tr/Cargo.toml | 1 - examples/app-tr/src/main.rs | 5 ++--- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/examples/app-tr/Cargo.toml b/examples/app-tr/Cargo.toml index f991521..0cb30a1 100644 --- a/examples/app-tr/Cargo.toml +++ b/examples/app-tr/Cargo.toml @@ -9,7 +9,6 @@ version = "0.1.0" env_logger = { version = "0.11", optional = true } log = { version = "0.4", optional = true } rust-i18n = { path = "../.." } -# rust-i18n-macro = { path = "../../crates/macro" } [features] log_tr_dyn = ["env_logger", "log", "rust-i18n/log_tr_dyn"] diff --git a/examples/app-tr/src/main.rs b/examples/app-tr/src/main.rs index 4671206..ad8e40d 100644 --- a/examples/app-tr/src/main.rs +++ b/examples/app-tr/src/main.rs @@ -23,8 +23,7 @@ fn main() { println!("String literals with patterns translation:"); for locale in &locales { println!( - "{} => {} ({})", - "Hello, %{name}!", + "Hello, %{{name}}! => {} ({})", tr!("Hello, %{name}!", name = "World", locale = locale), locale ); @@ -61,7 +60,7 @@ fn main() { println!(); println!("Runtime string translation:"); - let src_list = vec!["Apple", "Banana", "Orange"]; + let src_list = ["Apple", "Banana", "Orange"]; for src in src_list.iter() { for locale in &locales { let translated = tr!(*src, locale = locale);