Trait legacytranslate::Lang
source · pub trait Lang {
// Required method
fn deconstruct_lang_id<D>(
self,
diskit: D
) -> Result<Vec<(String, LanguageIdentifier)>, Error>
where D: Diskit;
}
Expand description
Selection of available languages.
This trait is used to specify the language that should be used.
Required Methods§
sourcefn deconstruct_lang_id<D>(
self,
diskit: D
) -> Result<Vec<(String, LanguageIdentifier)>, Error>where
D: Diskit,
fn deconstruct_lang_id<D>( self, diskit: D ) -> Result<Vec<(String, LanguageIdentifier)>, Error>where D: Diskit,
Deconstruct language
This function returns the data associated with the language (and all it’s backups). The first piece is the full list of all translated messages in the standard fluent syntax, the second one is a fluent language identifier.
The first value of the Vec
is the main language, the others
are backups. The languages are tried from front to back.
Errors
If something fails it returns an error of type
legacytranslate::Error
. If this type isn’t
sufficient, use the Custom
variant of it.