aboutsummaryrefslogtreecommitdiff
path: root/template.py
diff options
context:
space:
mode:
Diffstat (limited to 'template.py')
-rwxr-xr-xtemplate.py8
1 files changed, 8 insertions, 0 deletions
diff --git a/template.py b/template.py
index 450bd3db..e0e3dacc 100755
--- a/template.py
+++ b/template.py
@@ -40,6 +40,13 @@ for in_file in glob.glob("*.j2"):
40 def url_localized(filename): 40 def url_localized(filename):
41 return "../" + locale + "/" + filename 41 return "../" + locale + "/" + filename
42 42
43 def svg_localized(filename):
44 lf = filename + "." + locale + ".svg"
45 if "en" == locale or not os.path.isfile (lf):
46 return "../" + filename + ".svg"
47 else:
48 return "../" + lf
49
43 def url(x): 50 def url(x):
44 # TODO: look at the app root environment variable 51 # TODO: look at the app root environment variable
45 # TODO: check if file exists 52 # TODO: check if file exists
@@ -63,6 +70,7 @@ for in_file in glob.glob("*.j2"):
63 url=url, 70 url=url,
64 self_localized=self_localized, 71 self_localized=self_localized,
65 url_localized=url_localized, 72 url_localized=url_localized,
73 svg_localized=svg_localized,
66 filename=name + "." + ext) 74 filename=name + "." + ext)
67 out_name = "./" + locale + "/" + in_file.rstrip(".j2") 75 out_name = "./" + locale + "/" + in_file.rstrip(".j2")
68 os.makedirs("./" + locale, exist_ok=True) 76 os.makedirs("./" + locale, exist_ok=True)