diff options
Diffstat (limited to 'lib/api')
46 files changed, 170 insertions, 170 deletions
diff --git a/lib/api/access_requests.rb b/lib/api/access_requests.rb index ee8dc822098..bbbb0e19186 100644 --- a/lib/api/access_requests.rb +++ b/lib/api/access_requests.rb @@ -14,7 +14,7 @@ module API end resource source_type.pluralize, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc "Gets a list of access requests for a #{source_type}." do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::AccessRequester end params do @@ -32,7 +32,7 @@ module API # rubocop: enable CodeReuse/ActiveRecord desc "Requests access for the authenticated user to a #{source_type}." do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::AccessRequester end post ":id/access_requests" do @@ -46,8 +46,8 @@ module API end end - desc 'Approves an access request for the given user.' do - detail 'This feature was introduced in GitLab 8.11.' + desc _('Approves an access request for the given user.') do + detail _('This feature was introduced in GitLab 8.11.') success Entities::Member end params do @@ -68,8 +68,8 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Denies an access request for the given user.' do - detail 'This feature was introduced in GitLab 8.11.' + desc _('Denies an access request for the given user.') do + detail _('This feature was introduced in GitLab 8.11.') end params do requires :user_id, type: Integer, desc: 'The user ID of the access requester' diff --git a/lib/api/api.rb b/lib/api/api.rb index a768b78cda5..a4b0043c828 100644 --- a/lib/api/api.rb +++ b/lib/api/api.rb @@ -29,7 +29,7 @@ module API version 'v3', using: :path do route :any, '*path' do - error!('API V3 is no longer supported. Use API V4 instead.', 410) + error!(_('API V3 is no longer supported. Use API V4 instead.'), 410) end end diff --git a/lib/api/api_guard.rb b/lib/api/api_guard.rb index af9b519ed9e..b0769665f68 100644 --- a/lib/api/api_guard.rb +++ b/lib/api/api_guard.rb @@ -110,22 +110,22 @@ module API when Gitlab::Auth::TokenNotFoundError Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new( :invalid_token, - "Bad Access Token.") + _("Bad Access Token.")) when Gitlab::Auth::ExpiredError Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new( :invalid_token, - "Token is expired. You can either do re-authorization or token refresh.") + _("Token is expired. You can either do re-authorization or token refresh.")) when Gitlab::Auth::RevokedError Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new( :invalid_token, - "Token was revoked. You have to re-authorize from the user.") + _("Token was revoked. You have to re-authorize from the user.")) when Gitlab::Auth::ImpersonationDisabled Rack::OAuth2::Server::Resource::Bearer::Unauthorized.new( :invalid_token, - "Token is an impersonation token but impersonation was disabled.") + _("Token is an impersonation token but impersonation was disabled.")) when Gitlab::Auth::InsufficientScopeError # FIXME: ForbiddenError (inherited from Bearer::Forbidden of Rack::Oauth2) diff --git a/lib/api/badges.rb b/lib/api/badges.rb index ba554e00a16..e6ff89c1025 100644 --- a/lib/api/badges.rb +++ b/lib/api/badges.rb @@ -24,7 +24,7 @@ module API end resource source_type.pluralize, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc "Gets a list of #{source_type} badges viewable by the authenticated user." do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') success Entities::Badge end params do @@ -37,7 +37,7 @@ module API end desc "Preview a badge from a #{source_type}." do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') success Entities::BasicBadgeDetails end params do @@ -60,7 +60,7 @@ module API end desc "Gets a badge of a #{source_type}." do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') success Entities::Badge end params do @@ -74,7 +74,7 @@ module API end desc "Adds a badge to a #{source_type}." do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') success Entities::Badge end params do @@ -94,7 +94,7 @@ module API end desc "Updates a badge of a #{source_type}." do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') success Entities::Badge end params do @@ -114,8 +114,8 @@ module API end end - desc 'Removes a badge from a project or group.' do - detail 'This feature was introduced in GitLab 10.6.' + desc _('Removes a badge from a project or group.') do + detail _('This feature was introduced in GitLab 10.6.') end params do requires :badge_id, type: Integer, desc: 'The badge ID' diff --git a/lib/api/boards_responses.rb b/lib/api/boards_responses.rb index 86d9b24802f..72174c4e3d8 100644 --- a/lib/api/boards_responses.rb +++ b/lib/api/boards_responses.rb @@ -38,7 +38,7 @@ module API if move_list_service.execute(list) present list, with: Entities::List else - render_api_error!({ error: "List could not be moved!" }, 400) + render_api_error!({ error: _("List could not be moved!") }, 400) end end @@ -46,7 +46,7 @@ module API destroy_conditionally!(list) do |list| service = ::Boards::Lists::DestroyService.new(board_parent, current_user) unless service.execute(list) - render_api_error!({ error: 'List could not be deleted!' }, 400) + render_api_error!({ error: _('List could not be deleted!') }, 400) end end end @@ -54,7 +54,7 @@ module API # rubocop: disable CodeReuse/ActiveRecord def authorize_list_type_resource! unless available_labels_for(board_parent).exists?(params[:label_id]) - render_api_error!({ error: 'Label not found!' }, 400) + render_api_error!({ error: _('Label not found!') }, 400) end end # rubocop: enable CodeReuse/ActiveRecord diff --git a/lib/api/broadcast_messages.rb b/lib/api/broadcast_messages.rb index 19148758fc5..c00971443fd 100644 --- a/lib/api/broadcast_messages.rb +++ b/lib/api/broadcast_messages.rb @@ -15,7 +15,7 @@ module API end desc 'Get all broadcast messages' do - detail 'This feature was introduced in GitLab 8.12.' + detail _('This feature was introduced in GitLab 8.12.') success Entities::BroadcastMessage end params do @@ -28,7 +28,7 @@ module API end desc 'Create a broadcast message' do - detail 'This feature was introduced in GitLab 8.12.' + detail _('This feature was introduced in GitLab 8.12.') success Entities::BroadcastMessage end params do @@ -49,7 +49,7 @@ module API end desc 'Get a specific broadcast message' do - detail 'This feature was introduced in GitLab 8.12.' + detail _('This feature was introduced in GitLab 8.12.') success Entities::BroadcastMessage end params do @@ -62,7 +62,7 @@ module API end desc 'Update a broadcast message' do - detail 'This feature was introduced in GitLab 8.12.' + detail _('This feature was introduced in GitLab 8.12.') success Entities::BroadcastMessage end params do @@ -84,7 +84,7 @@ module API end desc 'Delete a broadcast message' do - detail 'This feature was introduced in GitLab 8.12.' + detail _('This feature was introduced in GitLab 8.12.') success Entities::BroadcastMessage end params do diff --git a/lib/api/commits.rb b/lib/api/commits.rb index 9d23daafe95..ed3d2317b13 100644 --- a/lib/api/commits.rb +++ b/lib/api/commits.rb @@ -73,7 +73,7 @@ module API detail 'This feature was introduced in GitLab 8.13' end params do - requires :branch, type: String, desc: 'Name of the branch to commit into. To create a new branch, also provide `start_branch`.', allow_blank: false + requires :branch, type: String, desc: _('Name of the branch to commit into. To create a new branch, also provide `start_branch`.'), allow_blank: false requires :commit_message, type: String, desc: 'Commit message' requires :actions, type: Array, desc: 'Actions to perform in commit' do requires :action, type: String, desc: 'The action to perform, `create`, `delete`, `move`, `update`, `chmod`', values: %w[create update move delete chmod].freeze @@ -92,7 +92,7 @@ module API optional :last_commit_id, type: String, desc: 'Last known file commit id' end given action: ->(action) { action == 'chmod' } do - requires :execute_filemode, type: Boolean, desc: 'When `true/false` enables/disables the execute flag on the file.' + requires :execute_filemode, type: Boolean, desc: _('When `true/false` enables/disables the execute flag on the file.') end end optional :start_branch, type: String, desc: 'Name of the branch to start the new commit from' diff --git a/lib/api/deployments.rb b/lib/api/deployments.rb index 8706a971a1a..548b57b50dc 100644 --- a/lib/api/deployments.rb +++ b/lib/api/deployments.rb @@ -12,7 +12,7 @@ module API end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc 'Get all deployments of the project' do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::Deployment end params do @@ -29,7 +29,7 @@ module API # rubocop: enable CodeReuse/ActiveRecord desc 'Gets a specific deployment' do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::Deployment end params do diff --git a/lib/api/discussions.rb b/lib/api/discussions.rb index 91eb6a23701..3265326e312 100644 --- a/lib/api/discussions.rb +++ b/lib/api/discussions.rb @@ -138,7 +138,7 @@ module API notes = readable_discussion_notes(noteable, params[:discussion_id]) break not_found!("Discussion") if notes.empty? - break bad_request!("Discussion is an individual note.") unless notes.first.part_of_discussion? + break bad_request!(_("Discussion is an individual note.")) unless notes.first.part_of_discussion? opts = { note: params[:body], diff --git a/lib/api/environments.rb b/lib/api/environments.rb index 633f24d3c9a..7c8f567ab6e 100644 --- a/lib/api/environments.rb +++ b/lib/api/environments.rb @@ -13,7 +13,7 @@ module API end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc 'Get all environments of the project' do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::Environment end params do @@ -26,7 +26,7 @@ module API end desc 'Creates a new environment' do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::Environment end params do @@ -47,7 +47,7 @@ module API end desc 'Updates an existing environment' do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::Environment end params do @@ -70,7 +70,7 @@ module API end desc 'Deletes an existing environment' do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::Environment end params do diff --git a/lib/api/events.rb b/lib/api/events.rb index b98aa9f31e1..6b5b9c44946 100644 --- a/lib/api/events.rb +++ b/lib/api/events.rb @@ -33,7 +33,7 @@ module API allow_access_with_scope :read_user, if: -> (request) { request.get? } desc "List currently authenticated user's events" do - detail 'This feature was introduced in GitLab 9.3.' + detail _('This feature was introduced in GitLab 9.3.') success Entities::Event end params do @@ -58,7 +58,7 @@ module API allow_access_with_scope :read_user, if: -> (request) { request.get? } desc 'Get the contribution events of a specified user' do - detail 'This feature was introduced in GitLab 8.13.' + detail _('This feature was introduced in GitLab 8.13.') success Entities::Event end params do diff --git a/lib/api/files.rb b/lib/api/files.rb index ca59d330e1c..38fc315a18f 100644 --- a/lib/api/files.rb +++ b/lib/api/files.rb @@ -62,7 +62,7 @@ module API params :simple_file_params do requires :file_path, type: String, desc: 'The url encoded path to the file. Ex. lib%2Fclass%2Erb' - requires :branch, type: String, desc: 'Name of the branch to commit into. To create a new branch, also provide `start_branch`.', allow_blank: false + requires :branch, type: String, desc: _('Name of the branch to commit into. To create a new branch, also provide `start_branch`.'), allow_blank: false requires :commit_message, type: String, allow_blank: false, desc: 'Commit message' optional :start_branch, type: String, desc: 'Name of the branch to start the new commit from' optional :author_email, type: String, desc: 'The email of the author' diff --git a/lib/api/group_milestones.rb b/lib/api/group_milestones.rb index d4287e4a7c4..facf34c9d1d 100644 --- a/lib/api/group_milestones.rb +++ b/lib/api/group_milestones.rb @@ -82,7 +82,7 @@ module API end desc 'Get all merge requests for a single group milestone' do - detail 'This feature was introduced in GitLab 9.' + detail _('This feature was introduced in GitLab 9.') success Entities::MergeRequestBasic end params do diff --git a/lib/api/groups.rb b/lib/api/groups.rb index 64958ff982a..4ae2f75f514 100644 --- a/lib/api/groups.rb +++ b/lib/api/groups.rb @@ -106,7 +106,7 @@ module API present_groups params, groups end - desc 'Create a group. Available only for users who can create groups.' do + desc _('Create a group. Available only for users who can create groups.') do success Entities::Group end params do @@ -141,7 +141,7 @@ module API requires :id, type: String, desc: 'The ID of a group' end resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do - desc 'Update a group. Available only for users who can administrate groups.' do + desc _('Update a group. Available only for users who can administrate groups.') do success Entities::Group end params do @@ -160,7 +160,7 @@ module API end end - desc 'Get a single group, with containing projects.' do + desc _('Get a single group, with containing projects.') do success Entities::GroupDetail end params do @@ -180,7 +180,7 @@ module API present group, options end - desc 'Remove a group.' + desc _('Remove a group.') delete ":id" do group = find_group!(params[:id]) authorize! :admin_group, group @@ -193,7 +193,7 @@ module API accepted! end - desc 'Get a list of projects in this group.' do + desc _('Get a list of projects in this group.') do success Entities::Project end params do @@ -230,7 +230,7 @@ module API present options[:with].prepare_relation(projects), options end - desc 'Get a list of subgroups in this group.' do + desc _('Get a list of subgroups in this group.') do success Entities::Group end params do @@ -242,7 +242,7 @@ module API present_groups params, groups end - desc 'Transfer a project to the group namespace. Available only for admin.' do + desc _('Transfer a project to the group namespace. Available only for admin.') do success Entities::GroupDetail end params do diff --git a/lib/api/helpers/projects_helpers.rb b/lib/api/helpers/projects_helpers.rb index e6a72b949f9..1f60f11e0f7 100644 --- a/lib/api/helpers/projects_helpers.rb +++ b/lib/api/helpers/projects_helpers.rb @@ -19,7 +19,7 @@ module API optional :resolve_outdated_diff_discussions, type: Boolean, desc: 'Automatically resolve merge request diffs discussions on lines changed with a push' optional :container_registry_enabled, type: Boolean, desc: 'Flag indication if the container registry is enabled for that project' optional :lfs_enabled, type: Boolean, desc: 'Flag indication if Git LFS is enabled for that project' - optional :visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: 'The visibility of the project.' + optional :visibility, type: String, values: Gitlab::VisibilityLevel.string_values, desc: _('The visibility of the project.') optional :public_builds, type: Boolean, desc: 'Perform public builds' optional :request_access_enabled, type: Boolean, desc: 'Allow users to request member access' optional :only_allow_merge_if_pipeline_succeeds, type: Boolean, desc: 'Only allow to merge if builds succeed' diff --git a/lib/api/helpers/runner.rb b/lib/api/helpers/runner.rb index 45d0343bc89..5ab5677a3a9 100644 --- a/lib/api/helpers/runner.rb +++ b/lib/api/helpers/runner.rb @@ -39,8 +39,8 @@ module API yield if block_given? project = job.project - forbidden!('Project has been deleted!') if project.nil? || project.pending_delete? - forbidden!('Job has been erased!') if job.erased? + forbidden!(_('Project has been deleted!')) if project.nil? || project.pending_delete? + forbidden!(_('Job has been erased!')) if job.erased? end def authenticate_job! diff --git a/lib/api/helpers/version.rb b/lib/api/helpers/version.rb index 7f53094e90c..1ef1693d81a 100644 --- a/lib/api/helpers/version.rb +++ b/lib/api/helpers/version.rb @@ -9,7 +9,7 @@ module API @version = version.to_s unless API.versions.include?(version) - raise ArgumentError, 'Unknown API version!' + raise ArgumentError, _('Unknown API version!') end end diff --git a/lib/api/import_github.rb b/lib/api/import_github.rb index bb4e536cf57..e7b882a7c23 100644 --- a/lib/api/import_github.rb +++ b/lib/api/import_github.rb @@ -23,7 +23,7 @@ module API end desc 'Import a GitHub project' do - detail 'This feature was introduced in GitLab 11.3.4.' + detail _('This feature was introduced in GitLab 11.3.4.') success Entities::ProjectEntity end params do diff --git a/lib/api/internal.rb b/lib/api/internal.rb index 9488b3469d9..2d190abf989 100644 --- a/lib/api/internal.rb +++ b/lib/api/internal.rb @@ -112,9 +112,9 @@ module API actor.update_last_used_at elsif params[:user_id] actor = User.find_by(id: params[:user_id]) - raise ActiveRecord::RecordNotFound.new("No such user id!") unless actor + raise ActiveRecord::RecordNotFound.new(_("No such user id!")) unless actor else - raise ActiveRecord::RecordNotFound.new("No key_id or user_id passed!") + raise ActiveRecord::RecordNotFound.new(_("No key_id or user_id passed!")) end token_handler = Gitlab::LfsToken.new(actor) diff --git a/lib/api/issues.rb b/lib/api/issues.rb index dac700482b4..bedb1925a96 100644 --- a/lib/api/issues.rb +++ b/lib/api/issues.rb @@ -38,9 +38,9 @@ module API optional :labels, type: String, desc: 'Comma-separated list of label names' optional :milestone, type: String, desc: 'Milestone title' optional :order_by, type: String, values: %w[created_at updated_at], default: 'created_at', - desc: 'Return issues ordered by `created_at` or `updated_at` fields.' + desc: _('Return issues ordered by `created_at` or `updated_at` fields.') optional :sort, type: String, values: %w[asc desc], default: 'desc', - desc: 'Return issues sorted in `asc` or `desc` order.' + desc: _('Return issues sorted in `asc` or `desc` order.') optional :milestone, type: String, desc: 'Return issues for a specific milestone' optional :iids, type: Array[Integer], desc: 'The IID array of issues' optional :search, type: String, desc: 'Search issues for text present in the title or description' @@ -171,13 +171,13 @@ module API params do requires :title, type: String, desc: 'The title of an issue' optional :created_at, type: DateTime, - desc: 'Date time when the issue was created. Available only for admins and project owners.' + desc: _('Date time when the issue was created. Available only for admins and project owners.') optional :merge_request_to_resolve_discussions_of, type: Integer, desc: 'The IID of a merge request for which to resolve discussions' optional :discussion_to_resolve, type: String, desc: 'The ID of a discussion to resolve, also pass `merge_request_to_resolve_discussions_of`' optional :iid, type: Integer, - desc: 'The internal ID of a project issue. Available only for admins and project owners.' + desc: _('The internal ID of a project issue. Available only for admins and project owners.') use :issue_params end @@ -215,7 +215,7 @@ module API requires :issue_iid, type: Integer, desc: 'The internal ID of a project issue' optional :title, type: String, desc: 'The title of an issue' optional :updated_at, type: DateTime, - desc: 'Date time when the issue was updated. Available only for admins and project owners.' + desc: _('Date time when the issue was updated. Available only for admins and project owners.') optional :state_event, type: String, values: %w[reopen close], desc: 'State of the issue' use :issue_params at_least_one_of :title, :description, :assignee_ids, :assignee_id, :milestone_id, :discussion_locked, diff --git a/lib/api/jobs.rb b/lib/api/jobs.rb index 45c694b6448..66a941dda84 100644 --- a/lib/api/jobs.rb +++ b/lib/api/jobs.rb @@ -150,7 +150,7 @@ module API build = find_build!(params[:job_id]) authorize!(:erase_build, build) - break forbidden!('Job is not erasable!') unless build.erasable? + break forbidden!(_('Job is not erasable!')) unless build.erasable? build.erase(erased_by: current_user) present build, with: Entities::Job diff --git a/lib/api/labels.rb b/lib/api/labels.rb index 2e676b0aa6b..22efc32d8b5 100644 --- a/lib/api/labels.rb +++ b/lib/api/labels.rb @@ -65,7 +65,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Update an existing label. At least one optional parameter is required.' do + desc _('Update an existing label. At least one optional parameter is required.') do success Entities::Label end params do diff --git a/lib/api/markdown.rb b/lib/api/markdown.rb index de77bef43ce..63986e2fd1a 100644 --- a/lib/api/markdown.rb +++ b/lib/api/markdown.rb @@ -9,7 +9,7 @@ module API end resource :markdown do desc "Render markdown text" do - detail "This feature was introduced in GitLab 11.0." + detail _("This feature was introduced in GitLab 11.0.") end post do context = { only_path: false, current_user: current_user } diff --git a/lib/api/members.rb b/lib/api/members.rb index 461ffe71a62..03f45858a33 100644 --- a/lib/api/members.rb +++ b/lib/api/members.rb @@ -13,7 +13,7 @@ module API requires :id, type: String, desc: "The #{source_type} ID" end resource source_type.pluralize, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do - desc 'Gets a list of group or project members viewable by the authenticated user.' do + desc _('Gets a list of group or project members viewable by the authenticated user.') do success Entities::Member end params do @@ -32,7 +32,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Gets a list of group or project members viewable by the authenticated user, including those who gained membership through ancestor group.' do + desc _('Gets a list of group or project members viewable by the authenticated user, including those who gained membership through ancestor group.') do success Entities::Member end params do @@ -51,7 +51,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Gets a member of a group or project.' do + desc _('Gets a member of a group or project.') do success Entities::Member end params do @@ -68,7 +68,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Adds a member to a group or project.' do + desc _('Adds a member to a group or project.') do success Entities::Member end params do @@ -99,7 +99,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Updates a member of a group or project.' do + desc _('Updates a member of a group or project.') do success Entities::Member end params do @@ -126,7 +126,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Removes a user from a group or project.' + desc _('Removes a user from a group or project.') params do requires :user_id, type: Integer, desc: 'The user ID of the member' end diff --git a/lib/api/merge_request_diffs.rb b/lib/api/merge_request_diffs.rb index 6ad30aa56e0..adf39316df3 100644 --- a/lib/api/merge_request_diffs.rb +++ b/lib/api/merge_request_diffs.rb @@ -12,7 +12,7 @@ module API end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc 'Get a list of merge request diff versions' do - detail 'This feature was introduced in GitLab 8.12.' + detail _('This feature was introduced in GitLab 8.12.') success Entities::MergeRequestDiff end @@ -27,7 +27,7 @@ module API end desc 'Get a single merge request diff version' do - detail 'This feature was introduced in GitLab 8.12.' + detail _('This feature was introduced in GitLab 8.12.') success Entities::MergeRequestDiffFull end diff --git a/lib/api/merge_requests.rb b/lib/api/merge_requests.rb index 132b19164d0..b28456f7e60 100644 --- a/lib/api/merge_requests.rb +++ b/lib/api/merge_requests.rb @@ -91,9 +91,9 @@ module API optional :state, type: String, values: %w[opened closed locked merged all], default: 'all', desc: 'Return opened, closed, locked, merged, or all merge requests' optional :order_by, type: String, values: %w[created_at updated_at], default: 'created_at', - desc: 'Return merge requests ordered by `created_at` or `updated_at` fields.' + desc: _('Return merge requests ordered by `created_at` or `updated_at` fields.') optional :sort, type: String, values: %w[asc desc], default: 'desc', - desc: 'Return merge requests sorted in `asc` or `desc` order.' + desc: _('Return merge requests sorted in `asc` or `desc` order.') optional :milestone, type: String, desc: 'Return merge requests for a specific milestone' optional :labels, type: String, desc: 'Comma-separated list of label names' optional :created_after, type: DateTime, desc: 'Return merge requests created after the specified time' diff --git a/lib/api/notes.rb b/lib/api/notes.rb index 1bdf7aeb119..f5ddc3a0415 100644 --- a/lib/api/notes.rb +++ b/lib/api/notes.rb @@ -25,9 +25,9 @@ module API params do requires :noteable_id, type: Integer, desc: 'The ID of the noteable' optional :order_by, type: String, values: %w[created_at updated_at], default: 'created_at', - desc: 'Return notes ordered by `created_at` or `updated_at` fields.' + desc: _('Return notes ordered by `created_at` or `updated_at` fields.') optional :sort, type: String, values: %w[asc desc], default: 'desc', - desc: 'Return notes sorted in `asc` or `desc` order.' + desc: _('Return notes sorted in `asc` or `desc` order.') use :pagination end # rubocop: disable CodeReuse/ActiveRecord diff --git a/lib/api/pipelines.rb b/lib/api/pipelines.rb index 7a7b23d2bbb..06a0977696b 100644 --- a/lib/api/pipelines.rb +++ b/lib/api/pipelines.rb @@ -11,7 +11,7 @@ module API end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc 'Get all Pipelines of the project' do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::PipelineBasic end params do @@ -97,7 +97,7 @@ module API end desc 'Retry builds in the pipeline' do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::Pipeline end params do @@ -112,7 +112,7 @@ module API end desc 'Cancel all builds in the pipeline' do - detail 'This feature was introduced in GitLab 8.11.' + detail _('This feature was introduced in GitLab 8.11.') success Entities::Pipeline end params do diff --git a/lib/api/project_clusters.rb b/lib/api/project_clusters.rb index c96261a7b57..bfb837563de 100644 --- a/lib/api/project_clusters.rb +++ b/lib/api/project_clusters.rb @@ -21,7 +21,7 @@ module API end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc 'Get all clusters from the project' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Cluster end params do @@ -34,7 +34,7 @@ module API end desc 'Get specific cluster for the project' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::ClusterProject end params do @@ -47,7 +47,7 @@ module API end desc 'Adds an existing cluster' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::ClusterProject end params do @@ -77,7 +77,7 @@ module API end desc 'Update an existing cluster' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::ClusterProject end params do @@ -104,7 +104,7 @@ module API end desc 'Remove a cluster' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::ClusterProject end params do diff --git a/lib/api/project_export.rb b/lib/api/project_export.rb index e34ed0bdb44..62f97a1065e 100644 --- a/lib/api/project_export.rb +++ b/lib/api/project_export.rb @@ -12,7 +12,7 @@ module API end resource :projects, requirements: { id: %r{[^/]+} } do desc 'Get export status' do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') success Entities::ProjectExportStatus end get ':id/export' do @@ -20,7 +20,7 @@ module API end desc 'Download export' do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') end get ':id/export/download' do if user_project.export_file_exists? @@ -31,7 +31,7 @@ module API end desc 'Start export' do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') end params do optional :description, type: String, desc: 'Override the project description' diff --git a/lib/api/project_import.rb b/lib/api/project_import.rb index c64ec2fcc95..2e9ae36b662 100644 --- a/lib/api/project_import.rb +++ b/lib/api/project_import.rb @@ -27,7 +27,7 @@ module API params do requires :path, type: String, desc: 'The new project path and name' requires :file, type: File, desc: 'The project export file to be imported' - optional :namespace, type: String, desc: "The ID or name of the namespace that the project will be imported into. Defaults to the current user's namespace." + optional :namespace, type: String, desc: _("The ID or name of the namespace that the project will be imported into. Defaults to the current user's namespace.") optional :overwrite, type: Boolean, default: false, desc: 'If there is a project in the same namespace and with the same name overwrite it' optional :override_params, type: Hash, @@ -36,7 +36,7 @@ module API end end desc 'Create a new project import' do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') success Entities::ProjectImportStatus end post 'import' do @@ -72,7 +72,7 @@ module API requires :id, type: String, desc: 'The ID of a project' end desc 'Get a project export status' do - detail 'This feature was introduced in GitLab 10.6.' + detail _('This feature was introduced in GitLab 10.6.') success Entities::ProjectImportStatus end get ':id/import' do diff --git a/lib/api/project_milestones.rb b/lib/api/project_milestones.rb index da31bcb8dac..b8908c8283f 100644 --- a/lib/api/project_milestones.rb +++ b/lib/api/project_milestones.rb @@ -86,7 +86,7 @@ module API end desc 'Get all merge requests for a single project milestone' do - detail 'This feature was introduced in GitLab 9.' + detail _('This feature was introduced in GitLab 9.') success Entities::MergeRequestBasic end params do diff --git a/lib/api/projects.rb b/lib/api/projects.rb index 9f3a1699146..9653bbc44e6 100644 --- a/lib/api/projects.rb +++ b/lib/api/projects.rb @@ -97,7 +97,7 @@ module API end params :create_params do - optional :namespace_id, type: Integer, desc: 'Namespace ID for the new project. Default to the user namespace.' + optional :namespace_id, type: Integer, desc: _('Namespace ID for the new project. Default to the user namespace.') optional :import_url, type: String, desc: 'URL from which the project is imported' end @@ -190,7 +190,7 @@ module API end end - desc 'Create new project for a specified user. Only available to admin users.' do + desc _('Create new project for a specified user. Only available to admin users.') do success Entities::Project end params do @@ -249,7 +249,7 @@ module API present project, options end - desc 'Fork new project for the current user or provided namespace.' do + desc _('Fork new project for the current user or provided namespace.') do success Entities::Project end params do @@ -493,7 +493,7 @@ module API end desc 'Start the housekeeping task for a project' do - detail 'This feature was introduced in GitLab 9.0.' + detail _('This feature was introduced in GitLab 9.0.') end post ':id/housekeeping' do authorize_admin_project diff --git a/lib/api/protected_tags.rb b/lib/api/protected_tags.rb index ee13473c848..519b23c280f 100644 --- a/lib/api/protected_tags.rb +++ b/lib/api/protected_tags.rb @@ -13,7 +13,7 @@ module API end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc "Get a project's protected tags" do - detail 'This feature was introduced in GitLab 11.3.' + detail _('This feature was introduced in GitLab 11.3.') success Entities::ProtectedTag end params do @@ -28,7 +28,7 @@ module API # rubocop: enable CodeReuse/ActiveRecord desc 'Get a single protected tag' do - detail 'This feature was introduced in GitLab 11.3.' + detail _('This feature was introduced in GitLab 11.3.') success Entities::ProtectedTag end params do @@ -43,7 +43,7 @@ module API # rubocop: enable CodeReuse/ActiveRecord desc 'Protect a single tag or wildcard' do - detail 'This feature was introduced in GitLab 11.3.' + detail _('This feature was introduced in GitLab 11.3.') success Entities::ProtectedTag end params do @@ -70,7 +70,7 @@ module API end desc 'Unprotect a single tag' do - detail 'This feature was introduced in GitLab 11.3.' + detail _('This feature was introduced in GitLab 11.3.') end params do requires :name, type: String, desc: 'The name of the protected tag' diff --git a/lib/api/release/links.rb b/lib/api/release/links.rb index e3072684ef7..9addf8adf0a 100644 --- a/lib/api/release/links.rb +++ b/lib/api/release/links.rb @@ -18,7 +18,7 @@ module API resource 'releases/:tag_name', requirements: RELEASE_ENDPOINT_REQUIREMETS do resource :assets do desc 'Get a list of links of a release' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Releases::Link end params do @@ -31,7 +31,7 @@ module API end desc 'Create a link of a release' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Releases::Link end params do @@ -55,7 +55,7 @@ module API end resource 'links/:link_id' do desc 'Get a link detail of a release' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Releases::Link end get do @@ -65,7 +65,7 @@ module API end desc 'Update a link of a release' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Releases::Link end params do @@ -84,7 +84,7 @@ module API end desc 'Delete a link of a release' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Releases::Link end delete do diff --git a/lib/api/releases.rb b/lib/api/releases.rb index 576fee51db0..1a06004bcb6 100644 --- a/lib/api/releases.rb +++ b/lib/api/releases.rb @@ -14,7 +14,7 @@ module API end resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc 'Get a project releases' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Release end params do @@ -27,7 +27,7 @@ module API end desc 'Get a single project release' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Release end params do @@ -40,7 +40,7 @@ module API end desc 'Create a new release' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Release end params do @@ -70,7 +70,7 @@ module API end desc 'Update a release' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Release end params do @@ -93,7 +93,7 @@ module API end desc 'Delete a release' do - detail 'This feature was introduced in GitLab 11.7.' + detail _('This feature was introduced in GitLab 11.7.') success Entities::Release end params do diff --git a/lib/api/runner.rb b/lib/api/runner.rb index c60d25b88cb..50ca31925b9 100644 --- a/lib/api/runner.rb +++ b/lib/api/runner.rb @@ -259,12 +259,12 @@ module API require_gitlab_workhorse! job = authenticate_job! - forbidden!('Job is not running!') unless job.running? + forbidden!(_('Job is not running!')) unless job.running? artifacts = UploadedFile.from_params(params, :file, JobArtifactUploader.workhorse_local_upload_path) metadata = UploadedFile.from_params(params, :metadata, JobArtifactUploader.workhorse_local_upload_path) - bad_request!('Missing artifacts file!') unless artifacts + bad_request!(_('Missing artifacts file!')) unless artifacts file_to_large! unless artifacts.size < max_artifacts_size expire_in = params['expire_in'] || diff --git a/lib/api/search.rb b/lib/api/search.rb index f5db692afe5..b4f439d39c2 100644 --- a/lib/api/search.rb +++ b/lib/api/search.rb @@ -49,7 +49,7 @@ module API resource :search do desc 'Search on GitLab' do - detail 'This feature was introduced in GitLab 10.5.' + detail _('This feature was introduced in GitLab 10.5.') end params do requires :search, type: String, desc: 'The expression it should be searched for' @@ -67,7 +67,7 @@ module API resource :groups, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc 'Search on GitLab' do - detail 'This feature was introduced in GitLab 10.5.' + detail _('This feature was introduced in GitLab 10.5.') end params do requires :id, type: String, desc: 'The ID of a group' @@ -86,7 +86,7 @@ module API resource :projects, requirements: API::NAMESPACE_OR_PROJECT_REQUIREMENTS do desc 'Search on GitLab' do - detail 'This feature was introduced in GitLab 10.5.' + detail _('This feature was introduced in GitLab 10.5.') end params do requires :id, type: String, desc: 'The ID of a project' diff --git a/lib/api/settings.rb b/lib/api/settings.rb index 95371961398..8706c695dec 100644 --- a/lib/api/settings.rb +++ b/lib/api/settings.rb @@ -22,7 +22,7 @@ module API success Entities::ApplicationSetting end params do - optional :admin_notification_email, type: String, desc: 'Abuse reports will be sent to this address if it is set. Abuse reports are always available in the admin area.' + optional :admin_notification_email, type: String, desc: _('Abuse reports will be sent to this address if it is set. Abuse reports are always available in the admin area.') optional :after_sign_up_text, type: String, desc: 'Text shown after sign up' optional :after_sign_out_path, type: String, desc: 'We will redirect users to this page after they sign out' optional :akismet_enabled, type: Boolean, desc: 'Helps prevent bots from creating issues' @@ -46,11 +46,11 @@ module API requires :domain_blacklist, type: String, desc: 'Users with e-mail addresses that match these domain(s) will NOT be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com' end optional :domain_whitelist, type: String, desc: 'ONLY users with e-mail addresses that match these domain(s) will be able to sign-up. Wildcards allowed. Use separate lines for multiple entries. Ex: domain.com, *.domain.com' - optional :email_author_in_body, type: Boolean, desc: 'Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue, merge request or comment in the email body instead.' - optional :enabled_git_access_protocol, type: String, values: %w[ssh http nil], desc: 'Allow only the selected protocols to be used for Git access.' - optional :gitaly_timeout_default, type: Integer, desc: 'Default Gitaly timeout, in seconds. Set to 0 to disable timeouts.' - optional :gitaly_timeout_fast, type: Integer, desc: 'Gitaly fast operation timeout, in seconds. Set to 0 to disable timeouts.' - optional :gitaly_timeout_medium, type: Integer, desc: 'Medium Gitaly timeout, in seconds. Set to 0 to disable timeouts.' + optional :email_author_in_body, type: Boolean, desc: _('Some email servers do not support overriding the email sender name. Enable this option to include the name of the author of the issue, merge request or comment in the email body instead.') + optional :enabled_git_access_protocol, type: String, values: %w[ssh http nil], desc: _('Allow only the selected protocols to be used for Git access.') + optional :gitaly_timeout_default, type: Integer, desc: _('Default Gitaly timeout, in seconds. Set to 0 to disable timeouts.') + optional :gitaly_timeout_fast, type: Integer, desc: _('Gitaly fast operation timeout, in seconds. Set to 0 to disable timeouts.') + optional :gitaly_timeout_medium, type: Integer, desc: _('Medium Gitaly timeout, in seconds. Set to 0 to disable timeouts.') optional :gravatar_enabled, type: Boolean, desc: 'Flag indicating if the Gravatar service is enabled' optional :help_page_hide_commercial_content, type: Boolean, desc: 'Hide marketing-related entries from help' optional :help_page_support_url, type: String, desc: 'Alternate support URL for help page' @@ -58,12 +58,12 @@ module API optional :home_page_url, type: String, desc: 'We will redirect non-logged in users to this page' optional :housekeeping_enabled, type: Boolean, desc: 'Enable automatic repository housekeeping (git repack, git gc)' given housekeeping_enabled: ->(val) { val } do - requires :housekeeping_bitmaps_enabled, type: Boolean, desc: "Creating pack file bitmaps makes housekeeping take a little longer but bitmaps should accelerate 'git clone' performance." - requires :housekeeping_full_repack_period, type: Integer, desc: "Number of Git pushes after which a full 'git repack' is run." - requires :housekeeping_gc_period, type: Integer, desc: "Number of Git pushes after which 'git gc' is run." - requires :housekeeping_incremental_repack_period, type: Integer, desc: "Number of Git pushes after which an incremental 'git repack' is run." + requires :housekeeping_bitmaps_enabled, type: Boolean, desc: _("Creating pack file bitmaps makes housekeeping take a little longer but bitmaps should accelerate 'git clone' performance.") + requires :housekeeping_full_repack_period, type: Integer, desc: _("Number of Git pushes after which a full 'git repack' is run.") + requires :housekeeping_gc_period, type: Integer, desc: _("Number of Git pushes after which 'git gc' is run.") + requires :housekeeping_incremental_repack_period, type: Integer, desc: _("Number of Git pushes after which an incremental 'git repack' is run.") end - optional :html_emails_enabled, type: Boolean, desc: 'By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format.' + optional :html_emails_enabled, type: Boolean, desc: _('By default GitLab sends emails in HTML and plain text formats so mail clients can choose what format to use. Disable this option if you only want to send emails in plain text format.') optional :import_sources, type: Array[String], values: %w[github bitbucket gitlab google_code fogbugz git gitlab_project manifest], desc: 'Enabled sources for code import during project creation. OmniAuth must be configured for GitHub, Bitbucket, and GitLab.com' optional :max_artifacts_size, type: Integer, desc: "Set the maximum file size for each job's artifacts" @@ -72,7 +72,7 @@ module API optional :metrics_enabled, type: Boolean, desc: 'Enable the InfluxDB metrics' given metrics_enabled: ->(val) { val } do requires :metrics_host, type: String, desc: 'The InfluxDB host' - requires :metrics_method_call_threshold, type: Integer, desc: 'A method call is only tracked when it takes longer to complete than the given amount of milliseconds.' + requires :metrics_method_call_threshold, type: Integer, desc: _('A method call is only tracked when it takes longer to complete than the given amount of milliseconds.') requires :metrics_packet_size, type: Integer, desc: 'The amount of points to store in a single UDP packet' requires :metrics_pool_size, type: Integer, desc: 'The amount of InfluxDB connections to open' requires :metrics_port, type: Integer, desc: 'The UDP port to use for connecting to InfluxDB' @@ -84,13 +84,13 @@ module API mutually_exclusive :password_authentication_enabled_for_web, :password_authentication_enabled, :signin_enabled optional :password_authentication_enabled_for_git, type: Boolean, desc: 'Flag indicating if password authentication is enabled for Git over HTTP(S)' optional :performance_bar_allowed_group_id, type: String, desc: 'Deprecated: Use :performance_bar_allowed_group_path instead. Path of the group that is allowed to toggle the performance bar.' # support legacy names, can be removed in v6 - optional :performance_bar_allowed_group_path, type: String, desc: 'Path of the group that is allowed to toggle the performance bar.' + optional :performance_bar_allowed_group_path, type: String, desc: _('Path of the group that is allowed to toggle the performance bar.') optional :performance_bar_enabled, type: String, desc: 'Deprecated: Pass `performance_bar_allowed_group_path: nil` instead. Allow enabling the performance.' # support legacy names, can be removed in v6 optional :plantuml_enabled, type: Boolean, desc: 'Enable PlantUML' given plantuml_enabled: ->(val) { val } do requires :plantuml_url, type: String, desc: 'The PlantUML server URL' end - optional :polling_interval_multiplier, type: BigDecimal, desc: 'Interval multiplier used by endpoints that perform polling. Set to 0 to disable polling.' + optional :polling_interval_multiplier, type: BigDecimal, desc: _('Interval multiplier used by endpoints that perform polling. Set to 0 to disable polling.') optional :project_export_enabled, type: Boolean, desc: 'Enable project export' optional :prometheus_metrics_enabled, type: Boolean, desc: 'Enable Prometheus metrics' optional :recaptcha_enabled, type: Boolean, desc: 'Helps prevent bots from creating accounts' @@ -98,19 +98,19 @@ module API requires :recaptcha_site_key, type: String, desc: 'Generate site key at http://www.google.com/recaptcha' requires :recaptcha_private_key, type: String, desc: 'Generate private key at http://www.google.com/recaptcha' end - optional :repository_checks_enabled, type: Boolean, desc: "GitLab will periodically run 'git fsck' in all project and wiki repositories to look for silent disk corruption issues." + optional :repository_checks_enabled, type: Boolean, desc: _("GitLab will periodically run 'git fsck' in all project and wiki repositories to look for silent disk corruption issues.") optional :repository_storages, type: Array[String], desc: 'Storage paths for new projects' optional :require_two_factor_authentication, type: Boolean, desc: 'Require all users to set up Two-factor authentication' given require_two_factor_authentication: ->(val) { val } do requires :two_factor_grace_period, type: Integer, desc: 'Amount of time (in hours) that users are allowed to skip forced configuration of two-factor authentication' end - optional :restricted_visibility_levels, type: Array[String], desc: 'Selected levels cannot be used by non-admin users for groups, projects or snippets. If the public level is restricted, user profiles are only visible to logged in users.' + optional :restricted_visibility_levels, type: Array[String], desc: _('Selected levels cannot be used by non-admin users for groups, projects or snippets. If the public level is restricted, user profiles are only visible to logged in users.') optional :send_user_confirmation_email, type: Boolean, desc: 'Send confirmation email on sign-up' optional :sentry_enabled, type: Boolean, desc: 'Sentry is an error reporting and logging tool which is currently not shipped with GitLab, get it here: https://getsentry.com' given sentry_enabled: ->(val) { val } do requires :sentry_dsn, type: String, desc: 'Sentry Data Source Name' end - optional :session_expire_delay, type: Integer, desc: 'Session duration in minutes. GitLab restart is required to apply changes.' + optional :session_expire_delay, type: Integer, desc: _('Session duration in minutes. GitLab restart is required to apply changes.') optional :shared_runners_enabled, type: Boolean, desc: 'Enable shared runners for new projects' given shared_runners_enabled: ->(val) { val } do requires :shared_runners_text, type: String, desc: 'Shared runners text ' @@ -118,8 +118,8 @@ module API optional :sign_in_text, type: String, desc: 'The sign in text of the GitLab application' optional :signin_enabled, type: Boolean, desc: 'Flag indicating if password authentication is enabled for the web interface' # support legacy names, can be removed in v5 optional :signup_enabled, type: Boolean, desc: 'Flag indicating if sign up is enabled' - optional :terminal_max_session_time, type: Integer, desc: 'Maximum time for web terminal websocket connection (in seconds). Set to 0 for unlimited time.' - optional :usage_ping_enabled, type: Boolean, desc: 'Every week GitLab will report license usage back to GitLab, Inc.' + optional :terminal_max_session_time, type: Integer, desc: _('Maximum time for web terminal websocket connection (in seconds). Set to 0 for unlimited time.') + optional :usage_ping_enabled, type: Boolean, desc: _('Every week GitLab will report license usage back to GitLab, Inc.') optional :instance_statistics_visibility_private, type: Boolean, desc: 'When set to `true` Instance statistics will only be available to admins' ApplicationSetting::SUPPORTED_KEY_TYPES.each do |type| diff --git a/lib/api/snippets.rb b/lib/api/snippets.rb index 326d55afd0e..cca0e055bc2 100644 --- a/lib/api/snippets.rb +++ b/lib/api/snippets.rb @@ -19,7 +19,7 @@ module API end desc 'Get a snippets list for authenticated user' do - detail 'This feature was introduced in GitLab 8.15.' + detail _('This feature was introduced in GitLab 8.15.') success Entities::PersonalSnippet end params do @@ -30,7 +30,7 @@ module API end desc 'List all public snippets current_user has access to' do - detail 'This feature was introduced in GitLab 8.15.' + detail _('This feature was introduced in GitLab 8.15.') success Entities::PersonalSnippet end params do @@ -41,7 +41,7 @@ module API end desc 'Get a single snippet' do - detail 'This feature was introduced in GitLab 8.15.' + detail _('This feature was introduced in GitLab 8.15.') success Entities::PersonalSnippet end params do @@ -53,7 +53,7 @@ module API end desc 'Create new snippet' do - detail 'This feature was introduced in GitLab 8.15.' + detail _('This feature was introduced in GitLab 8.15.') success Entities::PersonalSnippet end params do @@ -80,7 +80,7 @@ module API end desc 'Update an existing snippet' do - detail 'This feature was introduced in GitLab 8.15.' + detail _('This feature was introduced in GitLab 8.15.') success Entities::PersonalSnippet end params do @@ -116,7 +116,7 @@ module API # rubocop: enable CodeReuse/ActiveRecord desc 'Remove snippet' do - detail 'This feature was introduced in GitLab 8.15.' + detail _('This feature was introduced in GitLab 8.15.') success Entities::PersonalSnippet end params do @@ -134,7 +134,7 @@ module API # rubocop: enable CodeReuse/ActiveRecord desc 'Get a raw snippet' do - detail 'This feature was introduced in GitLab 8.15.' + detail _('This feature was introduced in GitLab 8.15.') end params do requires :id, type: Integer, desc: 'The ID of a snippet' diff --git a/lib/api/submodules.rb b/lib/api/submodules.rb index 72d7d994102..2c40458d8b9 100644 --- a/lib/api/submodules.rb +++ b/lib/api/submodules.rb @@ -23,10 +23,10 @@ module API success Entities::Commit end params do - requires :submodule, type: String, desc: 'Url encoded full path to submodule.' - requires :commit_sha, type: String, desc: 'Commit sha to update the submodule to.' - requires :branch, type: String, desc: 'Name of the branch to commit into.' - optional :commit_message, type: String, desc: 'Commit message. If no message is provided a default one will be set.' + requires :submodule, type: String, desc: _('Url encoded full path to submodule.') + requires :commit_sha, type: String, desc: _('Commit sha to update the submodule to.') + requires :branch, type: String, desc: _('Name of the branch to commit into.') + optional :commit_message, type: String, desc: _('Commit message. If no message is provided a default one will be set.') end put ":id/repository/submodules/:submodule", requirements: Files::FILE_ENDPOINT_REQUIREMENTS do authorize! :push_code, user_project diff --git a/lib/api/tags.rb b/lib/api/tags.rb index f5359fd316c..e1a78da1d4b 100644 --- a/lib/api/tags.rb +++ b/lib/api/tags.rb @@ -17,9 +17,9 @@ module API end params do optional :sort, type: String, values: %w[asc desc], default: 'desc', - desc: 'Return tags sorted in updated by `asc` or `desc` order.' + desc: _('Return tags sorted in updated by `asc` or `desc` order.') optional :order_by, type: String, values: %w[name updated], default: 'updated', - desc: 'Return tags ordered by `name` or `updated` fields.' + desc: _('Return tags ordered by `name` or `updated` fields.') optional :search, type: String, desc: 'Return list of tags matching the search criteria' use :pagination end @@ -45,7 +45,7 @@ module API end desc 'Create a new repository tag' do - detail 'This optional release_description parameter was deprecated in GitLab 11.7.' + detail _('This optional release_description parameter was deprecated in GitLab 11.7.') success Entities::Tag end params do @@ -105,7 +105,7 @@ module API end desc 'Add a release note to a tag' do - detail 'This feature was deprecated in GitLab 11.7.' + detail _('This feature was deprecated in GitLab 11.7.') success Entities::TagRelease end params do @@ -137,7 +137,7 @@ module API end desc "Update a tag's release note" do - detail 'This feature was deprecated in GitLab 11.7.' + detail _('This feature was deprecated in GitLab 11.7.') success Entities::TagRelease end params do diff --git a/lib/api/templates.rb b/lib/api/templates.rb index 51f357d9477..f9840007c05 100644 --- a/lib/api/templates.rb +++ b/lib/api/templates.rb @@ -24,7 +24,7 @@ module API end desc 'Get the list of the available license template' do - detail 'This feature was introduced in GitLab 8.7.' + detail _('This feature was introduced in GitLab 8.7.') success ::API::Entities::License end params do @@ -41,7 +41,7 @@ module API end desc 'Get the text for a specific license' do - detail 'This feature was introduced in GitLab 8.7.' + detail _('This feature was introduced in GitLab 8.7.') success ::API::Entities::License end params do diff --git a/lib/api/users.rb b/lib/api/users.rb index b41fce76df0..115f1d32218 100644 --- a/lib/api/users.rb +++ b/lib/api/users.rb @@ -142,7 +142,7 @@ module API present user.status || {}, with: Entities::UserStatus end - desc 'Create a user. Available only for admins.' do + desc _('Create a user. Available only for admins.') do success Entities::UserPublic end params do @@ -176,7 +176,7 @@ module API end end - desc 'Update a user. Available only for admins.' do + desc _('Update a user. Available only for admins.') do success Entities::UserPublic end params do @@ -229,7 +229,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Add an SSH key to a specified user. Available only for admins.' do + desc _('Add an SSH key to a specified user. Available only for admins.') do success Entities::SSHKey end params do @@ -254,7 +254,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Get the SSH keys of a specified user.' do + desc _('Get the SSH keys of a specified user.') do success Entities::SSHKey end params do @@ -270,7 +270,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Delete an existing SSH key from a specified user. Available only for admins.' do + desc _('Delete an existing SSH key from a specified user. Available only for admins.') do success Entities::SSHKey end params do @@ -291,7 +291,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Add a GPG key to a specified user. Available only for admins.' do + desc _('Add a GPG key to a specified user. Available only for admins.') do detail 'This feature was added in GitLab 10.0' success Entities::GPGKey end @@ -316,7 +316,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Get the GPG keys of a specified user. Available only for admins.' do + desc _('Get the GPG keys of a specified user. Available only for admins.') do detail 'This feature was added in GitLab 10.0' success Entities::GPGKey end @@ -335,7 +335,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Delete an existing GPG key from a specified user. Available only for admins.' do + desc _('Delete an existing GPG key from a specified user. Available only for admins.') do detail 'This feature was added in GitLab 10.0' end params do @@ -357,7 +357,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Revokes an existing GPG key from a specified user. Available only for admins.' do + desc _('Revokes an existing GPG key from a specified user. Available only for admins.') do detail 'This feature was added in GitLab 10.0' end params do @@ -379,7 +379,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Add an email address to a specified user. Available only for admins.' do + desc _('Add an email address to a specified user. Available only for admins.') do success Entities::Email end params do @@ -404,7 +404,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Get the emails addresses of a specified user. Available only for admins.' do + desc _('Get the emails addresses of a specified user. Available only for admins.') do success Entities::Email end params do @@ -421,7 +421,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Delete an email address of a specified user. Available only for admins.' do + desc _('Delete an email address of a specified user. Available only for admins.') do success Entities::Email end params do @@ -443,7 +443,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Delete a user. Available only for admins.' do + desc _('Delete a user. Available only for admins.') do success Entities::Email end params do @@ -465,7 +465,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Block a user. Available only for admins.' + desc _('Block a user. Available only for admins.') params do requires :id, type: Integer, desc: 'The ID of the user' end @@ -483,7 +483,7 @@ module API end # rubocop: enable CodeReuse/ActiveRecord - desc 'Unblock a user. Available only for admins.' + desc _('Unblock a user. Available only for admins.') params do requires :id, type: Integer, desc: 'The ID of the user' end @@ -519,7 +519,7 @@ module API before { authenticated_as_admin! } - desc 'Retrieve impersonation tokens. Available only for admins.' do + desc _('Retrieve impersonation tokens. Available only for admins.') do detail 'This feature was introduced in GitLab 9.0' success Entities::ImpersonationToken end @@ -529,7 +529,7 @@ module API end get { present paginate(finder(declared_params(include_missing: false)).execute), with: Entities::ImpersonationToken } - desc 'Create a impersonation token. Available only for admins.' do + desc _('Create a impersonation token. Available only for admins.') do detail 'This feature was introduced in GitLab 9.0' success Entities::ImpersonationTokenWithToken end @@ -548,7 +548,7 @@ module API end end - desc 'Retrieve impersonation token. Available only for admins.' do + desc _('Retrieve impersonation token. Available only for admins.') do detail 'This feature was introduced in GitLab 9.0' success Entities::ImpersonationToken end @@ -559,7 +559,7 @@ module API present find_impersonation_token, with: Entities::ImpersonationToken end - desc 'Revoke a impersonation token. Available only for admins.' do + desc _('Revoke a impersonation token. Available only for admins.') do detail 'This feature was introduced in GitLab 9.0' end params do diff --git a/lib/api/version.rb b/lib/api/version.rb index 74cd857f447..2dcce703b2a 100644 --- a/lib/api/version.rb +++ b/lib/api/version.rb @@ -4,8 +4,8 @@ module API class Version < Grape::API before { authenticate! } - desc 'Get the version information of the GitLab instance.' do - detail 'This feature was introduced in GitLab 8.13.' + desc _('Get the version information of the GitLab instance.') do + detail _('This feature was introduced in GitLab 8.13.') end get '/version' do { version: Gitlab::VERSION, revision: Gitlab.revision } diff --git a/lib/api/wikis.rb b/lib/api/wikis.rb index ef0e3decc2c..30a87069b38 100644 --- a/lib/api/wikis.rb +++ b/lib/api/wikis.rb @@ -98,7 +98,7 @@ module API end desc 'Upload an attachment to the wiki repository' do - detail 'This feature was introduced in GitLab 11.3.' + detail _('This feature was introduced in GitLab 11.3.') success Entities::WikiAttachment end params do |