From b99614b0e9b431414e8bc4e74142fb17d69b627a Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 25 Jun 2023 23:09:56 +0200 Subject: More translations --- build | 45 +++++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) (limited to 'build') diff --git a/build b/build index d83c8ad..7b52aa1 100755 --- a/build +++ b/build @@ -98,6 +98,51 @@ compile_for_lang() { | last-of-design.sed \ | xfsub '' - $nod/index.html + grep -Eo '^[A-Z]{2}' data/coins \ + | uniq \ + | gawk -v lang=$1 ' + function bilingual_sort(i1, v1, i2, v2, f) + { + print v1 ":" v2 |& CMD + CMD |& getline f + + return f == v1 ? -1 : +1 + } + + BEGIN { + while (getline < ("data/country-info." lang)) { + split($0, a, "\t") + map[a[1]] = a[3] + } + } + + { countries[$0] = map[$0] } + + END { + locale = lang == "pt" \ + ? "pt_BR.UTF-8" \ + : lang "_" toupper(lang) ".UTF-8" + + CMD = "LC_ALL=" locale " ./bilingual_sort" + PROCINFO["sorted_in"] = "bilingual_sort" + + print "" + for (code in countries) { + i++ + if (i % 4 == 1) + printf "" + printf "", tolower(code), + countries[code] + if (i % 4 == 0) + print "" + } + print "
%s
" + + close(CMD) + } + ' \ + | xfsub '' - $od/euro/index.html + for CC in `grep -Eo '^[A-Z]{2}' data/coins | uniq`; do cc=`echo $CC | tr A-Z a-z` nod=$od/euro/$cc -- cgit v1.2.3