Remove flags in locale CI check

This commit is contained in:
Patrick Nicolas committed 2025-10-13 23:13:08 +02:00
1 parent e3f35aad54
commit 56f32f4ae6
2 files changed
+2 -22

No files matched your search

-1
View File
@@ -10,7 +10,6 @@ If using Lokalize, make sure to erase the "Default mailing list" in the settings
# Adding a new language
* Run `tools/update_messages.sh LANG` where LANG is the 2 letter [ISO 639](https://en.wikipedia.org/wiki/List_of_ISO_639_language_codes) language code, this will create files in the `locale` directory for the new language. Fill in the fields, `git add` the files, commit and file a pull request.
* (optional) Edit the `tools/check_po.py`, add to the `countries` mapping a value with the language code on the left and the [ISO 3166-1](https://en.wikipedia.org/wiki/ISO_3166-1) code of a flag on the right. The flag will only be used for continuous integration messages.
# Editing existing translations
+2 -21
View File
@@ -16,25 +16,6 @@ def list_files(base: str, exts: str|list[str]):
if f.endswith(ext):
yield os.path.join(root, f)
def flag(lang: str):
# Map language code to a country flag
countries = {
'es': 'es',
'fr': 'fr',
'it': 'it',
'ja': 'jp',
'zh_TW': 'tw',
'pt_BR': 'br',
'ru': 'ru'
}
country = countries.get(lang, lang)
res = ''
for i in country.upper():
res += chr(ord(i) + ord('🇦') - ord('A'))
return res
ISSUE_LABEL="localisation"
ISSUE_TITLE="[{lang}] Missing translations"
@@ -110,11 +91,11 @@ if __name__ == "__main__":
if not i.obsolete:
if not i.msgid in entries:
missing = missing + 1
print(f"::notice file={po}::{flag(lang)} Translation for {repr(i.msgid)} is missing")
print(f"::notice file={po}::{lang} translation for {repr(i.msgid)} is missing")
lang_issues += missing
if missing > 0:
print(f"::warning file={po}::{flag(lang)} {missing} translations missing")
print(f"::warning file={po}::{lang} {missing} translations missing")
if args.manage_issues:
issues = [i for i in repo.get_issues(state="all", labels = [ISSUE_LABEL]) if i.title == ISSUE_TITLE.format(lang=lang)]