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

Commit 88750c5

Browse files
author
Maciej Olko
committed
Add converting script
1 parent ee1b5c3 commit 88750c5

File tree

1 file changed

+25
-0
lines changed

1 file changed

+25
-0
lines changed

pos2tmxes.py

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
#!/usr/bin/env python
2+
from os import walk
3+
from pathlib import Path
4+
from subprocess import call
5+
6+
7+
def convert():
8+
for dirpath, dirnames, filenames in walk('pos/locale/python'):
9+
print(dirpath, dirnames, filenames)
10+
for filename in filenames:
11+
if filename.endswith('.po'):
12+
directory = Path(dirpath)
13+
language = directory.name
14+
source = directory / filename
15+
target_directory = Path('tmxes') / language
16+
target = target_directory / (source.stem + '.tmx')
17+
target_directory.mkdir(parents=True, exist_ok=True)
18+
call(
19+
f'po2tmx --language {language} {source} {target}',
20+
shell=True
21+
)
22+
23+
24+
if __name__ == '__main__':
25+
convert()

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