pub enum Problem {
Invalid {
locale: String,
line: usize,
message: String,
},
Missing {
locale: String,
key: String,
},
}Expand description
A problem in the locale files, found by check.
Displays as one line pointing at the file, as ocre i18n missing prints
it: locales/fr.yml: missing posts.title.
§Examples
use ocre::i18n::Problem;
let missing = Problem::Missing { locale: "fr".into(), key: "posts.title".into() };
assert_eq!(missing.to_string(), "locales/fr.yml: missing posts.title");
let invalid = Problem::Invalid { locale: "fr".into(), line: 3, message: "expected `key: value`".into() };
assert_eq!(invalid.to_string(), "locales/fr.yml:3: expected `key: value`");Variants§
Invalid
The file is not valid locale YAML; nothing in it is used.
Fields
Missing
A key of the default locale (or a plural form this language needs)
is missing from locale.
Trait Implementations§
impl StructuralPartialEq for Problem
Auto Trait Implementations§
impl Freeze for Problem
impl RefUnwindSafe for Problem
impl Send for Problem
impl Sync for Problem
impl Unpin for Problem
impl UnsafeUnpin for Problem
impl UnwindSafe for Problem
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
Mutably borrows from an owned value. Read more