diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-05-26 17:37:49 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-05-28 11:54:59 +0000 |
| commit | 5be3f7e9ad63081cce466b313b44840f80227c29 (patch) | |
| tree | bd1043bf200dea6a1a22e3a06df41d449779be84 /android | |
| parent | 1f189f91addf905cab01934b14ba2f7edbab6bdf (diff) | |
| download | mullvadvpn-5be3f7e9ad63081cce466b313b44840f80227c29.tar.xz mullvadvpn-5be3f7e9ad63081cce466b313b44840f80227c29.zip | |
Add `Messages::with_plural_formula` constructor
Helper method to parse a specified plural formula in order to create a
new empty `Messages` list with the plural form configured.
Diffstat (limited to 'android')
| -rw-r--r-- | android/translations-converter/src/gettext/messages.rs | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/android/translations-converter/src/gettext/messages.rs b/android/translations-converter/src/gettext/messages.rs index 2b2777f78c..59bc6ed711 100644 --- a/android/translations-converter/src/gettext/messages.rs +++ b/android/translations-converter/src/gettext/messages.rs @@ -147,6 +147,14 @@ impl Messages { plural_form, }) } + + /// Construct an empty messages list configured with the specified plural form. + pub fn with_plural_form(plural_form: PluralForm) -> Self { + Messages { + plural_form: Some(plural_form), + entries: Vec::new(), + } + } } impl IntoIterator for Messages { |
