-
Notifications
You must be signed in to change notification settings - Fork 32
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix lazy init always "en" #88
Conversation
Could you please add me as a co-author? |
Co-authored-by: yk0n9 <[email protected]> Co-authored-by: KKRainbow <[email protected]>
of course |
Closes #87 #88 Co-authored-by: yk0n9 <[email protected]> Co-authored-by: KKRainbow <[email protected]>
I feel like your code doesn't fix it😂
set_locale("zh");
t!("xxx"); // <-- backend is initialized here
|
#[test]
fn test_set_locale() {
rust_i18n::set_locale("zh-CN");
for _ in 0..5 {
assert_eq!(t!("hello"), "Bar - 你好世界!");
}
} ---- tests::test_set_locale stdout ----
thread 'tests::test_set_locale' panicked at tests\integration_tests.rs:323:13:
assertion `left == right` failed
left: "Bar - Hello, World!"
right: "Bar - 你好世界!"
stack backtrace:
0: rust_begin_unwind
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\std\src/panicking.rs:652:5
1: core::panicking::panic_fmt
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src/panicking.rs:72:14
2: core::panicking::assert_failed_inner
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src/panicking.rs:408:17
3: core::panicking::assert_failed
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src/panicking.rs:363:5
4: integration_tests::tests::test_set_locale
at .\tests\integration_tests.rs:323:13
5: integration_tests::tests::test_set_locale::{{closure}}
at .\tests\integration_tests.rs:320:25
6: core::ops::function::FnOnce::call_once
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23\library\core\src\ops/function.rs:250:5
7: core::ops::function::FnOnce::call_once
at /rustc/3f5fd8dd41153bc5fdca9427e9e05be2c767ba23/library\core\src\ops/function.rs:250:5
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
failures:
tests::test_set_locale
test result: FAILED. 0 passed; 1 failed; 0 ignored; 0 measured; 18 filtered out; finished in 0.01s
error: test failed, to rerun pass `-p rust-i18n --test integration_tests` Apparently, the test has failed in the merged code |
Oops, I remember I passed the test. 😂 |
Please merge main into your branch, I am going to merge this. |
close #87