From d299e0787f793ead7d7e8f95b6108972301ecece Mon Sep 17 00:00:00 2001 From: Martin Wortschack Date: Wed, 17 Apr 2019 11:56:14 +0200 Subject: Resolve first round of discussions - Revert translations for certain error messages - Update PO file --- lib/file_size_validator.rb | 8 +++--- lib/gitlab/auth/ldap/adapter.rb | 2 +- lib/gitlab/auth/user_access_denied_reason.rb | 4 +-- lib/gitlab/config/entry/attributable.rb | 2 +- lib/gitlab/git_access.rb | 6 ++--- lib/gitlab/legacy_github_import/client.rb | 2 +- lib/gitlab/utils.rb | 4 +-- locale/gitlab.pot | 38 +--------------------------- 8 files changed, 15 insertions(+), 51 deletions(-) diff --git a/lib/file_size_validator.rb b/lib/file_size_validator.rb index cc7d4a127c7..f13f90393d2 100644 --- a/lib/file_size_validator.rb +++ b/lib/file_size_validator.rb @@ -9,7 +9,7 @@ class FileSizeValidator < ActiveModel::EachValidator def initialize(options) if range = (options.delete(:in) || options.delete(:within)) - raise ArgumentError, _(":in and :within must be a Range") unless range.is_a?(Range) + raise ArgumentError, ":in and :within must be a Range" unless range.is_a?(Range) options[:minimum], options[:maximum] = range.begin, range.end options[:maximum] -= 1 if range.exclude_end? @@ -22,21 +22,21 @@ class FileSizeValidator < ActiveModel::EachValidator keys = CHECKS.keys & options.keys if keys.empty? - raise ArgumentError, _('Range unspecified. Specify the :within, :maximum, :minimum, or :is option.') + raise ArgumentError, 'Range unspecified. Specify the :within, :maximum, :minimum, or :is option.' end keys.each do |key| value = options[key] unless (value.is_a?(Integer) && value >= 0) || value.is_a?(Symbol) - raise ArgumentError, _(":%{key} must be a nonnegative Integer or symbol") % { key: key } + raise ArgumentError, ":%{key} must be a nonnegative Integer or symbol" % { key: key } end end end # rubocop: disable CodeReuse/ActiveRecord def validate_each(record, attribute, value) - raise(ArgumentError, _("A CarrierWave::Uploader::Base object was expected")) unless value.is_a? CarrierWave::Uploader::Base + raise(ArgumentError, "A CarrierWave::Uploader::Base object was expected") unless value.is_a? CarrierWave::Uploader::Base value = (options[:tokenizer] || DEFAULT_TOKENIZER).call(value) if value.is_a?(String) diff --git a/lib/gitlab/auth/ldap/adapter.rb b/lib/gitlab/auth/ldap/adapter.rb index ba0019cb023..4e9a16f4ced 100644 --- a/lib/gitlab/auth/ldap/adapter.rb +++ b/lib/gitlab/auth/ldap/adapter.rb @@ -102,7 +102,7 @@ module Gitlab options[:size] = limit if limit if fields.include?('dn') - raise ArgumentError, _('It is not currently possible to search the DN and other fields at the same time.') if fields.size > 1 + raise ArgumentError, 'It is not currently possible to search the DN and other fields at the same time.' if fields.size > 1 options[:base] = value options[:scope] = Net::LDAP::SearchScope_BaseObject diff --git a/lib/gitlab/auth/user_access_denied_reason.rb b/lib/gitlab/auth/user_access_denied_reason.rb index 4f37bad0604..23e9806169b 100644 --- a/lib/gitlab/auth/user_access_denied_reason.rb +++ b/lib/gitlab/auth/user_access_denied_reason.rb @@ -12,8 +12,8 @@ module Gitlab when :internal _("This action cannot be performed by internal users") when :terms_not_accepted - _("You (%{user_to_reference}) must accept the Terms of Service in order to perform this action. "\ - "Please access GitLab from a web browser to accept these terms.") % { user_to_reference: @user.to_reference } + _("You (%{username}) must accept the Terms of Service in order to perform this action. "\ + "Please access GitLab from a web browser to accept these terms.") % { username: @user.to_reference } else _("Your account has been blocked.") end diff --git a/lib/gitlab/config/entry/attributable.rb b/lib/gitlab/config/entry/attributable.rb index b651819a56c..560fe63df0e 100644 --- a/lib/gitlab/config/entry/attributable.rb +++ b/lib/gitlab/config/entry/attributable.rb @@ -10,7 +10,7 @@ module Gitlab def attributes(*attributes) attributes.flatten.each do |attribute| if method_defined?(attribute) - raise ArgumentError, _('Method already defined!') + raise ArgumentError, 'Method already defined!' end define_method(attribute) do diff --git a/lib/gitlab/git_access.rb b/lib/gitlab/git_access.rb index 0f014d1d6b0..fdb316c56a5 100644 --- a/lib/gitlab/git_access.rb +++ b/lib/gitlab/git_access.rb @@ -124,7 +124,7 @@ module Gitlab return unless actor.is_a?(Key) unless actor.valid? - raise UnauthorizedError, _("Your SSH key %{first_actor_error}.") % { first_actor_error: actor.errors[:key].first } + raise UnauthorizedError, "Your SSH key #{actor.errors[:key].first}." end end @@ -132,7 +132,7 @@ module Gitlab return if request_from_ci_build? unless protocol_allowed? - raise UnauthorizedError, _("Git access over %{protocol} is not allowed") % { protocol: protocol.upcase } + raise UnauthorizedError, "Git access over #{protocol.upcase} is not allowed" end end @@ -223,7 +223,7 @@ module Gitlab project = Projects::CreateService.new(user, project_params).execute unless project.saved? - raise ProjectCreationError, _("Could not create project: %{project_errors_full_messages}") % { project_errors_full_messages: project.errors.full_messages.join(', ') } + raise ProjectCreationError, "Could not create project: #{project.errors.full_messages.join(', ')}" end @project = project diff --git a/lib/gitlab/legacy_github_import/client.rb b/lib/gitlab/legacy_github_import/client.rb index 53a8f0b46d8..bbdd094e33b 100644 --- a/lib/gitlab/legacy_github_import/client.rb +++ b/lib/gitlab/legacy_github_import/client.rb @@ -34,7 +34,7 @@ module Gitlab def client unless config raise Projects::ImportService::Error, - _('OAuth configuration for GitHub missing.') + 'OAuth configuration for GitHub missing.' end @client ||= ::OAuth2::Client.new( diff --git a/lib/gitlab/utils.rb b/lib/gitlab/utils.rb index e10a6a704d2..16ec8a8bb28 100644 --- a/lib/gitlab/utils.rb +++ b/lib/gitlab/utils.rb @@ -26,8 +26,8 @@ module Gitlab end def ensure_utf8_size(str, bytes:) - raise ArgumentError, _('Empty string provided!') if str.empty? - raise ArgumentError, _('Negative string size provided!') if bytes.negative? + raise ArgumentError, 'Empty string provided!' if str.empty? + raise ArgumentError, 'Negative string size provided!' if bytes.negative? truncated = str.each_char.each_with_object(+'') do |char, object| if object.bytesize + char.bytesize > bytes diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 3d05e1f240a..77d4803e69d 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -321,12 +321,6 @@ msgstr "" msgid "8 hours" msgstr "" -msgid ":%{key} must be a nonnegative Integer or symbol" -msgstr "" - -msgid ":in and :within must be a Range" -msgstr "" - msgid "\"johnsmith@example.com\": \"@johnsmith\" will add \"By @johnsmith\" to all issues and comments originally created by johnsmith@example.com, and will set @johnsmith as the assignee on all issues originally assigned to johnsmith@example.com." msgstr "" @@ -354,9 +348,6 @@ msgstr "" msgid "A .NET Core console application template, customizable for any .NET Core project" msgstr "" -msgid "A CarrierWave::Uploader::Base object was expected" -msgstr "" - msgid "A GitBook site that uses Netlify for CI/CD instead of GitLab, but still with all the other great GitLab features." msgstr "" @@ -2711,9 +2702,6 @@ msgstr "" msgid "Could not create Wiki Repository at this time. Please try again later." msgstr "" -msgid "Could not create project: %{project_errors_full_messages}" -msgstr "" - msgid "Could not delete chat nickname %{chat_name}." msgstr "" @@ -3436,9 +3424,6 @@ msgstr "" msgid "Empty file" msgstr "" -msgid "Empty string provided!" -msgstr "" - msgid "Enable" msgstr "" @@ -4239,9 +4224,6 @@ msgstr "" msgid "Git LFS is not enabled on this GitLab server, contact your admin." msgstr "" -msgid "Git access over %{protocol} is not allowed" -msgstr "" - msgid "Git global setup" msgstr "" @@ -4961,9 +4943,6 @@ msgstr "" msgid "Issues, merge requests, pushes, and comments." msgstr "" -msgid "It is not currently possible to search the DN and other fields at the same time." -msgstr "" - msgid "It must have a header row and at least two columns: the first column is the issue title and the second column is the issue description. The separator is automatically detected." msgstr "" @@ -5625,9 +5604,6 @@ msgstr "" msgid "Messages" msgstr "" -msgid "Method already defined!" -msgstr "" - msgid "Metrics" msgstr "" @@ -5841,9 +5817,6 @@ msgstr "" msgid "Nav|Sign out and sign in with a different account" msgstr "" -msgid "Negative string size provided!" -msgstr "" - msgid "Network" msgstr "" @@ -6185,9 +6158,6 @@ msgstr "" msgid "November" msgstr "" -msgid "OAuth configuration for GitHub missing." -msgstr "" - msgid "Object does not exist on the server or you don't have permissions to access it" msgstr "" @@ -7366,9 +7336,6 @@ msgstr "" msgid "Rake Tasks Help" msgstr "" -msgid "Range unspecified. Specify the :within, :maximum, :minimum, or :is option." -msgstr "" - msgid "Read more" msgstr "" @@ -10458,7 +10425,7 @@ msgstr "" msgid "You" msgstr "" -msgid "You (%{user_to_reference}) must accept the Terms of Service in order to perform this action. Please access GitLab from a web browser to accept these terms." +msgid "You (%{username}) must accept the Terms of Service in order to perform this action. Please access GitLab from a web browser to accept these terms." msgstr "" msgid "You are an admin, which means granting access to %{client_name} will allow them to interact with GitLab as an admin as well. Proceed with caution." @@ -10710,9 +10677,6 @@ msgstr "" msgid "Your Projects' Activity" msgstr "" -msgid "Your SSH key %{first_actor_error}." -msgstr "" - msgid "Your Todos" msgstr "" -- cgit v1.2.1