pub struct CompiledI18n {
pub catalogues: Vec<(String, String)>,
pub fallback: Vec<String>,
}Expand description
The app’s translations, as baked at build time.
Each catalogue is the Fluent source of one locale/<tag>.ftl file, kept as
text: which locale an app runs in is decided when it runs, and every
target parses a catalogue through the same function. The compiler parses
each one before writing it here, so a catalogue that is not Fluent fails
the build rather than the app. A loose file on disk
wins over the copy here, so a translator still edits the file beside an
app and sees the change.
Fields§
§catalogues: Vec<(String, String)>Each locale’s catalogue: its BCP-47 tag, and the Fluent source. Ordered by tag, so the same catalogues write the same bytes.
fallback: Vec<String>The chain a key missing from the active catalogue falls through, as
[app] fallback_locale names it. Empty when the app names none, which
takes the default chain.
Implementations§
Trait Implementations§
Source§impl Clone for CompiledI18n
impl Clone for CompiledI18n
Source§fn clone(&self) -> CompiledI18n
fn clone(&self) -> CompiledI18n
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for CompiledI18n
impl Debug for CompiledI18n
Source§impl Default for CompiledI18n
impl Default for CompiledI18n
Source§fn default() -> CompiledI18n
fn default() -> CompiledI18n
Source§impl<'de> Deserialize<'de> for CompiledI18n
impl<'de> Deserialize<'de> for CompiledI18n
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for CompiledI18n
impl PartialEq for CompiledI18n
Source§fn eq(&self, other: &CompiledI18n) -> bool
fn eq(&self, other: &CompiledI18n) -> bool
self and other values to be equal, and is used by ==.Source§impl Serialize for CompiledI18n
impl Serialize for CompiledI18n
impl Eq for CompiledI18n
impl StructuralPartialEq for CompiledI18n
Auto Trait Implementations§
impl Freeze for CompiledI18n
impl RefUnwindSafe for CompiledI18n
impl Send for CompiledI18n
impl Sync for CompiledI18n
impl Unpin for CompiledI18n
impl UnsafeUnpin for CompiledI18n
impl UnwindSafe for CompiledI18n
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
§impl<T> DynEq for T
impl<T> DynEq for T
§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.§impl<T> FromTemplate for T
impl<T> FromTemplate for T
§impl<T> FromWorld for Twhere
T: Default,
impl<T> FromWorld for Twhere
T: Default,
§fn from_world(_world: &mut World) -> T
fn from_world(_world: &mut World) -> T
Creates Self using default().
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
§impl<T> IntoResult<T> for T
impl<T> IntoResult<T> for T
§fn into_result(self) -> Result<T, RunSystemError>
fn into_result(self) -> Result<T, RunSystemError>
§impl<T> Template for T
impl<T> Template for T
§fn build_template(
&self,
_context: &mut TemplateContext<'_, '_>,
) -> Result<<T as Template>::Output, BevyError>
fn build_template( &self, _context: &mut TemplateContext<'_, '_>, ) -> Result<<T as Template>::Output, BevyError>
entity context to produce a [Template::Output].§fn clone_template(&self) -> T
fn clone_template(&self) -> T
Clone.