Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Wortschack <mwortschack@gitlab.com>2019-04-12 15:28:07 +0300
committerNick Thomas <nick@gitlab.com>2019-04-12 15:28:07 +0300
commitcd6f77409359de53c20c99c5d291ada3545d9d28 (patch)
tree6adff56500804a67329a8746613c370fe62bb24e /app/models/concerns/token_authenticatable_strategies
parentf9cf04fe4fa39a71ba4d17201397fff5f3dc7d97 (diff)
Externalize strings in app/models
- Update PO file
Diffstat (limited to 'app/models/concerns/token_authenticatable_strategies')
-rw-r--r--app/models/concerns/token_authenticatable_strategies/base.rb2
-rw-r--r--app/models/concerns/token_authenticatable_strategies/encrypted.rb6
2 files changed, 4 insertions, 4 deletions
diff --git a/app/models/concerns/token_authenticatable_strategies/base.rb b/app/models/concerns/token_authenticatable_strategies/base.rb
index df14e6e4754..aafd0b538a3 100644
--- a/app/models/concerns/token_authenticatable_strategies/base.rb
+++ b/app/models/concerns/token_authenticatable_strategies/base.rb
@@ -41,7 +41,7 @@ module TokenAuthenticatableStrategies
def self.fabricate(model, field, options)
if options[:digest] && options[:encrypted]
- raise ArgumentError, 'Incompatible options set!'
+ raise ArgumentError, _('Incompatible options set!')
end
if options[:digest]
diff --git a/app/models/concerns/token_authenticatable_strategies/encrypted.rb b/app/models/concerns/token_authenticatable_strategies/encrypted.rb
index 2c7fa2c5b3c..4728cb658dc 100644
--- a/app/models/concerns/token_authenticatable_strategies/encrypted.rb
+++ b/app/models/concerns/token_authenticatable_strategies/encrypted.rb
@@ -13,7 +13,7 @@ module TokenAuthenticatableStrategies
elsif migrating?
find_by_plaintext_token(token, unscoped)
else
- raise ArgumentError, "Unknown encryption strategy: #{encrypted_strategy}!"
+ raise ArgumentError, _("Unknown encryption strategy: %{encrypted_strategy}!") % { encrypted_strategy: encrypted_strategy }
end
end
@@ -32,7 +32,7 @@ module TokenAuthenticatableStrategies
return super if instance.has_attribute?(encrypted_field)
if required?
- raise ArgumentError, 'Using required encryption strategy when encrypted field is missing!'
+ raise ArgumentError, _('Using required encryption strategy when encrypted field is missing!')
else
insecure_strategy.ensure_token(instance)
end
@@ -74,7 +74,7 @@ module TokenAuthenticatableStrategies
value = value.call if value.is_a?(Proc)
unless value.in?([:required, :optional, :migrating])
- raise ArgumentError, 'encrypted: needs to be a :required, :optional or :migrating!'
+ raise ArgumentError, _('encrypted: needs to be a :required, :optional or :migrating!')
end
value