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

Commit 83bb281

Browse files
author
Maciej Olko
committed
Parametrise with language, rename variable
1 parent 80be564 commit 83bb281

File tree

1 file changed

+8
-5
lines changed

1 file changed

+8
-5
lines changed

merge.py

Lines changed: 8 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -6,18 +6,20 @@
66
from subprocess import call
77

88

9-
def merge(translationdirectory: str) -> None:
9+
def merge(translationdirectory: str, language: str) -> None:
1010
for dirpath, dirnames, filenames in walk(Path(translationdirectory)):
1111
for filename in filenames:
1212
if filename.endswith(".po"):
1313
directory = Path(dirpath)
14-
set = directory.name
14+
parent = directory.name
1515
source = directory / filename
16-
potential_target = Path("pos/locale/python/pl") / source.name
16+
potential_target = Path("pos/locale/python") / language / source.name
1717
if potential_target.exists():
1818
merge_po(potential_target, source)
1919
else:
20-
potential_target = Path("pos/locale/python/pl") / f"{set}.po"
20+
potential_target = (
21+
Path("pos/locale/python") / language / f"{parent}.po"
22+
)
2123
if potential_target.exists():
2224
merge_po(potential_target, source)
2325
else:
@@ -52,6 +54,7 @@ def merge_po(potential_target, source):
5254
if __name__ == "__main__":
5355
parser = ArgumentParser()
5456
parser.add_argument('translationdirectory')
57+
parser.add_argument('language')
5558
args = parser.parse_args()
5659

57-
merge(args.translationdirectory)
60+
merge(args.translationdirectory, args.language)

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