From 41b7f741d068f4eac949aae40cd8311c8ce26e72 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?R=C3=A9gis=20Hanol?= Date: Sun, 7 Apr 2013 18:14:50 +0200 Subject: [PATCH] extract hard-coded strings --- app/controllers/admin/export_controller.rb | 2 +- app/controllers/application_controller.rb | 2 +- config/locales/server.en.yml | 3 +++ config/locales/server.fr.yml | 5 ++++- 4 files changed, 9 insertions(+), 3 deletions(-) diff --git a/app/controllers/admin/export_controller.rb b/app/controllers/admin/export_controller.rb index c9ffbb795b8..127b9a5c18b 100644 --- a/app/controllers/admin/export_controller.rb +++ b/app/controllers/admin/export_controller.rb @@ -4,7 +4,7 @@ class Admin::ExportController < Admin::AdminController job_id = Jobs.enqueue( :exporter, user_id: current_user.id ) render json: success_json.merge( job_id: job_id ) else - render json: failed_json.merge( message: "An #{Export.is_export_running? ? 'export' : 'import'} is currently running. Can't start a new export job right now.") + render json: failed_json.merge( message: I18n.t('operation_already_running', { operation: Export.is_export_running? ? 'export' : 'import' })) end end end diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index e8ebc02cd4f..0b423b527d4 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -207,7 +207,7 @@ class ApplicationController < ActionController::Base def block_if_maintenance_mode if Discourse.maintenance_mode? if request.format.json? - render status: 503, json: failed_json.merge( message: 'Site is currently undergoing maintenance.' ) + render status: 503, json: failed_json.merge(message: I18n.t('site_under_maintenance')) else render status: 503, file: File.join( Rails.root, 'public', '503.html' ), layout: false end diff --git a/config/locales/server.en.yml b/config/locales/server.en.yml index 0c30694c6a5..572a9705232 100644 --- a/config/locales/server.en.yml +++ b/config/locales/server.en.yml @@ -12,6 +12,9 @@ en: via: "%{username} via %{site_name}" is_reserved: "is reserved" + site_under_maintenance: 'Site is currently undergoing maintenance.' + operation_already_running: "An %{operation} is currently running. Can't start a new %{operation} job right now." + too_many_mentions: zero: "Sorry, you can't mention other users." one: "Sorry, you can only mention one other user in a post." diff --git a/config/locales/server.fr.yml b/config/locales/server.fr.yml index f37c37d5fea..31ff0c53ed0 100644 --- a/config/locales/server.fr.yml +++ b/config/locales/server.fr.yml @@ -19,6 +19,9 @@ fr: via: "%{username} via %{site_name}" is_reserved: "est réservé" + site_under_maintenance: 'Le site est en cours de maintenance.' + operation_already_running: "Un %{operation} est en train de tourner. Impossible d'en démarrer un autre." + too_many_mentions: zero: "Désolé, vous ne pouvez pas mentionner d'utilisateur." one: "Désolé, vous ne pouvez mentionner qu'un seul utilisateur." @@ -883,4 +886,4 @@ fr: User contributions are licensed under a [Creative Commons Attribution-NonCommercial-ShareAlike 3.0 Unported License](http://creativecommons.org/licenses/by-nc-sa/3.0/deed.en_US). Without limiting any of those representations or warranties, %{company_short_name} has the right (though not the obligation) to, in %{company_short_name}’s sole discretion (i) refuse or remove any content that, in %{company_short_name}’s reasonable opinion, violates any %{company_short_name} policy or is in any way harmful or objectionable, or (ii) terminate or deny access to and use of the Website to any individual or entity for any reason, in %{company_short_name}’s sole discretion. %{company_short_name} will have no obligation to provide a refund of any amounts previously paid. Without limiting any of those representations or warranties, %{company_short_name} has the right (though not the obligation) to, in %{company_short_name}’s sole discretion (i) refuse or remove any content that, in %{company_short_name}’s reasonable opinion, violates any %{company_short_name} policy or is in any way harmful or objectionable, or (ii) terminate or deny access to and use of the Website to any individual or entity for any reason, in %{company_short_name}’s sole discretion. %{company_short_name} will have no obligation to provide a refund of any amounts previously paid. - miscellaneous: "This Agreement constitutes the entire agreement between %{company_short_name} and you concerning the subject matter ereof, and they may only be modified by a written amendment signed by an authorized executive of %{company_short_name}, or by the posting by %{company_short_name} of a revised version. Except to the extent applicable law, if any, provides otherwise, this Agreement, any access to or use of the Website will be governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions, and the proper venue for any disputes arising out of or relating to any of the same will be the state and federal courts located in San Francisco County, California. Except for claims for injunctive or equitable relief or claims regarding intellectual property rights (which may be brought in any competent court without the posting of a bond), any dispute arising under this Agreement shall be finally settled in accordance with the Comprehensive Arbitration Rules of the Judicial Arbitration and Mediation Service, Inc. (“JAMS”) by three arbitrators appointed in accordance with such Rules. The arbitration shall take place in San Francisco, California, in the English language and the arbitral decision may be enforced in any court. The prevailing party in any action or proceeding to enforce this Agreement shall be entitled to costs and attorneys’ fees. If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the parties’ original intent, and the remaining portions will remain in full force and effect. A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof. You may assign your rights under this Agreement to any party that consents to, and agrees to be bound by, its terms and conditions; %{company_short_name} may assign its rights under this Agreement without condition. This Agreement will be binding upon and will inure to the benefit of the parties, their successors and permitted assigns." \ No newline at end of file + miscellaneous: "This Agreement constitutes the entire agreement between %{company_short_name} and you concerning the subject matter ereof, and they may only be modified by a written amendment signed by an authorized executive of %{company_short_name}, or by the posting by %{company_short_name} of a revised version. Except to the extent applicable law, if any, provides otherwise, this Agreement, any access to or use of the Website will be governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions, and the proper venue for any disputes arising out of or relating to any of the same will be the state and federal courts located in San Francisco County, California. Except for claims for injunctive or equitable relief or claims regarding intellectual property rights (which may be brought in any competent court without the posting of a bond), any dispute arising under this Agreement shall be finally settled in accordance with the Comprehensive Arbitration Rules of the Judicial Arbitration and Mediation Service, Inc. (“JAMS”) by three arbitrators appointed in accordance with such Rules. The arbitration shall take place in San Francisco, California, in the English language and the arbitral decision may be enforced in any court. The prevailing party in any action or proceeding to enforce this Agreement shall be entitled to costs and attorneys’ fees. If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the parties’ original intent, and the remaining portions will remain in full force and effect. A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof. You may assign your rights under this Agreement to any party that consents to, and agrees to be bound by, its terms and conditions; %{company_short_name} may assign its rights under this Agreement without condition. This Agreement will be binding upon and will inure to the benefit of the parties, their successors and permitted assigns."