summaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authorJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-05-20 13:27:57 +0000
committerJanito Vaqueiro Ferreira Filho <janito@mullvad.net>2021-05-21 13:23:25 +0000
commit0c336cd2ffd1e1ec10cced86d381b76204c2fae1 (patch)
tree4f0e7ec53803c0a5d5336f65ad1b653ba092d15e
parentda1fa41fe29a466de434e575cfbca9256037eb41 (diff)
downloadmullvadvpn-0c336cd2ffd1e1ec10cced86d381b76204c2fae1.tar.xz
mullvadvpn-0c336cd2ffd1e1ec10cced86d381b76204c2fae1.zip
Unescape single quotes in gettext messages
-rw-r--r--android/translations-converter/src/normalize.rs3
1 files changed, 3 insertions, 0 deletions
diff --git a/android/translations-converter/src/normalize.rs b/android/translations-converter/src/normalize.rs
index 9e8af385f4..83f144d874 100644
--- a/android/translations-converter/src/normalize.rs
+++ b/android/translations-converter/src/normalize.rs
@@ -39,6 +39,7 @@ mod gettext {
lazy_static! {
static ref APOSTROPHE_VARIATION: Regex = Regex::new("’").unwrap();
+ static ref ESCAPED_SINGLE_QUOTES: Regex = Regex::new(r"\\'").unwrap();
static ref ESCAPED_DOUBLE_QUOTES: Regex = Regex::new(r#"\\""#).unwrap();
static ref PARAMETERS: Regex = Regex::new(r"%\([^)]*\)").unwrap();
}
@@ -49,6 +50,8 @@ mod gettext {
let string = APOSTROPHE_VARIATION.replace_all(&*self, "'");
// Mark where parameters are positioned, removing the parameter name
let string = PARAMETERS.replace_all(&string, "%");
+ // Remove escaped single-quotes
+ let string = ESCAPED_SINGLE_QUOTES.replace_all(&string, r"'");
// Remove escaped double-quotes
let string = ESCAPED_DOUBLE_QUOTES.replace_all(&string, r#"""#);