From e9f80e1c83665af1140fb57d2b0a1daf90617804 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=9D=8E=E8=BF=90=E5=AE=B6?= Date: Thu, 26 Sep 2024 17:49:47 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0message=E5=AE=8F=E6=B3=A8?= =?UTF-8?q?=E9=87=8A?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- i18n/src/lib.rs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/i18n/src/lib.rs b/i18n/src/lib.rs index e727968..16912ef 100644 --- a/i18n/src/lib.rs +++ b/i18n/src/lib.rs @@ -78,9 +78,11 @@ pub fn convert_message_with_params(message_template: &'static str, args: Vec<&st #[macro_export] macro_rules! message { + // 通过lang id和message id获取消息 ($lang_id:expr, $message_id:expr) => { i18n::lang($lang_id, $message_id) }; + // 通过lang id和message id获取消息,并将参数格式化到消息中 ($lang_id:expr, $message_id:expr, $($arg:expr),*) => { { let message_template: &'static str = i18n::lang($lang_id, $message_id);