Change storage of language list
continuous-integration/drone/push Build is passing Details

Having each language as a separate file in a directory makes handling of
the languages way easier.
This commit is contained in:
Reinhard Müller 2020-04-24 16:36:02 +02:00
parent 53a0c4bcc4
commit ec59668710
36 changed files with 39 additions and 53 deletions

View File

@ -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)

View File

@ -1,41 +0,0 @@
#!/usr/bin/env bash
# lazy-ass include guard
inc_languages=true
languages(){
cat <<EOL
ar &#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1617;&#1577;
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
}

View File

@ -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
# -----------------------------------------------------------------------------

View File

@ -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
View File

@ -0,0 +1 @@
&#1575;&#1604;&#1593;&#1585;&#1576;&#1610;&#1617;&#1577;

1
global/languages/bg Normal file
View File

@ -0,0 +1 @@
Български

1
global/languages/bs Normal file
View File

@ -0,0 +1 @@
Bosanski

1
global/languages/ca Normal file
View File

@ -0,0 +1 @@
Català

1
global/languages/cs Normal file
View File

@ -0,0 +1 @@
Česky

1
global/languages/da Normal file
View File

@ -0,0 +1 @@
Dansk

1
global/languages/de Normal file
View File

@ -0,0 +1 @@
Deutsch

1
global/languages/el Normal file
View File

@ -0,0 +1 @@
Ελληνικά

1
global/languages/en Normal file
View File

@ -0,0 +1 @@
English

1
global/languages/es Normal file
View File

@ -0,0 +1 @@
Español

1
global/languages/et Normal file
View File

@ -0,0 +1 @@
Eesti

1
global/languages/fi Normal file
View File

@ -0,0 +1 @@
Suomi

1
global/languages/fr Normal file
View File

@ -0,0 +1 @@
Français

1
global/languages/hr Normal file
View File

@ -0,0 +1 @@
Hrvatski

1
global/languages/hu Normal file
View File

@ -0,0 +1 @@
Magyar

1
global/languages/it Normal file
View File

@ -0,0 +1 @@
Italiano

1
global/languages/mk Normal file
View File

@ -0,0 +1 @@
Mакедонски

1
global/languages/nb Normal file
View File

@ -0,0 +1 @@
Norsk (bokmål)

1
global/languages/nl Normal file
View File

@ -0,0 +1 @@
Nederlands

1
global/languages/nn Normal file
View File

@ -0,0 +1 @@
Norsk (nynorsk)

1
global/languages/pl Normal file
View File

@ -0,0 +1 @@
Polski

1
global/languages/pt Normal file
View File

@ -0,0 +1 @@
Português

1
global/languages/ro Normal file
View File

@ -0,0 +1 @@
Română

1
global/languages/ru Normal file
View File

@ -0,0 +1 @@
Русский

1
global/languages/sk Normal file
View File

@ -0,0 +1 @@
Slovenčina

1
global/languages/sl Normal file
View File

@ -0,0 +1 @@
Slovenščina

1
global/languages/sq Normal file
View File

@ -0,0 +1 @@
Shqip

1
global/languages/sr Normal file
View File

@ -0,0 +1 @@
Српски

1
global/languages/sv Normal file
View File

@ -0,0 +1 @@
Svenska

1
global/languages/tr Normal file
View File

@ -0,0 +1 @@
Türkçe

1
global/languages/uk Normal file
View File

@ -0,0 +1 @@
Українська

1
global/languages/zh Normal file
View File

@ -0,0 +1 @@
漢語