[openstreetmap/openstreetmap-website] Advanced preferences, language dropdown in basic preferences (PR #6024)

Anton Khorev notifications at github.com
Sun May 18 11:36:48 UTC 2025


@AntonKhorev commented on this pull request.



> +
+  {
+    :code => code,
+    :native_name => native_name
+  }
+end
+
+AVAILABLE_LANGUAGES.sort_by! do |entry|
+  # https://stackoverflow.com/a/74029319
+  diactrics = [*0x1DC0..0x1DFF, *0x0300..0x036F, *0xFE20..0xFE2F].pack("U*")
+  entry[:native_name]
+    .downcase
+    .unicode_normalize(:nfd)
+    .tr(diactrics, "")
+    .unicode_normalize(:nfc)
+end

Isn't it then better to dump all languages to some yaml file in a predetermined order, rather than adding another gem?

-- 
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6024#discussion_r2094497017
You are receiving this because you are subscribed to this thread.

Message ID: <openstreetmap/openstreetmap-website/pull/6024/review/2848910249 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20250518/d892e48e/attachment.htm>


More information about the rails-dev mailing list