mirror of
https://github.com/ddnet/ddnet.git
synced 2024-11-10 01:58:19 +00:00
Make language scripts callable from anywhere
This commit is contained in:
parent
3a8cc43e13
commit
945ea1cf28
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/env python3
|
||||
import twlang
|
||||
import os
|
||||
import sys
|
||||
import twlang
|
||||
|
||||
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])) + "/../..")
|
||||
|
||||
if len(sys.argv) > 1:
|
||||
langs = sys.argv[1:]
|
||||
|
|
|
@ -1,7 +1,10 @@
|
|||
#!/usr/bin/env python3
|
||||
import twlang
|
||||
import os
|
||||
import sys
|
||||
|
||||
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])) + "/../..")
|
||||
|
||||
if len(sys.argv) < 3:
|
||||
print("usage: python copy_fix.py <infile> <outfile> [--delete-unused] [--append-missing] [--delete-empty]")
|
||||
sys.exit()
|
||||
|
|
|
@ -1,6 +1,9 @@
|
|||
#!/usr/bin/env python3
|
||||
import twlang
|
||||
import os
|
||||
import sys
|
||||
import twlang
|
||||
|
||||
os.chdir(os.path.dirname(os.path.realpath(sys.argv[0])) + "/../..")
|
||||
|
||||
if len(sys.argv) < 2:
|
||||
print("usage: python find_unchanged.py <file>")
|
||||
|
|
|
@ -47,20 +47,18 @@ def check_file(path):
|
|||
|
||||
|
||||
def check_folder(path):
|
||||
files = os.listdir(path)
|
||||
englishlist = set()
|
||||
for path, _, files in os.walk(path):
|
||||
for f in files:
|
||||
newpath = os.path.join(path, f)
|
||||
if os.path.isdir(newpath):
|
||||
englishlist.update(check_folder(newpath))
|
||||
elif os.path.isfile(newpath):
|
||||
englishlist.update(check_file(newpath))
|
||||
if not any(f.endswith(x) for x in ".cpp .c .h".split()):
|
||||
continue
|
||||
englishlist.update(check_file(os.path.join(path, f)))
|
||||
return englishlist
|
||||
|
||||
|
||||
def languages():
|
||||
index = decode(open("../../data/languages/index.txt"), 2)
|
||||
langs = {"../"+key+".txt" : [key]+elements for key, elements in index.items()}
|
||||
index = decode(open("data/languages/index.txt"), 2)
|
||||
langs = {"data/languages/"+key+".txt" : [key]+elements for key, elements in index.items()}
|
||||
return langs
|
||||
|
||||
|
||||
|
@ -70,5 +68,5 @@ def translations(filename):
|
|||
|
||||
|
||||
def localizes():
|
||||
englishlist = list(check_folder("../../src"))
|
||||
englishlist = list(check_folder("src"))
|
||||
return englishlist
|
||||
|
|
Loading…
Reference in a new issue