mirror of
https://github.com/MarshalX/telegram-crawler.git
synced 2024-10-23 17:47:21 +02:00
exclude categories of translations from the file with all translations keys
This commit is contained in:
parent
7178955c57
commit
83cbc35d6a
1 changed files with 4 additions and 6 deletions
|
@ -666,19 +666,17 @@ async def _collect_and_track_all_translation_keys():
|
||||||
if not file.endswith(file_format) or file == output_filename:
|
if not file.endswith(file_format) or file == output_filename:
|
||||||
continue
|
continue
|
||||||
|
|
||||||
async with aiofiles.open(os.path.join(root, file)) as f:
|
async with aiofiles.open(os.path.join(root, file), encoding='utf-8') as f:
|
||||||
content = json.loads(await f.read())
|
content = json.loads(await f.read())
|
||||||
|
|
||||||
client = root[root.index(start_folder) + len(start_folder):]
|
client = root[root.index(start_folder) + len(start_folder):]
|
||||||
category = file.replace(file_format, '')
|
|
||||||
|
|
||||||
if client not in translations:
|
if client not in translations:
|
||||||
translations[client] = dict()
|
translations[client] = list()
|
||||||
|
|
||||||
translations[client][category] = sorted(content.keys())
|
translations[client].extend(content.keys())
|
||||||
|
|
||||||
for client in translations.keys():
|
for client in translations.keys():
|
||||||
translations[client] = dict(sorted(translations[client].items()))
|
translations[client] = sorted(translations[client])
|
||||||
|
|
||||||
translations = dict(sorted(translations.items()))
|
translations = dict(sorted(translations.items()))
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue