From dc463df47625d7f9959b6be03d2ac1affbd2ca81 Mon Sep 17 00:00:00 2001 From: Ralf Zerres Date: Fri, 11 Jun 2021 12:59:59 +0200 Subject: [PATCH] twine: update i18n usage * update to use latest twain crate * activate feature vor serialization, deserialization (consuming 'serde') * use (t!) macro from twain crate consuming i18n.rs * i18n.rs is compiled via build.rs from source * update docu hint in translation source Signed-off-by: Ralf Zerres --- advotracker_client/Cargo.toml | 7 ++++--- advotracker_client/src/i18n/localization.ini | 4 ++++ advotracker_client/src/lib.rs | 2 +- 3 files changed, 9 insertions(+), 4 deletions(-) diff --git a/advotracker_client/Cargo.toml b/advotracker_client/Cargo.toml index 07ae629..31c7b8f 100644 --- a/advotracker_client/Cargo.toml +++ b/advotracker_client/Cargo.toml @@ -29,7 +29,7 @@ lazy_static = { version = "~1.4.0" } log = { version = "~0.4.8" } maud = { version = "~0.22.1" } orbtk = { git = "https://github.com/redox-os/orbtk.git", branch = "develop" } -#orbtk = { path = "../../../orbtk" } +#orbtk = { path = "../../../orbtk", branch="next" } serde = { version = "~1", features = ["derive"] } sdl2 = { version = "~0.34", features = ["bundled"] } substring = { version = "~1" } @@ -39,8 +39,9 @@ viperus = { git = "https://github.com/maurocordioli/viperus", features = ["cach [build-dependencies] winres = { version = "0.1.11" } -#twine = { version = "0.3.8" } -#twine = { path = "../../../twine", features = ["serde"] } +#twine = { version = "0.3.9", features = ["serde"] } +## twine with PR's +twine = { path = "../../twine", features = ["serde"] } [features] default = [] diff --git a/advotracker_client/src/i18n/localization.ini b/advotracker_client/src/i18n/localization.ini index bb43161..8a1b60d 100644 --- a/advotracker_client/src/i18n/localization.ini +++ b/advotracker_client/src/i18n/localization.ini @@ -1,3 +1,7 @@ +### +# twine style translation source +# All translation keys must define language strings for used keys +### [err_lang_not_found] de = Konnte Sprachkode nicht auslesen en = Couldn't read diff --git a/advotracker_client/src/lib.rs b/advotracker_client/src/lib.rs index bfe10d4..80e1479 100644 --- a/advotracker_client/src/lib.rs +++ b/advotracker_client/src/lib.rs @@ -26,7 +26,7 @@ //! WIP: provide a workflow image //! -// i18n: get the macro (t!) accessing translated strings +// i18n: get twine generated translation strings for macro (t!) include!(concat!(env!("OUT_DIR"), "/i18n.rs")); // /// The client specific services