diff options
author | Thomas Voss <mail@thomasvoss.com> | 2023-06-25 23:09:56 +0200 |
---|---|---|
committer | Thomas Voss <mail@thomasvoss.com> | 2023-06-25 23:09:56 +0200 |
commit | b99614b0e9b431414e8bc4e74142fb17d69b627a (patch) | |
tree | 313426b5d5a07a2b36e0077677254c78b1f728e0 /build | |
parent | dedcab5598c465024f7cd0091474a708f4201437 (diff) |
More translations
Diffstat (limited to 'build')
-rwxr-xr-x | build | 45 |
1 files changed, 45 insertions, 0 deletions
@@ -98,6 +98,51 @@ compile_for_lang() { | last-of-design.sed \ | xfsub '<!-- TABLE-BODY -->' - $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 "<table class=country-table><tbody>" + for (code in countries) { + i++ + if (i % 4 == 1) + printf "<tr>" + printf "<td><a href=%s>%s</a></td>", tolower(code), + countries[code] + if (i % 4 == 0) + print "</tr>" + } + print "</tbody></table>" + + close(CMD) + } + ' \ + | xfsub '<!-- COUNTRY-TABLE -->' - $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 |