[openstreetmap/openstreetmap-website] Avoid using html in translations (PR #3936)
Andy Allan
notifications at github.com
Wed Feb 22 10:43:12 UTC 2023
@gravitystorm commented on this pull request.
> @@ -0,0 +1,14 @@
+<hr class="mb-3" />
+<a name="public"></a>
+<h2><%= t ".heading" %></h2>
+<p>
+ <%= t ".currently_not_public" %>
+ <strong><%= t ".only_public_can_edit" %></strong>
+ <%= t ".find_out_why_html", :link => link_to(t(".find_out_why"),
+ t(".find_out_why_url")) %>
I think it's worth the tradeoff in any slight translation difficulty to be able to avoid translators having to get the html right.
The approach here, of having the link text in a separate string interpolated into the whole sentence, is exactly what we need to use when the urls are being generated - e.g. we can't put raw html with path helpers like `foo bar <a href="new_diary_entry_path(user)>link text</a>` into a translation. So there's also an argument that for consistency, all sentences with links should follow the same interpolation pattern, even if the link could be inlined into the translation.
--
Reply to this email directly or view it on GitHub:
https://github.com/openstreetmap/openstreetmap-website/pull/3936#discussion_r1114149714
You are receiving this because you are subscribed to this thread.
Message ID: <openstreetmap/openstreetmap-website/pull/3936/review/1308978173 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230222/ed79f372/attachment.htm>
More information about the rails-dev
mailing list