[openstreetmap/openstreetmap-website] Apply lang attribute to localized name:* values (#6834) (PR #6854)
Marwin Hochfelsner
notifications at github.com
Sun Mar 8 19:14:23 UTC 2026
@hlfan commented on this pull request.
> @@ -1,4 +1,13 @@
<tr>
- <th class="py-1 border-secondary-subtle table-secondary fw-normal" dir="auto"><%= format_key(tag[0]) %></th>
- <td class="py-1 border-secondary-subtle border-start" dir="auto"><%= format_value(tag[0], tag[1]) %></td>
+ <th class="py-1 border-secondary-subtle table-secondary fw-normal" dir="auto">
+ <%= format_key(tag[0]) %>
+ </th>
+
+ <% lang = tag[0][/^name:([a-z]{2,3}(?:-[A-Z]{2})?)$/, 1] %>
Since we only need to find the substrings most likely to be BCP-47 strings, not validate them, we can go for something a little bit simpler.
I've been trying out some variants; this is my current pick:
`/.+:([a-zA-Z]{2,3}(?:(?:[^a-zA-Z:_'"]\w+)+|\b|$))/`
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/6854#discussion_r2902286701
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/6854/review/3911911597 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260308/9c1852dd/attachment.htm>
More information about the rails-dev
mailing list