summaryrefslogtreecommitdiffhomepage
path: root/scripts
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-06-25 18:17:49 +0200
committerThomas Voss <mail@thomasvoss.com> 2023-06-25 18:17:49 +0200
commit529114f2c769c359f2c0353631a183670d3dbebe (patch)
treeb5090b6025a35ca0cba339ac0a4c0d31c88a6d8c /scripts
parent5eff8b30b149d46c0de928a9c8594986773244cf (diff)
Sort names properly in other languages
Diffstat (limited to 'scripts')
-rw-r--r--scripts/bilingual_sort.awk12
1 files changed, 12 insertions, 0 deletions
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
+}