From 98a17edc90114f6a7c5134d8f7313619093eb869 Mon Sep 17 00:00:00 2001 From: Gerhard Schlager Date: Wed, 22 May 2019 16:13:30 +0200 Subject: [PATCH] Remove unused translations The migration for the ToS signup field happend in 2014. Everyone who hasn't updated yet needs to live with the English text "Terms of Service". There's no need to keep these unused translations forever. --- config/locales/server.en.yml | 4 ---- db/migrate/20140929204155_migrate_tos_setting.rb | 6 +----- db/migrate/20141014191645_fix_tos_name.rb | 9 +++++---- 3 files changed, 6 insertions(+), 13 deletions(-) diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index b92d635f5cc..3cd45e95b72 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -3496,10 +3496,6 @@ en: ## [Welcome to %{title}](#welcome) An account is required. Please ask an existing member for an invite or log in to continue. - terms_of_service: - title: "Terms of Service" - signup_form_message: 'I have read and accept the Terms of Service.' - deleted: "deleted" image: "image" diff --git a/db/migrate/20140929204155_migrate_tos_setting.rb b/db/migrate/20140929204155_migrate_tos_setting.rb index 66cf689572d..3ee0ccbd8c2 100644 --- a/db/migrate/20140929204155_migrate_tos_setting.rb +++ b/db/migrate/20140929204155_migrate_tos_setting.rb @@ -4,11 +4,7 @@ class MigrateTosSetting < ActiveRecord::Migration[4.2] def up res = execute("SELECT * FROM site_settings WHERE name = 'tos_accept_required' AND value = 't'") if res.present? && res.cmd_tuples > 0 - label = nil - - I18n.overrides_disabled do - label = I18n.t("terms_of_service.signup_form_message", base_path: "") - end + label = 'Terms of Service' res = execute("SELECT value FROM site_texts WHERE text_type = 'tos_signup_form_message'") if res.present? && res.cmd_tuples == 1 diff --git a/db/migrate/20141014191645_fix_tos_name.rb b/db/migrate/20141014191645_fix_tos_name.rb index 7186b51d887..b9e38f830da 100644 --- a/db/migrate/20141014191645_fix_tos_name.rb +++ b/db/migrate/20141014191645_fix_tos_name.rb @@ -2,9 +2,10 @@ class FixTosName < ActiveRecord::Migration[4.2] def up - I18n.overrides_disabled do - execute DB.sql_fragment('UPDATE user_fields SET name = ? WHERE name = ?', I18n.t('terms_of_service.title'), I18n.t("terms_of_service.signup_form_message", base_path: "")) - end - + execute <<~SQL + UPDATE user_fields + SET name = 'Terms of Service' + WHERE name = 'I have read and accept the Terms of Service.' + SQL end end