From 9f1305ae1ec7ea75aadeed22c1bbb5f2f94e4738 Mon Sep 17 00:00:00 2001 From: Rodrigo Rivas Costa Date: Thu, 1 Aug 2024 00:13:29 +0200 Subject: [PATCH] Use the name of the crate in `set_translator!` instead of the full module. --- tr/src/lib.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/tr/src/lib.rs b/tr/src/lib.rs index b44540a..d2c3eb6 100644 --- a/tr/src/lib.rs +++ b/tr/src/lib.rs @@ -358,10 +358,11 @@ pub mod internal { } pub fn set_translator(module: &'static str, translator: impl Translator + 'static) { + let domain = domain_from_module(module); TRANSLATORS .write() .unwrap() - .insert(module, Box::new(translator)); + .insert(domain, Box::new(translator)); } }