diff options
author | Florian Dold <florian@dold.me> | 2021-05-07 18:00:15 +0200 |
---|---|---|
committer | Florian Dold <florian@dold.me> | 2021-05-07 18:00:15 +0200 |
commit | dc1f9140f511f8843d6f9fc5d553f27e89ceb486 (patch) | |
tree | dcf2e8f2b4a038f5c84173da6f954edd095e93c7 | |
parent | 794129fc96ec67b4f6bb50f1b568c5877d2e4e75 (diff) | |
download | www_shared-dc1f9140f511f8843d6f9fc5d553f27e89ceb486.tar.gz www_shared-dc1f9140f511f8843d6f9fc5d553f27e89ceb486.zip |
better language listing from www.yml
-rwxr-xr-x | list-languages | 8 | ||||
-rwxr-xr-x | update-messages | 6 |
2 files changed, 9 insertions, 5 deletions
diff --git a/list-languages b/list-languages new file mode 100755 index 0000000..9df48ac --- /dev/null +++ b/list-languages | |||
@@ -0,0 +1,8 @@ | |||
1 | #!/usr/bin/env python3 | ||
2 | |||
3 | from ruamel.yaml import YAML | ||
4 | from pathlib import Path | ||
5 | yaml = YAML(typ="safe") | ||
6 | config = yaml.load(Path("www.yml")) | ||
7 | langs = config["langs_full"] | ||
8 | print(" ".join(langs)) | ||
diff --git a/update-messages b/update-messages index 8b0fea2..582481c 100755 --- a/update-messages +++ b/update-messages | |||
@@ -14,11 +14,7 @@ sitegen=$SCRIPTPATH | |||
14 | 14 | ||
15 | cd $root | 15 | cd $root |
16 | 16 | ||
17 | languages="" | 17 | languages=$($sitegen/list-languages) |
18 | |||
19 | for i in $( cd locale/; echo */); do | ||
20 | languages="$languages ${i%/}" | ||
21 | done | ||
22 | 18 | ||
23 | echo Using languages $languages | 19 | echo Using languages $languages |
24 | 20 | ||