diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-05-21 17:42:54 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-05-28 11:54:59 +0000 |
| commit | befcf743bfae2f520c2b1ce0d299ec7d4e99cf1b (patch) | |
| tree | e59b4e1035b6d12940fb9ee720e86dc32e692c01 /android | |
| parent | 2881f3eb28b24534a016dddf7fa21dce0a1fffb3 (diff) | |
| download | mullvadvpn-befcf743bfae2f520c2b1ce0d299ec7d4e99cf1b.tar.xz mullvadvpn-befcf743bfae2f520c2b1ce0d299ec7d4e99cf1b.zip | |
Rename `Translations` into `Messages`
Because it's also used for the messages template file.
Diffstat (limited to 'android')
| -rw-r--r-- | android/translations-converter/src/gettext/mod.rs | 6 | ||||
| -rw-r--r-- | android/translations-converter/src/main.rs | 6 |
2 files changed, 6 insertions, 6 deletions
diff --git a/android/translations-converter/src/gettext/mod.rs b/android/translations-converter/src/gettext/mod.rs index 244401009a..c76ded8711 100644 --- a/android/translations-converter/src/gettext/mod.rs +++ b/android/translations-converter/src/gettext/mod.rs @@ -15,7 +15,7 @@ pub use self::{msg_string::MsgString, plural_form::PluralForm}; /// A parsed gettext translation file. #[derive(Clone, Debug)] -pub struct Translation { +pub struct Messages { pub plural_form: Option<PluralForm>, entries: Vec<MsgEntry>, } @@ -37,7 +37,7 @@ pub enum MsgValue { }, } -impl Translation { +impl Messages { /// Load message entries from a gettext translation file. /// /// The only metadata that is parsed from the file is the "Plural-Form" header. It is assumed @@ -155,7 +155,7 @@ impl Translation { } } -impl IntoIterator for Translation { +impl IntoIterator for Messages { type Item = MsgEntry; type IntoIter = std::vec::IntoIter<Self::Item>; diff --git a/android/translations-converter/src/main.rs b/android/translations-converter/src/main.rs index d11320b070..c985061c32 100644 --- a/android/translations-converter/src/main.rs +++ b/android/translations-converter/src/main.rs @@ -103,14 +103,14 @@ fn main() { known_urls.clone(), known_strings.clone(), known_plurals.clone(), - gettext::Translation::from_file(&locale_file), + gettext::Messages::from_file(&locale_file), destination_dir.join("strings.xml"), destination_dir.join("plurals.xml"), ); } let template_path = locale_dir.join("messages.pot"); - let template = gettext::Translation::from_file(&template_path); + let template = gettext::Messages::from_file(&template_path); let mut missing_translations = known_strings; let mut missing_plurals: HashMap<_, _> = known_plurals; @@ -228,7 +228,7 @@ fn generate_translations( known_urls: HashMap<String, String>, mut known_strings: HashMap<String, String>, mut known_plurals: HashMap<String, String>, - translations: gettext::Translation, + translations: gettext::Messages, strings_output_path: impl AsRef<Path>, plurals_output_path: impl AsRef<Path>, ) { |
