Change storage of language list
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
Having each language as a separate file in a directory makes handling of the languages way easier.
This commit is contained in:
parent
53a0c4bcc4
commit
ec59668710
2
Makefile
2
Makefile
@ -68,7 +68,7 @@ $(SUBDIRS): .FORCE
|
||||
# otherwise. This symlinks make sure that phase 2 can easily use the right file
|
||||
# for each language, also as a prerequisite in the Makefile.
|
||||
|
||||
LANGUAGES := $(shell . build/languages.sh && echo `languages | cut -d\ -f1`)
|
||||
LANGUAGES := $(shell ls -xw0 global/languages)
|
||||
|
||||
TEXTS_LINKS := $(foreach lang,$(LANGUAGES),tools/.texts-$(lang).xml)
|
||||
|
||||
|
@ -1,41 +0,0 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
# lazy-ass include guard
|
||||
inc_languages=true
|
||||
|
||||
languages(){
|
||||
cat <<EOL
|
||||
ar العربيّة
|
||||
bg Български
|
||||
bs Bosanski
|
||||
ca Català
|
||||
cs Česky
|
||||
da Dansk
|
||||
de Deutsch
|
||||
el Ελληνικά
|
||||
en English
|
||||
es Español
|
||||
et Eesti
|
||||
fi Suomi
|
||||
fr Français
|
||||
hr Hrvatski
|
||||
hu Magyar
|
||||
it Italiano
|
||||
mk Mакедонски
|
||||
nb Norsk (bokmål)
|
||||
nl Nederlands
|
||||
nn Norsk (nynorsk)
|
||||
pl Polski
|
||||
pt Português
|
||||
ro Română
|
||||
ru Русский
|
||||
sk Slovenčina
|
||||
sl Slovenščina
|
||||
sq Shqip
|
||||
sr Српски
|
||||
sv Svenska
|
||||
tr Türkçe
|
||||
uk Українська
|
||||
zh 漢語
|
||||
EOL
|
||||
}
|
@ -1,13 +1,12 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
inc_makerules=true
|
||||
[ -z "$inc_languages" ] && . "$basedir/build/languages.sh"
|
||||
|
||||
tree_maker(){
|
||||
# walk through file tree and issue Make rules according to file type
|
||||
input="$(realpath "$1")"
|
||||
output="$(realpath "$2")"
|
||||
languages=$(echo $(languages | cut -d\ -f1))
|
||||
languages="$(ls -xw0 "${basedir}/global/languages")"
|
||||
|
||||
cat <<EOF
|
||||
# -----------------------------------------------------------------------------
|
||||
|
@ -1,7 +1,6 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
inc_scaffold=true
|
||||
[ -z "$inc_languages" ] && . "$basedir/build/languages.sh"
|
||||
|
||||
get_version(){
|
||||
version=$(xsltproc $basedir/build/xslt/get_version.xsl $1)
|
||||
@ -33,14 +32,11 @@ list_langs(){
|
||||
# the shortname (i.e. file path with file ending omitted)
|
||||
# output is readily formatted for inclusion
|
||||
# in xml stream
|
||||
shortname="$1"
|
||||
|
||||
langfilter=$(
|
||||
echo "$shortname".[a-z][a-z].xhtml \
|
||||
| sed -r 's;[^ ]+.([a-z]{2}).xhtml;\1;g;s; ;|;g'
|
||||
)
|
||||
languages | egrep "^($langfilter) " \
|
||||
| sed -r 's:^([a-z]{2}) (.+)$:<tr id="\1">\2</tr>:g'
|
||||
for file in "${1}".[a-z][a-z].xhtml; do
|
||||
language="${file: -8:2}"
|
||||
text="$(echo -n $(cat "${basedir}/global/languages/${language}"))"
|
||||
echo "<tr id=\"${language}\">${text}</tr>"
|
||||
done
|
||||
}
|
||||
|
||||
list_sources(){
|
||||
|
1
global/languages/ar
Normal file
1
global/languages/ar
Normal file
@ -0,0 +1 @@
|
||||
العربيّة
|
1
global/languages/bg
Normal file
1
global/languages/bg
Normal file
@ -0,0 +1 @@
|
||||
Български
|
1
global/languages/bs
Normal file
1
global/languages/bs
Normal file
@ -0,0 +1 @@
|
||||
Bosanski
|
1
global/languages/ca
Normal file
1
global/languages/ca
Normal file
@ -0,0 +1 @@
|
||||
Català
|
1
global/languages/cs
Normal file
1
global/languages/cs
Normal file
@ -0,0 +1 @@
|
||||
Česky
|
1
global/languages/da
Normal file
1
global/languages/da
Normal file
@ -0,0 +1 @@
|
||||
Dansk
|
1
global/languages/de
Normal file
1
global/languages/de
Normal file
@ -0,0 +1 @@
|
||||
Deutsch
|
1
global/languages/el
Normal file
1
global/languages/el
Normal file
@ -0,0 +1 @@
|
||||
Ελληνικά
|
1
global/languages/en
Normal file
1
global/languages/en
Normal file
@ -0,0 +1 @@
|
||||
English
|
1
global/languages/es
Normal file
1
global/languages/es
Normal file
@ -0,0 +1 @@
|
||||
Español
|
1
global/languages/et
Normal file
1
global/languages/et
Normal file
@ -0,0 +1 @@
|
||||
Eesti
|
1
global/languages/fi
Normal file
1
global/languages/fi
Normal file
@ -0,0 +1 @@
|
||||
Suomi
|
1
global/languages/fr
Normal file
1
global/languages/fr
Normal file
@ -0,0 +1 @@
|
||||
Français
|
1
global/languages/hr
Normal file
1
global/languages/hr
Normal file
@ -0,0 +1 @@
|
||||
Hrvatski
|
1
global/languages/hu
Normal file
1
global/languages/hu
Normal file
@ -0,0 +1 @@
|
||||
Magyar
|
1
global/languages/it
Normal file
1
global/languages/it
Normal file
@ -0,0 +1 @@
|
||||
Italiano
|
1
global/languages/mk
Normal file
1
global/languages/mk
Normal file
@ -0,0 +1 @@
|
||||
Mакедонски
|
1
global/languages/nb
Normal file
1
global/languages/nb
Normal file
@ -0,0 +1 @@
|
||||
Norsk (bokmål)
|
1
global/languages/nl
Normal file
1
global/languages/nl
Normal file
@ -0,0 +1 @@
|
||||
Nederlands
|
1
global/languages/nn
Normal file
1
global/languages/nn
Normal file
@ -0,0 +1 @@
|
||||
Norsk (nynorsk)
|
1
global/languages/pl
Normal file
1
global/languages/pl
Normal file
@ -0,0 +1 @@
|
||||
Polski
|
1
global/languages/pt
Normal file
1
global/languages/pt
Normal file
@ -0,0 +1 @@
|
||||
Português
|
1
global/languages/ro
Normal file
1
global/languages/ro
Normal file
@ -0,0 +1 @@
|
||||
Română
|
1
global/languages/ru
Normal file
1
global/languages/ru
Normal file
@ -0,0 +1 @@
|
||||
Русский
|
1
global/languages/sk
Normal file
1
global/languages/sk
Normal file
@ -0,0 +1 @@
|
||||
Slovenčina
|
1
global/languages/sl
Normal file
1
global/languages/sl
Normal file
@ -0,0 +1 @@
|
||||
Slovenščina
|
1
global/languages/sq
Normal file
1
global/languages/sq
Normal file
@ -0,0 +1 @@
|
||||
Shqip
|
1
global/languages/sr
Normal file
1
global/languages/sr
Normal file
@ -0,0 +1 @@
|
||||
Српски
|
1
global/languages/sv
Normal file
1
global/languages/sv
Normal file
@ -0,0 +1 @@
|
||||
Svenska
|
1
global/languages/tr
Normal file
1
global/languages/tr
Normal file
@ -0,0 +1 @@
|
||||
Türkçe
|
1
global/languages/uk
Normal file
1
global/languages/uk
Normal file
@ -0,0 +1 @@
|
||||
Українська
|
1
global/languages/zh
Normal file
1
global/languages/zh
Normal file
@ -0,0 +1 @@
|
||||
漢語
|
Loading…
Reference in New Issue
Block a user