pub enum MultilingualMode {
Primary,
Transliterated,
Translated,
Combined,
Pattern(Vec<MultilingualSegment>),
}Expand description
Rendering modes for multilingual content.
Variants§
Primary
Use original script.
Transliterated
Use transliteration.
Translated
Use translation matching style locale.
Combined
Combine transliteration and translation: romanized [translated].
Equivalent to Pattern([transliterated, {translated, brackets}]).
Pattern(Vec<MultilingualSegment>)
Ordered sequence of views joined by spaces.
Use this when a style requires more than two views — e.g. Chicago’s
romanized original-script [translated] or MLA’s original-script [translated].
Each segment specifies a view and an optional bracket wrap.
Segments whose resolved text is empty or identical to the previous
segment are silently skipped (dedup).
YAML form:
title-mode:
pattern:
- view: transliterated
- view: original-script
- view: translated
wrap: bracketsTrait Implementations§
Source§impl Clone for MultilingualMode
impl Clone for MultilingualMode
Source§fn clone(&self) -> MultilingualMode
fn clone(&self) -> MultilingualMode
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 MultilingualMode
impl Debug for MultilingualMode
Source§impl<'de> Deserialize<'de> for MultilingualMode
Custom deserializer for MultilingualMode.
impl<'de> Deserialize<'de> for MultilingualMode
Custom deserializer for MultilingualMode.
Unit variants are accepted as plain strings ("primary", "transliterated", etc.).
The Pattern variant is accepted as a single-key map {pattern: [...]}.
A hand-written deserialize_any visitor is used instead of serde’s derived
deserialize_enum because serde_yaml cannot pass enum-variant input through
an outer #[serde(untagged)] wrapper — the standard derive would fail with
“untagged and internally tagged enums do not support enum input” when a
serialized Pattern value is round-tripped through crate::presets::MultilingualConfigEntry.
Source§fn deserialize<D>(
deserializer: D,
) -> Result<MultilingualMode, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
fn deserialize<D>(
deserializer: D,
) -> Result<MultilingualMode, <D as Deserializer<'de>>::Error>where
D: Deserializer<'de>,
Source§impl PartialEq for MultilingualMode
impl PartialEq for MultilingualMode
Source§fn eq(&self, other: &MultilingualMode) -> bool
fn eq(&self, other: &MultilingualMode) -> bool
self and other values to be equal, and is used by ==.