aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndreas HABEGGER <andreas.habegger@bfh.ch>2023-11-19 22:37:03 +0100
committerAndreas HABEGGER <andreas.habegger@bfh.ch>2023-11-19 22:37:03 +0100
commit1d496cd5b009d8d420176b00831c4bbd717a4a09 (patch)
tree1741deb6c67426c4f260896f0a3513f4f429d47d
parent12caf5a526eb0f72627f6849ba96895dd505ec18 (diff)
downloadwww_shared-1d496cd5b009d8d420176b00831c4bbd717a4a09.tar.gz
www_shared-1d496cd5b009d8d420176b00831c4bbd717a4a09.zip
FC: YAML multifile read for translations; Added global variable to configure properties file
-rwxr-xr-xlist-languages16
1 files changed, 13 insertions, 3 deletions
diff --git a/list-languages b/list-languages
index 9df48ac..c1379d2 100755
--- a/list-languages
+++ b/list-languages
@@ -1,8 +1,18 @@
1#!/usr/bin/env python3 1#!/usr/bin/env python3
2 2
3from ruamel.yaml import YAML
4from pathlib import Path 3from pathlib import Path
4from ruamel.yaml import YAML
5
6PROPERTIES_YML = "properties.yml"
7
8# NOTE : read-in properties.yml and afterwards all *.yml in properties.d
9properties = {}
5yaml = YAML(typ="safe") 10yaml = YAML(typ="safe")
6config = yaml.load(Path("www.yml")) 11yaml.preserve_quotes = True
7langs = config["langs_full"] 12properties.update(yaml.load(Path(PROPERTIES_YML)))
13properties_dir = PROPERTIES_YML.removesuffix('.yml') + '.d'
14for filepath in Path(properties_dir).glob('*.yml'):
15 properties.update(yaml.load(filepath))
16
17langs = properties["langs_full"]
8print(" ".join(langs)) 18print(" ".join(langs))