From 529114f2c769c359f2c0353631a183670d3dbebe Mon Sep 17 00:00:00 2001 From: Thomas Voss Date: Sun, 25 Jun 2023 18:17:49 +0200 Subject: Sort names properly in other languages --- scripts/bilingual_sort.awk | 12 ++++++++++++ 1 file changed, 12 insertions(+) create mode 100644 scripts/bilingual_sort.awk (limited to 'scripts') diff --git a/scripts/bilingual_sort.awk b/scripts/bilingual_sort.awk new file mode 100644 index 0000000..6f6f53a --- /dev/null +++ b/scripts/bilingual_sort.awk @@ -0,0 +1,12 @@ +function bilingual_sort(i1, v1, i2, v2, l, r, f) +{ + l = cc2name[v1[0]] + r = cc2name[v2[0]] + + printf "%s\n%s\n", l, r |& "sort" + close("sort", "to") + "sort" |& getline f + close("sort", "from") + + return f == l ? -1 : +1 +} -- cgit v1.2.3