This repository was archived by the owner on Jun 23, 2025. It is now read-only.
File tree Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Expand file tree Collapse file tree 1 file changed +8
-9
lines changed Original file line number Diff line number Diff line change @@ -13,20 +13,19 @@ def merge(translationdirectory: str, language: str) -> None:
13
13
directory = Path (dirpath )
14
14
parent = directory .name
15
15
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
17
18
if potential_target .exists ():
18
19
merge_po (potential_target , source )
20
+ elif (
21
+ potential_target := old_translations_directory / f"{ parent } .po"
22
+ ).exists ():
23
+ merge_po (potential_target , source )
19
24
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 } " )
27
26
28
27
29
- def merge_po (potential_target , source ) :
28
+ def merge_po (potential_target : Path , source : Path ) -> None :
30
29
call (
31
30
f"msgcat --use-first { source } { potential_target } -o tmpsum.po" ,
32
31
shell = True ,
You can’t perform that action at this time.
0 commit comments