Skip to content
This repository was archived by the owner on Jun 23, 2025. It is now read-only.

Commit 7ec631c

Browse files
author
Maciej Olko
committed
Flatten elifs
1 parent 83bb281 commit 7ec631c

File tree

1 file changed

+8
-9
lines changed

1 file changed

+8
-9
lines changed

merge.py

Lines changed: 8 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,19 @@ def merge(translationdirectory: str, language: str) -> None:
1313
directory = Path(dirpath)
1414
parent = directory.name
1515
source = directory / filename
16-
potential_target = Path("pos/locale/python") / language / source.name
16+
old_translations_directory = Path("pos/locale/python") / language
17+
potential_target = old_translations_directory / source.name
1718
if potential_target.exists():
1819
merge_po(potential_target, source)
20+
elif (
21+
potential_target := old_translations_directory / f"{parent}.po"
22+
).exists():
23+
merge_po(potential_target, source)
1924
else:
20-
potential_target = (
21-
Path("pos/locale/python") / language / f"{parent}.po"
22-
)
23-
if potential_target.exists():
24-
merge_po(potential_target, source)
25-
else:
26-
print(f"no match in 3.1 translations for {source}")
25+
print(f"no match in 3.1 translations for {source}")
2726

2827

29-
def merge_po(potential_target, source):
28+
def merge_po(potential_target: Path, source: Path) -> None:
3029
call(
3130
f"msgcat --use-first {source} {potential_target} -o tmpsum.po",
3231
shell=True,

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy