summaryrefslogtreecommitdiffhomepage
path: root/gui/scripts
diff options
context:
space:
mode:
authorMarkus Pettersson <markus.pettersson@mullvad.net>2024-10-23 09:21:34 +0200
committerMarkus Pettersson <markus.pettersson@mullvad.net>2024-10-24 13:45:14 +0200
commit0f75bf0702c5c6e6bb818896b6e0b429844f353c (patch)
treee1f9954dfa886c4b9f13e89a43e2caeabe37dd19 /gui/scripts
parent35525e0b591629eb3e790e195454dd717918382f (diff)
downloadmullvadvpn-0f75bf0702c5c6e6bb818896b6e0b429844f353c.tar.xz
mullvadvpn-0f75bf0702c5c6e6bb818896b6e0b429844f353c.zip
Add support for ignoring translated strings from `verify-translations`
Diffstat (limited to 'gui/scripts')
-rw-r--r--gui/scripts/verify-translations-format.ts9
1 files changed, 9 insertions, 0 deletions
diff --git a/gui/scripts/verify-translations-format.ts b/gui/scripts/verify-translations-format.ts
index eaba3ee7b7..3fad6c300a 100644
--- a/gui/scripts/verify-translations-format.ts
+++ b/gui/scripts/verify-translations-format.ts
@@ -7,6 +7,11 @@ const LOCALES_DIR = path.join('..', 'locales');
const ALLOWED_TAGS = ['b', 'br'];
const ALLOWED_VOID_TAGS = ['br'];
+// Make sure to report these strings to crowdin. View this as a temporary escape
+// hatch, not a permanent solution.
+const IGNORED_STRINGS: Set<string> = new Set([
+]);
+
function getLocales(): string[] {
const localesContent = fs.readdirSync(LOCALES_DIR);
const localeDirectories = localesContent.filter((item) =>
@@ -119,6 +124,10 @@ function checkHtmlTags(translation: GetTextTranslation): boolean {
}
function checkTranslation(translation: GetTextTranslation): boolean {
+ // Ignore some strings
+ if (translation.msgstr.every((str) => IGNORED_STRINGS.has(str))) {
+ return true;
+ }
return checkFormatSpecifiers(translation) && checkHtmlTags(translation);
}