[openstreetmap/openstreetmap-website] Avoid using html in translations (PR #3936)

Andy Allan notifications at github.com
Wed Feb 22 09:24:13 UTC 2023


This is the first batch of changes to avoid using html in our translation strings. It reworks various views to make sure that all html (e.g. links, paragraphs, bold tags etc) are defined in the view, and that the translations only contain the words that need to be translated. The aim is, among other reasons, to make it easier to translate since it avoids having to get the brackets, quoting etc correct to ensure valid html.

The primary challenge with this refactoring is, as usual, to make sure that the translation keys change whenever there is a difference with interpolations, which leads to a little strain around picking new translation keys.
You can view, comment on, or merge this pull request online at:

  https://github.com/openstreetmap/openstreetmap-website/pull/3936

-- Commit Summary --

  * Refactor public editing note to avoid raw html in the translations
  * Move public editing content into its own partial
  * Refactor translation to avoid raw html tags
  * Refactor trace guidance to avoid raw html in translations
  * Remove html from translations for the welcome page
  * Rework about page to avoid html in the translations

-- File Changes --

    A app/views/accounts/_go_public.html.erb (14)
    M app/views/accounts/edit.html.erb (5)
    M app/views/site/export.html.erb (2)
    M app/views/site/welcome.html.erb (27)
    M app/views/traces/index.html.erb (4)
    M app/views/users/new.html.erb (3)
    M config/locales/en.yml (88)
    M test/controllers/traces_controller_test.rb (2)

-- Patch Links --

https://github.com/openstreetmap/openstreetmap-website/pull/3936.patch
https://github.com/openstreetmap/openstreetmap-website/pull/3936.diff

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

Message ID: <openstreetmap/openstreetmap-website/pull/3936 at github.com>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstreetmap.org/pipermail/rails-dev/attachments/20230222/84a6feec/attachment.htm>


More information about the rails-dev mailing list