diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb index d6fff1c36da66e5dcc037b36371efcdb33f2b93b..7e631053b54a80422d1194a444bfcf410878a3eb 100644 --- a/app/helpers/blob_helper.rb +++ b/app/helpers/blob_helper.rb @@ -77,7 +77,7 @@ def replace_blob_link(project = @project, ref = @ref, path = @path) project, ref, path, - label: "Replace", + label: _("Replace"), action: "replace", btn_class: "default", modal_type: "upload" @@ -89,7 +89,7 @@ def delete_blob_link(project = @project, ref = @ref, path = @path) project, ref, path, - label: "Delete", + label: _("Delete"), action: "delete", btn_class: "remove", modal_type: "remove" @@ -101,14 +101,14 @@ def can_modify_blob?(blob, project = @project, ref = @ref) end def leave_edit_message - "Leave edit mode?\nAll unsaved changes will be lost." + _("Leave edit mode? All unsaved changes will be lost.") end def editing_preview_title(filename) if Gitlab::MarkupHelper.previewable?(filename) - 'Preview' + _('Preview') else - 'Preview changes' + _('Preview changes') end end @@ -201,14 +201,14 @@ def open_raw_blob_button(blob) return if blob.empty? return if blob.binary? || blob.stored_externally? - title = 'Open raw' + title = _('Open raw') link_to icon('file-code-o'), blob_raw_path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end def download_blob_button(blob) return if blob.empty? - title = 'Download' + title = _('Download') link_to sprite_icon('download'), blob_raw_path(inline: false), download: @path, class: 'btn btn-sm has-tooltip', target: '_blank', rel: 'noopener noreferrer', title: title, data: { container: 'body' } end diff --git a/app/helpers/builds_helper.rb b/app/helpers/builds_helper.rb index 3c8caec3fe5733192d2434590d803ed2f8766547..a5fe6bb8f0799237edf6f18a6c55d3732b6d1c1c 100644 --- a/app/helpers/builds_helper.rb +++ b/app/helpers/builds_helper.rb @@ -4,12 +4,12 @@ module BuildsHelper def build_summary(build, skip: false) if build.has_trace? if skip - link_to "View job trace", pipeline_job_url(build.pipeline, build) + link_to _("View job trace"), pipeline_job_url(build.pipeline, build) else build.trace.html(last_lines: 10).html_safe end else - "No job trace" + _("No job trace") end end @@ -31,7 +31,7 @@ def javascript_build_options def build_failed_issue_options { - title: "Job Failed ##{@build.id}", + title: _("Job Failed #%{build_id}") % { build_id: @build.id }, description: project_job_url(@project, @build) } end diff --git a/app/helpers/button_helper.rb b/app/helpers/button_helper.rb index 27788988cf01089cb30936e9e04dfc6a1c03ee18..ca5aae8ea5664bc2d99d5fe659f33fcf142c403a 100644 --- a/app/helpers/button_helper.rb +++ b/app/helpers/button_helper.rb @@ -21,7 +21,7 @@ module ButtonHelper # See http://clipboardjs.com/#usage def clipboard_button(data = {}) css_class = data[:class] || 'btn-clipboard btn-transparent' - title = data[:title] || 'Copy to clipboard' + title = data[:title] || _('Copy to clipboard') button_text = data[:button_text] || '' hide_tooltip = data[:hide_tooltip] || false hide_button_icon = data[:hide_button_icon] || false diff --git a/app/helpers/form_helper.rb b/app/helpers/form_helper.rb index cdcd057d62b9d665a30a6684895c36b81fd245b8..dd4c6578d3ebaaed55c4e1a1c6324b8ccb0f6ca5 100644 --- a/app/helpers/form_helper.rb +++ b/app/helpers/form_helper.rb @@ -6,8 +6,7 @@ module FormHelper def form_errors(model, type: 'form') return unless model.errors.any? - pluralized = 'error'.pluralize(model.errors.count) - headline = "The #{type} contains the following #{pluralized}:" + headline = n_('The %{type} contains the following error:', 'The %{type} contains the following errors:', model.errors.count) % { type: type } content_tag(:div, class: 'alert alert-danger', id: 'error_explanation') do content_tag(:h4, headline) << @@ -26,7 +25,7 @@ def issue_assignees_dropdown_options title: 'Select assignee', filter: true, dropdown_class: 'dropdown-menu-user dropdown-menu-selectable dropdown-menu-assignee', - placeholder: 'Search users', + placeholder: _('Search users'), data: { first_user: current_user&.username, null_user: true, diff --git a/app/helpers/labels_helper.rb b/app/helpers/labels_helper.rb index bd53add80cacced8a47ecad3d9eb158cf966f509..8e10fd15f6a9c1e75964b0b0a4bf6f11f951edd0 100644 --- a/app/helpers/labels_helper.rb +++ b/app/helpers/labels_helper.rb @@ -181,8 +181,8 @@ def label_subscription_toggle_button_text(label, project = nil) def label_deletion_confirm_text(label) case label - when GroupLabel then 'Remove this label? This will affect all projects within the group. Are you sure?' - when ProjectLabel then 'Remove this label? Are you sure?' + when GroupLabel then _('Remove this label? This will affect all projects within the group. Are you sure?') + when ProjectLabel then _('Remove this label? Are you sure?') end end diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb index 72c3a860c61337da8f8d29804b543bf19c0857ab..ca8daa51bd7facf8af613250720ef1e8bd179cd4 100644 --- a/app/helpers/search_helper.rb +++ b/app/helpers/search_helper.rb @@ -30,7 +30,7 @@ def search_entries_info(collection, scope, term) to = collection.offset_value + collection.to_a.size count = collection.total_count - "Showing #{from} - #{to} of #{count} #{scope.humanize(capitalize: false)} for \"#{term}\"" + s_("SearchResults|Showing %{from} - %{to} of %{count} %{scope} for \"%{term}\"") % { from: from, to: to, count: count, scope: scope.humanize(capitalize: false), term: term } end def find_project_for_result_blob(projects, result) @@ -59,31 +59,31 @@ def search_service # Autocomplete results for various settings pages def default_autocomplete [ - { category: "Settings", label: "User settings", url: profile_path }, - { category: "Settings", label: "SSH Keys", url: profile_keys_path }, - { category: "Settings", label: "Dashboard", url: root_path } + { category: "Settings", label: _("User settings"), url: profile_path }, + { category: "Settings", label: _("SSH Keys"), url: profile_keys_path }, + { category: "Settings", label: _("Dashboard"), url: root_path } ] end # Autocomplete results for settings pages, for admins def default_autocomplete_admin [ - { category: "Settings", label: "Admin Section", url: admin_root_path } + { category: "Settings", label: _("Admin Section"), url: admin_root_path } ] end # Autocomplete results for internal help pages def help_autocomplete [ - { category: "Help", label: "API Help", url: help_page_path("api/README") }, - { category: "Help", label: "Markdown Help", url: help_page_path("user/markdown") }, - { category: "Help", label: "Permissions Help", url: help_page_path("user/permissions") }, - { category: "Help", label: "Public Access Help", url: help_page_path("public_access/public_access") }, - { category: "Help", label: "Rake Tasks Help", url: help_page_path("raketasks/README") }, - { category: "Help", label: "SSH Keys Help", url: help_page_path("ssh/README") }, - { category: "Help", label: "System Hooks Help", url: help_page_path("system_hooks/system_hooks") }, - { category: "Help", label: "Webhooks Help", url: help_page_path("user/project/integrations/webhooks") }, - { category: "Help", label: "Workflow Help", url: help_page_path("workflow/README") } + { category: "Help", label: _("API Help"), url: help_page_path("api/README") }, + { category: "Help", label: _("Markdown Help"), url: help_page_path("user/markdown") }, + { category: "Help", label: _("Permissions Help"), url: help_page_path("user/permissions") }, + { category: "Help", label: _("Public Access Help"), url: help_page_path("public_access/public_access") }, + { category: "Help", label: _("Rake Tasks Help"), url: help_page_path("raketasks/README") }, + { category: "Help", label: _("SSH Keys Help"), url: help_page_path("ssh/README") }, + { category: "Help", label: _("System Hooks Help"), url: help_page_path("system_hooks/system_hooks") }, + { category: "Help", label: _("Webhooks Help"), url: help_page_path("user/project/integrations/webhooks") }, + { category: "Help", label: _("Workflow Help"), url: help_page_path("workflow/README") } ] end @@ -93,16 +93,16 @@ def project_autocomplete ref = @ref || @project.repository.root_ref [ - { category: "In this project", label: "Files", url: project_tree_path(@project, ref) }, - { category: "In this project", label: "Commits", url: project_commits_path(@project, ref) }, - { category: "In this project", label: "Network", url: project_network_path(@project, ref) }, - { category: "In this project", label: "Graph", url: project_graph_path(@project, ref) }, - { category: "In this project", label: "Issues", url: project_issues_path(@project) }, - { category: "In this project", label: "Merge Requests", url: project_merge_requests_path(@project) }, - { category: "In this project", label: "Milestones", url: project_milestones_path(@project) }, - { category: "In this project", label: "Snippets", url: project_snippets_path(@project) }, - { category: "In this project", label: "Members", url: project_project_members_path(@project) }, - { category: "In this project", label: "Wiki", url: project_wikis_path(@project) } + { category: "In this project", label: _("Files"), url: project_tree_path(@project, ref) }, + { category: "In this project", label: _("Commits"), url: project_commits_path(@project, ref) }, + { category: "In this project", label: _("Network"), url: project_network_path(@project, ref) }, + { category: "In this project", label: _("Graph"), url: project_graph_path(@project, ref) }, + { category: "In this project", label: _("Issues"), url: project_issues_path(@project) }, + { category: "In this project", label: _("Merge Requests"), url: project_merge_requests_path(@project) }, + { category: "In this project", label: _("Milestones"), url: project_milestones_path(@project) }, + { category: "In this project", label: _("Snippets"), url: project_snippets_path(@project) }, + { category: "In this project", label: _("Members"), url: project_project_members_path(@project) }, + { category: "In this project", label: _("Wiki"), url: project_wikis_path(@project) } ] else [] @@ -162,7 +162,7 @@ def search_filter_input_options(type) opts = { id: "filtered-search-#{type}", - placeholder: 'Search or filter results...', + placeholder: _('Search or filter results...'), data: { 'username-params' => UserSerializer.new.represent(@users) }, diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb index c5bab877c00595132e976772c96cbdb287c10ef4..4690b6ffbe1686dead4a6e2324ee566bae7d81d9 100644 --- a/app/helpers/tree_helper.rb +++ b/app/helpers/tree_helper.rb @@ -86,17 +86,17 @@ def tree_edit_project(project = @project) end def edit_in_new_fork_notice_now - "You're not allowed to make changes to this project directly." + - " A fork of this project is being created that you can make changes in, so you can submit a merge request." + _("You're not allowed to make changes to this project directly. "\ + "A fork of this project is being created that you can make changes in, so you can submit a merge request.") end def edit_in_new_fork_notice - "You're not allowed to make changes to this project directly." + - " A fork of this project has been created that you can make changes in, so you can submit a merge request." + _("You're not allowed to make changes to this project directly. "\ + "A fork of this project has been created that you can make changes in, so you can submit a merge request.") end def edit_in_new_fork_notice_action(action) - edit_in_new_fork_notice + " Try to #{action} this file again." + edit_in_new_fork_notice + _(" Try to %{action} this file again.") % { action: action } end def commit_in_fork_help diff --git a/app/helpers/visibility_level_helper.rb b/app/helpers/visibility_level_helper.rb index 712f0f808dda5ac991f92da56c3b481bd734d7a1..9deb783d28900c9d3def5c900e9e9f213f3a41bd 100644 --- a/app/helpers/visibility_level_helper.rb +++ b/app/helpers/visibility_level_helper.rb @@ -42,11 +42,11 @@ def project_visibility_level_description(level) def group_visibility_level_description(level) case level when Gitlab::VisibilityLevel::PRIVATE - "The group and its projects can only be viewed by members." + _("The group and its projects can only be viewed by members.") when Gitlab::VisibilityLevel::INTERNAL - "The group and any internal projects can be viewed by any logged in user." + _("The group and any internal projects can be viewed by any logged in user.") when Gitlab::VisibilityLevel::PUBLIC - "The group and any public projects can be viewed without any authentication." + _("The group and any public projects can be viewed without any authentication.") end end @@ -54,20 +54,20 @@ def snippet_visibility_level_description(level, snippet = nil) case level when Gitlab::VisibilityLevel::PRIVATE if snippet.is_a? ProjectSnippet - "The snippet is visible only to project members." + _("The snippet is visible only to project members.") else - "The snippet is visible only to me." + _("The snippet is visible only to me.") end when Gitlab::VisibilityLevel::INTERNAL - "The snippet is visible to any logged in user." + _("The snippet is visible to any logged in user.") when Gitlab::VisibilityLevel::PUBLIC - "The snippet can be accessed without any authentication." + _("The snippet can be accessed without any authentication.") end end def restricted_visibility_level_description(level) level_name = Gitlab::VisibilityLevel.level_name(level) - "#{level_name.capitalize} visibility has been restricted by the administrator." + _("%{level_name} visibility has been restricted by the administrator.") % { level_name: level_name.capitalize } end def disallowed_visibility_level_description(level, form_model) diff --git a/locale/gitlab.pot b/locale/gitlab.pot index 8c842c17d31e587ec7e756c0378369e97e580261..7e67702adba7a86d704bbd38d5e81273de20395a 100644 --- a/locale/gitlab.pot +++ b/locale/gitlab.pot @@ -19,6 +19,9 @@ msgstr "" msgid " Status" msgstr "" +msgid " Try to %{action} this file again." +msgstr "" + msgid " You need to do this before %{grace_period_deadline}." msgstr "" @@ -183,6 +186,9 @@ msgstr "" msgid "%{label_for_message} unavailable" msgstr "" +msgid "%{level_name} visibility has been restricted by the administrator." +msgstr "" + msgid "%{link_start}Read more%{link_end} about role permissions" msgstr "" @@ -446,6 +452,9 @@ msgstr "" msgid "A user with write access to the source branch selected this option" msgstr "" +msgid "API Help" +msgstr "" + msgid "About GitLab" msgstr "" @@ -623,6 +632,9 @@ msgstr "" msgid "Admin Overview" msgstr "" +msgid "Admin Section" +msgstr "" + msgid "AdminArea| You are about to permanently delete the user %{username}. Issues, merge requests, and groups linked to them will be transferred to a system-wide \"Ghost-user\". To avoid data loss, consider using the %{strong_start}block user%{strong_end} feature instead. Once you %{strong_start}Delete user%{strong_end}, it cannot be undone or recovered." msgstr "" @@ -5989,6 +6001,9 @@ msgstr "" msgid "Job" msgstr "" +msgid "Job Failed #%{build_id}" +msgstr "" + msgid "Job ID" msgstr "" @@ -6258,6 +6273,9 @@ msgstr "" msgid "Leave" msgstr "" +msgid "Leave edit mode? All unsaved changes will be lost." +msgstr "" + msgid "Leave group" msgstr "" @@ -6515,6 +6533,9 @@ msgstr "" msgid "Markdown" msgstr "" +msgid "Markdown Help" +msgstr "" + msgid "Markdown enabled" msgstr "" @@ -7135,6 +7156,9 @@ msgstr "" msgid "No issues for the selected time period." msgstr "" +msgid "No job trace" +msgstr "" + msgid "No labels with such name or description" msgstr "" @@ -7398,6 +7422,9 @@ msgstr "" msgid "Open projects" msgstr "" +msgid "Open raw" +msgstr "" + msgid "Open sidebar" msgstr "" @@ -7557,6 +7584,9 @@ msgstr "" msgid "Permissions" msgstr "" +msgid "Permissions Help" +msgstr "" + msgid "Permissions, LFS, 2FA" msgstr "" @@ -7878,6 +7908,9 @@ msgstr "" msgid "Preview" msgstr "" +msgid "Preview changes" +msgstr "" + msgid "Preview payload" msgstr "" @@ -8559,6 +8592,9 @@ msgstr "" msgid "Public - The project can be accessed without any authentication." msgstr "" +msgid "Public Access Help" +msgstr "" + msgid "Public deploy keys (%{deploy_keys_count})" msgstr "" @@ -8610,6 +8646,9 @@ msgstr "" msgid "README" msgstr "" +msgid "Rake Tasks Help" +msgstr "" + msgid "Read more" msgstr "" @@ -8729,6 +8768,12 @@ msgstr "" msgid "Remove project" msgstr "" +msgid "Remove this label? Are you sure?" +msgstr "" + +msgid "Remove this label? This will affect all projects within the group. Are you sure?" +msgstr "" + msgid "Removed group can not be restored!" msgstr "" @@ -8753,6 +8798,9 @@ msgstr "" msgid "Repair authentication" msgstr "" +msgid "Replace" +msgstr "" + msgid "Reply to comment" msgstr "" @@ -9074,6 +9122,9 @@ msgstr "" msgid "SSH Keys" msgstr "" +msgid "SSH Keys Help" +msgstr "" + msgid "SSH host keys" msgstr "" @@ -9215,6 +9266,9 @@ msgstr "" msgid "SearchAutocomplete|in this project" msgstr "" +msgid "SearchResults|Showing %{from} - %{to} of %{count} %{scope} for \"%{term}\"" +msgstr "" + msgid "Secret" msgstr "" @@ -10210,6 +10264,9 @@ msgstr "" msgid "System Hooks" msgstr "" +msgid "System Hooks Help" +msgstr "" + msgid "System Info" msgstr "" @@ -10354,6 +10411,11 @@ msgstr "" msgid "The \"%{group_path}\" group allows you to sign in with your Single Sign-On Account" msgstr "" +msgid "The %{type} contains the following error:" +msgid_plural "The %{type} contains the following errors:" +msgstr[0] "" +msgstr[1] "" + msgid "The Advanced Global Search in GitLab is a powerful search service that saves you time. Instead of creating duplicate code and wasting time, you can now search for code within other teams that can help your own project." msgstr "" @@ -10411,6 +10473,15 @@ msgstr "" msgid "The global settings require you to enable Two-Factor Authentication for your account." msgstr "" +msgid "The group and any internal projects can be viewed by any logged in user." +msgstr "" + +msgid "The group and any public projects can be viewed without any authentication." +msgstr "" + +msgid "The group and its projects can only be viewed by members." +msgstr "" + msgid "The group settings for %{group_links} require you to enable Two-Factor Authentication for your account. You can %{leave_group_links}." msgstr "" @@ -10501,6 +10572,18 @@ msgstr "" msgid "The roadmap shows the progress of your epics along a timeline" msgstr "" +msgid "The snippet can be accessed without any authentication." +msgstr "" + +msgid "The snippet is visible only to me." +msgstr "" + +msgid "The snippet is visible only to project members." +msgstr "" + +msgid "The snippet is visible to any logged in user." +msgstr "" + msgid "The staging stage shows the time between merging the MR and deploying code to the production environment. The data will be automatically added once you deploy to production for the first time." msgstr "" @@ -11516,6 +11599,9 @@ msgstr "" msgid "User map" msgstr "" +msgid "User settings" +msgstr "" + msgid "User was successfully created." msgstr "" @@ -11681,6 +11767,9 @@ msgstr "" msgid "View it on GitLab" msgstr "" +msgid "View job trace" +msgstr "" + msgid "View jobs" msgstr "" @@ -11807,6 +11896,9 @@ msgstr "" msgid "Web terminal" msgstr "" +msgid "Webhooks Help" +msgstr "" + msgid "Webhooks allow you to trigger a URL if, for example, new code is pushed or a new issue is created. You can configure webhooks to listen for specific events like pushes, issues or merge requests. Group webhooks will apply to all projects in a group, allowing you to standardize webhook functionality across your entire group." msgstr "" @@ -11984,6 +12076,9 @@ msgstr "" msgid "Withdraw Access Request" msgstr "" +msgid "Workflow Help" +msgstr "" + msgid "Write" msgstr "" @@ -12206,6 +12301,12 @@ msgstr "" msgid "You'll need to use different branch names to get a valid comparison." msgstr "" +msgid "You're not allowed to make changes to this project directly. A fork of this project has been created that you can make changes in, so you can submit a merge request." +msgstr "" + +msgid "You're not allowed to make changes to this project directly. A fork of this project is being created that you can make changes in, so you can submit a merge request." +msgstr "" + msgid "You're only seeing %{startTag}other activity%{endTag} in the feed. To add a comment, switch to one of the following options." msgstr "" diff --git a/qa/qa/page/file/show.rb b/qa/qa/page/file/show.rb index d5dd31091f8d0ab9140c3e1763a3190617f89d93..000c225f9426801ce01ec6b07be3d0dad0b24009 100644 --- a/qa/qa/page/file/show.rb +++ b/qa/qa/page/file/show.rb @@ -8,7 +8,7 @@ class Show < Page::Base view 'app/helpers/blob_helper.rb' do element :edit_button, "_('Edit')" # rubocop:disable QA/ElementWithPattern - element :delete_button, /label:\s+"Delete"/ # rubocop:disable QA/ElementWithPattern + element :delete_button, '_("Delete")' # rubocop:disable QA/ElementWithPattern end view 'app/views/projects/blob/_remove.html.haml' do