fn load_languages(
        &self,
        i18n_assets: &dyn I18nAssets,
        language_ids: &[&unic_langid::LanguageIdentifier],
    ) -> Result<(), I18nEmbedError> {
        let language_id = *language_ids
            .get(0)
            .ok_or(I18nEmbedError::RequestedLanguagesEmpty)?;

        if language_id == self.fallback_language() {
            self.load_src_language();
            return Ok(());
        }

        let (_path, file) = match self.language_file(language_id, i18n_assets) {
            (path, Some(f)) => (path, f),
            (path, None) => {
                log::error!(
                    target:"i18n_embed::gettext", 
                    "{} Setting current_language to fallback locale: \"{}\".", 
                    I18nEmbedError::LanguageNotAvailable(path, language_id.clone()),
                    self.fallback_language);
                self.load_src_language();
                return Ok(());
            }
        };

        let catalog = gettext_system::Catalog::parse(&*file).expect("could not parse the catalog");
        tr::internal::set_translator(self.module, catalog);
        *(self.current_language.write()) = language_id.clone();

        Ok(())
    }
/// Load the languages `language_ids` using the resources packaged
/// in the `i18n_assets` in order of fallback preference. This
/// also sets the [LanguageLoader::current_language()] to the
/// first in the `language_ids` slice. You can use
/// [select()](super::select()) to determine which fallbacks are
/// actually available for an arbitrary slice of preferences.
///
/// **Note:** Gettext doesn't support loading multiple languages
/// as multiple fallbacks. We only load the first of the requested
/// languages, and the fallback is the src language.
Load the languages `language_ids` using the resources packaged
in the `i18n_assets` in order of fallback preference. This
also sets the [LanguageLoader::current_language()] to the
first in the `language_ids` slice. You can use
[select()](super::select()) to determine which fallbacks are
actually available for an arbitrary slice of preferences.

Gettext doesn't support loading multiple languages
as multiple fallbacks. We only load the first of the requested
languages, and the fallback is the src language.
Load the languages ` language_ids ` using the resources packaged in the ` i18n_assets ` in order of fallback preference . This also sets the [ LanguageLoader :: current_language () ] to the first in the ` language_ids ` slice . You can use [ select () ] ( super :: select () ) to determine which fallbacks are actually available for an arbitrary slice of preferences . Gettext doesn ' t support loading multiple languages as multiple fallbacks . We only load the first of the requested languages and the fallback is the src language .
fn load_languages(
        &self,
        i18n_assets: &dyn I18nAssets,
        language_ids: &[&unic_langid::LanguageIdentifier],
    ) -> Result<(), I18nEmbedError> {
        let language_id = *language_ids
            .get(0)
            .ok_or(I18nEmbedError::RequestedLanguagesEmpty)?;
        if language_id == self.fallback_language() {
            self.load_src_language();
            return Ok(());
        }
        let (_path, file) = match self.language_file(language_id, i18n_assets) {
            (path, Some(f)) => (path, f),
            (path, None) => {
                log::error!(
                    target:"i18n_embed::gettext", 
                    "{} Setting current_language to fallback locale: \"{}\".", 
                    I18nEmbedError::LanguageNotAvailable(path, language_id.clone()),
                    self.fallback_language);
                self.load_src_language();
                return Ok(());
            }
        };
        let catalog = gettext_system::Catalog::parse(&*file).expect("could not parse the catalog");
        tr::internal::set_translator(self.module, catalog);
        *(self.current_language.write()) = language_id.clone();
        Ok(())
    }
fn load_languages ( & self , i18n_assets : & dyn I18nAssets , language_ids : & [ & unic_langid :: LanguageIdentifier ] , ) -> Result < ( ) , I18nEmbedError > { let language_id = * language_ids . get ( 0 ) . ok_or ( I18nEmbedError :: RequestedLanguagesEmpty ) ? ; if language_id == self . fallback_language ( ) { self . load_src_language ( ) ; return Ok ( ( ) ) ; } let ( _path , file ) = match self . language_file ( language_id , i18n_assets ) { ( path , Some ( f ) ) => ( path , f ) , ( path , None ) => { log :: error ! ( target " " " \" \" " I18nEmbedError LanguageNotAvailable ( path language_id clone ( ) ) self fallback_language ) ; self . load_src_language ( ) ; return Ok ( ( ) ) ; } } ; let catalog = gettext_system :: Catalog :: parse ( & * file ) . expect ( " " ) ; tr :: internal :: set_translator ( self . module , catalog ) ; * ( self . current_language . write ( ) ) = language_id . clone ( ) ; Ok ( ( ) ) }
Load the languages `language_ids` using the resources packaged
in the `i18n_assets` in order of fallback preference.
Load the languages ` language_ids ` using the resources packaged in the ` i18n_assets ` in order of fallback preference .
&self
i18n_assets
&dyn I18nAssets
language_ids
&[&unic_langid::LanguageIdentifier]
&self
i18n_assets
&dyn I18nAssets
language_ids
&[&unic_langid::LanguageIdentifier]