Skip to content

Commit

Permalink
Revert #90
Browse files Browse the repository at this point in the history
  • Loading branch information
huacnlee committed Aug 20, 2024
1 parent 9af40bb commit d4b7f37
Showing 1 changed file with 1 addition and 10 deletions.
11 changes: 1 addition & 10 deletions crates/macro/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -324,8 +324,6 @@ fn generate_code(
quote! {
use rust_i18n::{BackendExt, CowStr, MinifyKey};
use std::borrow::Cow;
use std::sync::Mutex;
use rust_i18n::once_cell::sync::Lazy;

/// I18n backend instance
///
Expand All @@ -335,18 +333,11 @@ fn generate_code(
let mut backend = rust_i18n::SimpleBackend::new();
#(#all_translations)*
#extend_code

if *_RUST_I18N_INITIALIZED_DEFAULT_LOCALE.lock().unwrap() == false {
*_RUST_I18N_INITIALIZED_DEFAULT_LOCALE.lock().unwrap() = true;
#default_locale
}
#default_locale

Box::new(backend)
});

/// To mark the default locale has been initialized
static _RUST_I18N_INITIALIZED_DEFAULT_LOCALE: Lazy<Mutex<bool>> = Lazy::new(|| Mutex::new(false));

static _RUST_I18N_FALLBACK_LOCALE: Option<&[&'static str]> = #fallback;
static _RUST_I18N_MINIFY_KEY: bool = #minify_key;
static _RUST_I18N_MINIFY_KEY_LEN: usize = #minify_key_len;
Expand Down

0 comments on commit d4b7f37

Please sign in to comment.