@1ec5 commented on this pull request.


> +  def browse_tag_value_cell(tag)
+    options = {
+      :class => "py-1 border-secondary-subtle border-start",
+      :dir => "auto"
+    }
+
+    lang = tag_language(tag[0])
+    options[:lang] = lang if lang
+
+    content_tag :td, format_value(tag[0], tag[1]), **options
+  end
+
+  def tag_language(key)
+    key[/\Aname:([a-z]{2,3}(?:-[A-Za-z0-9]+)*)\z/, 1]
+  end
+

That’s my fault for mentioning a helper method in 
https://github.com/openstreetmap/openstreetmap-website/pull/6854#discussion_r2902158872.
 I was thinking there might be more places to validate language codes. However, 
this regex includes `name:` and is pretty lenient about what comes after, so it 
wouldn’t be useful for that purpose.

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

Message ID: 
<openstreetmap/openstreetmap-website/pull/6854/review/[email protected]>
_______________________________________________
rails-dev mailing list
[email protected]
https://lists.openstreetmap.org/listinfo/rails-dev

Reply via email to