Skip to content

Commit e722116

Browse files
committed
Use locale format for Sphinx
1 parent 0761872 commit e722116

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

build_warnings.py

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,12 @@
55

66

77
def number(clones_dir: str, repo: str, language_code: str) -> int:
8-
locale_dir = Path(clones_dir, f'cpython/Doc/locales/{language_code}/LC_MESSAGES')
8+
language_part, *locale = language_code.split('-')
9+
if locale:
10+
lang_with_locale = f'{language_part}_{locale[0].upper()}'
11+
else:
12+
lang_with_locale = language_part
13+
locale_dir = Path(clones_dir, f'cpython/Doc/locales/{lang_with_locale}/LC_MESSAGES')
914
locale_dir.mkdir(parents=True)
1015
for po_file in Path(clones_dir, repo).rglob('*.po'):
1116
relative_path = po_file.relative_to(Path(clones_dir, repo))

0 commit comments

Comments
 (0)