bevy_fluent 0.5.0

Bevy plugin for localization using Fluent
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
/// To sentence case
pub trait ToSentenceCase: ToOwned {
    fn to_sentence_case(&self) -> Self::Owned;
}

impl ToSentenceCase for str {
    fn to_sentence_case(&self) -> Self::Owned {
        let mut chars = self.chars();
        chars
            .next()
            .map(char::to_uppercase)
            .into_iter()
            .flatten()
            .chain(chars)
            .collect()
    }
}