Skip to content

Commit

Permalink
Temporarily disable incomplete translations or unsupported code
Browse files Browse the repository at this point in the history
Refs: #22
  • Loading branch information
orontee committed Dec 30, 2023
1 parent b74286a commit c14ae76
Showing 1 changed file with 18 additions and 1 deletion.
19 changes: 18 additions & 1 deletion scripts/generate_l10n_cc.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,28 @@ def extract_language_from(file_path: Path) -> str:
return found.group(1)


def identify_supported_languages(po_files: Path) -> List[str]:
linguas_file = po_files / "LINGUAS"
with open(linguas_file) as fh:
return [lang.strip() for lang in fh.readlines()]


def load_translations(po_files: Path) -> Dict[str, Dict[str, str]]:
translations: Dict[str, Dict[str, str]] = {}

supported_languages = identify_supported_languages(po_files)

for po_file in po_files.glob("*.po"):
language = extract_language_from(po_file)
try:
language = extract_language_from(po_file)
except RuntimeError as error:
print(str(error))
continue

if language not in supported_languages:
print(f"Skipping translations for language {language!r}")
continue

print(f"Loading translations for language {language!r}")

language_translations: Dict[str, str] = {}
Expand Down

0 comments on commit c14ae76

Please sign in to comment.