diff options
author | Martin Wortschack <mwortschack@gitlab.com> | 2019-04-12 15:28:07 +0300 |
---|---|---|
committer | Nick Thomas <nick@gitlab.com> | 2019-04-12 15:28:07 +0300 |
commit | cd6f77409359de53c20c99c5d291ada3545d9d28 (patch) | |
tree | 6adff56500804a67329a8746613c370fe62bb24e /app/models/concerns | |
parent | f9cf04fe4fa39a71ba4d17201397fff5f3dc7d97 (diff) |
Externalize strings in app/models
- Update PO file
Diffstat (limited to 'app/models/concerns')
-rw-r--r-- | app/models/concerns/group_descendant.rb | 4 | ||||
-rw-r--r-- | app/models/concerns/token_authenticatable_strategies/base.rb | 2 | ||||
-rw-r--r-- | app/models/concerns/token_authenticatable_strategies/encrypted.rb | 6 |
3 files changed, 6 insertions, 6 deletions
diff --git a/app/models/concerns/group_descendant.rb b/app/models/concerns/group_descendant.rb index 05cd4265133..cfffd845e43 100644 --- a/app/models/concerns/group_descendant.rb +++ b/app/models/concerns/group_descendant.rb @@ -22,7 +22,7 @@ module GroupDescendant return [] if descendants.empty? unless descendants.all? { |hierarchy| hierarchy.is_a?(GroupDescendant) } - raise ArgumentError.new('element is not a hierarchy') + raise ArgumentError.new(_('element is not a hierarchy')) end all_hierarchies = descendants.map do |descendant| @@ -56,7 +56,7 @@ module GroupDescendant end if parent.nil? && hierarchy_top.present? - raise ArgumentError.new('specified top is not part of the tree') + raise ArgumentError.new(_('specified top is not part of the tree')) end if parent && parent != hierarchy_top 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 |