Skip to content

Commit 5d6f171

Browse files
committed
fix typos, improve comments
1 parent 694ef9b commit 5d6f171

3 files changed

Lines changed: 59 additions & 49 deletions

File tree

Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
"""
2+
Dictionary of fields that should not appear in translation check warnings
3+
per each language
4+
5+
each maintainer kindly PR's STR_nnnn he has checked and found being reported
6+
incorectly
7+
"""
8+
9+
SUPPRESS_WARNING = dict()
10+
"""
11+
This gets imported in translation_check.py, which checks it against all
12+
languages present in repo.
13+
14+
Please note: Failing to add new language in this dictionary will cause
15+
KeyError being raised in translation_check.py and therefore it
16+
will break GitHub Action job
17+
18+
Example of population:
19+
SUPPRESS_WARNING['qq-JJ'] = ['STR_0123', 'STR_5678', 'STR_8900']
20+
21+
2996 - 3009 are COLOR-ABC strings used in Banner window and were pre-added
22+
for japanese and ukrainian which use different scripts (hiragana and cyrillic)
23+
"""
24+
25+
SUPPRESS_WARNING['ar-EG'] = []
26+
SUPPRESS_WARNING['ca-ES'] = []
27+
SUPPRESS_WARNING['cs-CZ'] = []
28+
SUPPRESS_WARNING['da-DK'] = []
29+
SUPPRESS_WARNING['de-DE'] = []
30+
SUPPRESS_WARNING['en-US'] = []
31+
SUPPRESS_WARNING['eo-ZZ'] = []
32+
SUPPRESS_WARNING['es-ES'] = []
33+
SUPPRESS_WARNING['fi-FI'] = []
34+
SUPPRESS_WARNING['fr-CA'] = []
35+
SUPPRESS_WARNING['fr-FR'] = []
36+
SUPPRESS_WARNING['gl-ES'] = []
37+
SUPPRESS_WARNING['hu-HU'] = []
38+
SUPPRESS_WARNING['it-IT'] = []
39+
SUPPRESS_WARNING['ja-JP'] = ['STR_2996', 'STR_2997', 'STR_2998', 'STR_2999',
40+
'STR_3000', 'STR_3001', 'STR_3002', 'STR_3003',
41+
'STR_3004', 'STR_3005', 'STR_3006', 'STR_3007',
42+
'STR_3008', 'STR_3009']
43+
SUPPRESS_WARNING['ko-KR'] = []
44+
SUPPRESS_WARNING['nb-NO'] = []
45+
SUPPRESS_WARNING['nl-NL'] = []
46+
SUPPRESS_WARNING['pl-PL'] = []
47+
SUPPRESS_WARNING['pt-BR'] = []
48+
SUPPRESS_WARNING['ru-RU'] = []
49+
SUPPRESS_WARNING['sv-SE'] = []
50+
SUPPRESS_WARNING['tr-TR'] = []
51+
SUPPRESS_WARNING['uk-UA'] = ['STR_2996', 'STR_2997', 'STR_2998', 'STR_2999',
52+
'STR_3000', 'STR_3001', 'STR_3002', 'STR_3003',
53+
'STR_3004', 'STR_3005', 'STR_3006', 'STR_3007',
54+
'STR_3008', 'STR_3009']
55+
SUPPRESS_WARNING['vi-VN'] = []
56+
SUPPRESS_WARNING['zh-CN'] = []
57+
SUPPRESS_WARNING['zh-TW'] = []

.github/workflows/supress_warning.py

Lines changed: 0 additions & 47 deletions
This file was deleted.

.github/workflows/translation_check.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@
99
import os
1010
import re
1111

12-
from supress_warning import SUPRESS_WARNING
12+
from suppress_warning import SUPPRESS_WARNING
1313

1414
MASTER_LANG_DIR = "master/data/language"
1515
PR_LANG_DIR = "pr/data/language"
@@ -130,7 +130,7 @@ def count_translations(dir_with_translations, print_info, reference_file):
130130
}
131131

132132
for base_string in en_gb:
133-
if base_string in KEYS_TO_IGNORE and base_string not in SUPRESS_WARNING[lang]:
133+
if base_string in KEYS_TO_IGNORE and base_string not in SUPPRESS_WARNING[lang]:
134134
if base_string in translations and en_gb[base_string] != translations[base_string]:
135135
messages['unexpected'].append(base_string)
136136
elif base_string not in translations:

0 commit comments

Comments
 (0)