From: Tom Hughes Date: Wed, 14 Mar 2012 17:51:42 +0000 (+0000) Subject: Add _html suffixes to some resource strings which have changed X-Git-Tag: live~5716 X-Git-Url: https://git.openstreetmap.org/rails.git/commitdiff_plain/0884e7b43192bf924f505d12e3d9810e61da7ac9?ds=sidebyside Add _html suffixes to some resource strings which have changed Where a translatable string contains (directly or indirectly via interpolations) some HTML it is better to add an _html suffix to the key rather than wrap the result in raw so that escaping is handled automatically for interpolations. It's not worth doing until a string is changed and needs to be retranslated though, as it will just break translations. --- diff --git a/app/views/layouts/site.html.erb b/app/views/layouts/site.html.erb index 19835489c..4c12bfe14 100644 --- a/app/views/layouts/site.html.erb +++ b/app/views/layouts/site.html.erb @@ -73,13 +73,13 @@ <%= t 'layouts.intro_1' %>

- <%= raw(t 'layouts.intro_2', + <%= t 'layouts.intro_2_html', :download => link_to(t('layouts.intro_2_download'), "http://planet.openstreetmap.org/"), :use => link_to(t('layouts.intro_2_use'), t('layouts.intro_2_use_url')), :license => link_to(t('layouts.intro_2_license'), url_for({:controller => 'site', :action => 'copyright'})), :create_account => link_to(t('layouts.intro_2_create_account'), - url_for({:controller => 'user', :action => 'new'}))) + url_for({:controller => 'user', :action => 'new'})) %>

@@ -131,11 +131,11 @@ <%= h(t('layouts.make_a_donation.text')) %> diff --git a/config/locales/en.yml b/config/locales/en.yml index 1cec3f148..766d61918 100644 --- a/config/locales/en.yml +++ b/config/locales/en.yml @@ -974,13 +974,13 @@ en: edit_with: Edit with %{editor} tag_line: The Free Wiki World Map intro_1: "OpenStreetMap is a free worldwide map, created by people like you." - intro_2: "The data is free to %{download} and %{use} under its %{license}. %{create_account} to improve the map." + intro_2_html: "The data is free to %{download} and %{use} under its %{license}. %{create_account} to improve the map." intro_2_create_account: "Create a user account" intro_2_license: "open license" intro_2_use: "use" intro_2_download: "download" intro_2_use_url: "http://wiki.openstreetmap.org/wiki/Using_OpenStreetMap" - partners: "Hosting is supported by %{ucl}, %{ic} and %{bytemark}, and other %{partners}." + partners_html: "Hosting is supported by %{ucl}, %{ic} and %{bytemark}, and other %{partners}." partners_ucl: "the UCL VR Centre" partners_ic: "Imperial College London" partners_bytemark: "Bytemark Hosting"