pub fn resolve<'a>(&'a mut self, data: &T, env: &Env) -> bool {
        //TODO: this recomputes the string if either the language has changed,
        //or *anytime* we have arguments. Ideally we would be using a lens
        //to only recompute when our actual data has changed.
        let manager = match env.localization_manager() {
            Some(manager) => manager,
            None => return false,
        };

        if self.args.is_some() || self.resolved_lang.as_ref() != Some(&manager.current_locale) {
            let args: Option<FluentArgs> = self
                .args
                .as_ref()
                .map(|a| a.iter().map(|(k, v)| (*k, (v.0)(data, env))).collect());

            self.resolved_lang = Some(manager.current_locale.clone());
            let next = manager.localize(self.key, args.as_ref());
            let result = next != self.resolved;
            self.resolved = next;
            result
        } else {
            false
        }
    }
/// Lazily compute the localized value for this string based on the provided
/// environment and data.
///
/// Returns `true` if the current value of the string has changed.
Lazily compute the localized value for this string based on the provided
environment and data.

Returns `true` if the current value of the string has changed.
Lazily compute the localized value for this string based on the provided environment and data . Returns ` true ` if the current value of the string has changed .
pub fn resolve<'a>(&'a mut self, data: &T, env: &Env) -> bool {
        //TODO: this recomputes the string if either the language has changed,
        //or *anytime* we have arguments. Ideally we would be using a lens
        //to only recompute when our actual data has changed.
        let manager = match env.localization_manager() {
            Some(manager) => manager,
            None => return false,
        };
        if self.args.is_some() || self.resolved_lang.as_ref() != Some(&manager.current_locale) {
            let args: Option<FluentArgs> = self
                .args
                .as_ref()
                .map(|a| a.iter().map(|(k, v)| (*k, (v.0)(data, env))).collect());
            self.resolved_lang = Some(manager.current_locale.clone());
            let next = manager.localize(self.key, args.as_ref());
            let result = next != self.resolved;
            self.resolved = next;
            result
        } else {
            false
        }
    }
pub fn resolve < ' a > ( & ' a mut self , data : & T , env : & Env ) -> bool { //TODO: this recomputes the string if either the language has changed, //or *anytime* we have arguments. Ideally we would be using a lens //to only recompute when our actual data has changed. let manager = match env . localization_manager ( ) { Some ( manager ) => manager , None => return false , } ; if self . args . is_some ( ) || self . resolved_lang . as_ref ( ) != Some ( & manager . current_locale ) { let args : Option < FluentArgs > = self . args . as_ref ( ) . map ( | a | a . iter ( ) . map ( | ( k , v ) | ( * k , ( v . 0 ) ( data , env ) ) ) . collect ( ) ) ; self . resolved_lang = Some ( manager . current_locale . clone ( ) ) ; let next = manager . localize ( self . key , args . as_ref ( ) ) ; let result = next != self . resolved ; self . resolved = next ; result } else { false } }
Lazily compute the localized value for this string based on the provided
environment and data.
Lazily compute the localized value for this string based on the provided environment and data .
&'a mut self
data
&T
env
&Env
&'a mut self
data
&T
env
&Env