/// Translates the given ID. This additionally takes any arguments that should be interpolated. If your i18n system also has variants,
/// they should be specified somehow in the ID.
/// # Panics
/// This will `panic!` if any errors occur while trying to prepare the given ID. Therefore, this method should only be used for
/// hardcoded IDs that can be confirmed as valid. If you need to parse arbitrary IDs, use `.translate_checked()` instead.
Translates the given ID. This additionally takes any arguments that should be interpolated. If your i18n system also has variants,
they should be specified somehow in the ID.
Translates the given ID . This additionally takes any arguments that should be interpolated . If your i18n system also has variants they should be specified somehow in the ID .
pub fn translate(&self, id: &str, args: Option<FluentArgs>) -> String {
        let translation_res = self.translate_checked(&id.to_string(), args);
        match translation_res {
            Ok(translation) => translation,
            Err(_) => panic!("translation id '{}' not found for locale '{}' (if you're not hardcoding the id, use `.translate_checked()` instead)", id, self.locale)
        }
    }
pub fn translate ( & self , id : & str , args : Option < FluentArgs > ) -> String { let translation_res = self . translate_checked ( & id . to_string ( ) , args ) ; match translation_res { Ok ( translation ) => translation , Err ( _ ) => panic ! ( " " id self locale ) } }
Translates the given ID.
Translates the given ID .
&self
id
&str
args
Option<FluentArgs>
panics
This will `panic!` if any errors occur while trying to prepare the given ID. Therefore, this method should only be used for
hardcoded IDs that can be confirmed as valid. If you need to parse arbitrary IDs, use `.translate_checked()` instead.
This will ` panic! ` if any errors occur while trying to prepare the given ID . Therefore this method should only be used for hardcoded IDs that can be confirmed as valid . If you need to parse arbitrary IDs use ` . translate_checked () ` instead .