Merge pull request #671 from ZogStriP/extract-hard-coded-strings

extract hard-coded strings
This commit is contained in:
Robin Ward 2013-04-07 10:23:52 -07:00
commit dcebd2eaa3
4 changed files with 9 additions and 3 deletions

View File

@ -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

View File

@ -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

View File

@ -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."

View File

@ -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."