diff options
Diffstat (limited to 'android')
| -rw-r--r-- | android/translations-converter/src/gettext.rs | 17 |
1 files changed, 17 insertions, 0 deletions
diff --git a/android/translations-converter/src/gettext.rs b/android/translations-converter/src/gettext.rs index a7636eec65..f2ba43125f 100644 --- a/android/translations-converter/src/gettext.rs +++ b/android/translations-converter/src/gettext.rs @@ -46,6 +46,23 @@ pub enum MsgValue { }, } +/// A helper macro to match a string to various prefix and suffix combinations. +macro_rules! match_str { + ( + ( $string:expr ) + $( [$start:expr, $middle:ident, $end:expr] => $body:tt )* + _ => $else:expr $(,)* + ) => { + $( + if let Some($middle) = parse_line($string, $start, $end) { + $body + } else + )* { + $else + } + }; +} + impl Translation { /// Load message entries from a gettext translation file. /// |
