Skip to content

FilmCraft: An open-source, nonlinear video editor written by scratch in pure Rust

Merge remote-tracking branch 'origin/main' into fix-363

Brandon Thomase9c09d243ab3
diff --cc crates/ui-egui/src/lib.rs
index 039ab8c0e,a5c8ca6ca..83d18261e
--- a/crates/ui-egui/src/lib.rs
+++ b/crates/ui-egui/src/lib.rs
@@@ -6,9 -6,31 +6,32 @@@
#![cfg_attr(not(test), deny(clippy::unwrap_used, clippy::expect_used, clippy::panic, clippy::unimplemented, clippy::todo, clippy::unreachable))]
+ /// A literal UI string in the language the interface is drawn in (`i18n::t`). Only literals: the
+ /// i18n tests read every `tl!` literal in the crate and require a Spanish translation for it.
+ macro_rules! tl {
+ ($s:literal) => {
+ $crate::i18n::t($s)
+ };
+ }
+
+ /// A translated template with `{name}` placeholders filled in, for text that `format!` would build.
+ /// After the template literal come the values: `n = count`, or just `gain` for a variable of the
+ /// same name. Values are formatted with `Display`; the translation may reorder placeholders.
+ macro_rules! tlf {
+ (@v $k:ident = $v:expr) => {
+ $v
+ };
+ (@v $k:ident) => {
+ $k
+ };
+ ($s:literal $(, $k:ident $(= $v:expr)?)* $(,)?) => {
+ $crate::i18n::fmt($crate::i18n::t($s), &[$((stringify!($k), ToString::to_string(&tlf!(@v $k $(= $v)?)).as_str())),*])
+ };
+ }
+
pub mod automation;
pub mod brand;
+mod cjk;
pub mod control;
pub mod crash;
pub mod credits;