From ae9ed982f7a69eadb40b424b73e7ba49e590cd11 Mon Sep 17 00:00:00 2001 From: metamuffin Date: Sat, 12 Oct 2024 13:11:38 +0200 Subject: use locales from dist-extra --- dist-extra | 1 + makefile | 4 ++-- readme.md | 6 +++--- translate.py | 2 +- 4 files changed, 7 insertions(+), 6 deletions(-) create mode 160000 dist-extra diff --git a/dist-extra b/dist-extra new file mode 160000 index 0000000..e5aa509 --- /dev/null +++ b/dist-extra @@ -0,0 +1 @@ +Subproject commit e5aa509069e0193e98ba0b5dec06ea7aa9cb7d59 diff --git a/makefile b/makefile index 2fcf616..adbb9bc 100644 --- a/makefile +++ b/makefile @@ -3,7 +3,7 @@ noop = space = $(noop) $(noop) comma = , -langs = $(patsubst main/locale/%.ini,%,$(wildcard main/locale/*.ini)) +langs = $(patsubst dist-extra/locale/%.ini,%,$(wildcard dist-extra/locale/*.ini)) s_langs = $(subst $(space),$(comma),$(langs)) out = $(shell echo index.{$(s_langs)}.html) index.html @@ -13,7 +13,7 @@ all: $(out) clean: rm -f $(out) -index.%.html: main/locale/%.ini main/locale/en.ini +index.%.html: dist-extra/locale/%.ini dist-extra/locale/en.ini python translate.py $(*) index.html: index.en.html cp $< $@ diff --git a/readme.md b/readme.md index 0820b28..f48c313 100644 --- a/readme.md +++ b/readme.md @@ -1,9 +1,9 @@ # Hurry Curry! Website The website is instantiated from `index_template.html` with the `translate.py` -python script. It uses the translation files from the main hurrycurry repository -at `main/locale/xx.ini`, so you should clone the main repo as `main`. Then just -`make` +python script. It uses the translation files from the hurrycurry-dist-extra +repository at `dist-extra/locale/xx.ini`, so you should clone the repo as +`dist-extra`. Then just `make` Finally one of the resulting files `index.xx.html` should be served respecting the browser locale. diff --git a/translate.py b/translate.py index c73a364..28c61c6 100644 --- a/translate.py +++ b/translate.py @@ -15,7 +15,7 @@ trmap = { '_lang': lang, } for l in ["en", lang]: - for line in open(f"main/locale/{l}.ini"): + for line in open(f"dist-extra/locale/{l}.ini"): line = line.strip() if line == "[hurrycurry]": continue if line == "": continue -- cgit v1.2.3-70-g09d2