diff options
| author | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-05-26 17:56:53 +0000 |
|---|---|---|
| committer | Janito Vaqueiro Ferreira Filho <janito@mullvad.net> | 2021-05-28 11:54:59 +0000 |
| commit | 2d9110da8eb9221c3b2caa3b520a81ba21673ae9 (patch) | |
| tree | 20061333a68584ce510c7e6a0d63db53e19ea46f | |
| parent | 4ef323a9838d057ff1c03375066a2c3dc1c183a4 (diff) | |
| download | mullvadvpn-2d9110da8eb9221c3b2caa3b520a81ba21673ae9.tar.xz mullvadvpn-2d9110da8eb9221c3b2caa3b520a81ba21673ae9.zip | |
Add `Messages::starting_with` constructor
Helper constructor to create the instance with an initial entry.
| -rw-r--r-- | android/translations-converter/src/gettext/messages.rs | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/android/translations-converter/src/gettext/messages.rs b/android/translations-converter/src/gettext/messages.rs index 59bc6ed711..1cd8ca9e2f 100644 --- a/android/translations-converter/src/gettext/messages.rs +++ b/android/translations-converter/src/gettext/messages.rs @@ -155,6 +155,21 @@ impl Messages { entries: Vec::new(), } } + + /// Create a messages list with a single non-plural entry. + /// + /// The plural form for the messages is left unconfigured. + pub fn starting_with(id: MsgString, msg_str: MsgString) -> Self { + let first_entry = MsgEntry { + id, + value: MsgValue::Invariant(msg_str), + }; + + Messages { + plural_form: None, + entries: vec![first_entry], + } + } } impl IntoIterator for Messages { |
