Skip to content

Commit

Permalink
Merge pull request #2617 from tupaschoal/unify-scripts
Browse files Browse the repository at this point in the history
translation_check: Report repeated and unexpected keys
  • Loading branch information
tupaschoal authored Apr 28, 2023
2 parents c514494 + d94f57b commit 0d732cb
Show file tree
Hide file tree
Showing 14 changed files with 7 additions and 639 deletions.
9 changes: 7 additions & 2 deletions .github/workflows/translation_check.py
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@
'STR_6360']

languages = []

STR_NUMBER_RE = re.compile("STR_\d+")

def get_arg_parser():
""" Command line arguments """
Expand Down Expand Up @@ -105,8 +105,13 @@ def file_to_dict(filename):
key = split[0].strip()
if key in SPECIAL_KEYS:
key = previous_group_name + key
elif not STR_NUMBER_RE.match(key):
print(f'[{os.path.basename(filename)}]: {key} does not match STR_XXXX pattern')
value = ':'.join(split[1:]).strip()
translations[key] = value
if key in translations:
print(f'[{os.path.basename(filename)}]: {key} is repeated')
else:
translations[key] = value

return translations

Expand Down
5 changes: 0 additions & 5 deletions appveyor.yml

This file was deleted.

88 changes: 0 additions & 88 deletions check.ps1

This file was deleted.

50 changes: 0 additions & 50 deletions langcheck/Extensions/StringReaderExtensions.cs

This file was deleted.

8 changes: 0 additions & 8 deletions langcheck/IErrorLogger.cs

This file was deleted.

37 changes: 0 additions & 37 deletions langcheck/LanguageEntry.cs

This file was deleted.

9 changes: 0 additions & 9 deletions langcheck/LanguageEntryType.cs

This file was deleted.

49 changes: 0 additions & 49 deletions langcheck/LanguagePack.cs

This file was deleted.

Loading

0 comments on commit 0d732cb

Please sign in to comment.