[openstreetmap/openstreetmap-website] Apply lang attribute to localized name:* values (#6834) (PR #6854)

Tom Hughes notifications at github.com
Thu Mar 12 08:53:49 UTC 2026


@tomhughes requested changes on this pull request.

In addition to my inline suggestions can you fix the commit to not have a 180+ character first line?

To be honest I'd just go with something like:

```
Fix language detection for name:* tags in data browser
```

I'm not sure mentioning specific files in the commit comment is a good idea, and including tests for the change is something that's expected and doesn't really need to be mentioned explicitly but if you do want to add more detail then do it in a separate paragraph and keep the initial subject line short.

> @@ -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_language(tag[0]) %>

The indentation here is wrong (but see next comment).

> @@ -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_language(tag[0]) %>
+
+  <%= content_tag :td,
+                  format_value(tag[0], tag[1]),
+                  :class => "py-1 border-secondary-subtle border-start",
+                  :dir => "auto",
+                  :lang => lang %>

I don't the the `lang` variable is doing anything useful so I suggest inlining it here:


```suggestion
                  :lang => tag_language(tag[0]) %>
```

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

Message ID: <openstreetmap/openstreetmap-website/pull/6854/review/3934870836 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20260312/3026d512/attachment.htm>


More information about the rails-dev mailing list