summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Wortschack <mwortschack@gitlab.com>2019-04-03 15:10:25 +0200
committerMartin Wortschack <mwortschack@gitlab.com>2019-04-03 15:10:39 +0200
commit839823e34b013377badcb368b750d6b18bdabc6d (patch)
tree67d4fcd9f464fd93ceb5b4dda58d0d2c2ffc31f5
parent4690960062d38e55c40072b46dfabca01506fa2a (diff)
downloadgitlab-ce-mw-i18n-helpers.tar.gz
Resolve first round of discussionsmw-i18n-helpers
- Remove trailing new line - Pluralize properly - Split long lines
-rw-r--r--app/helpers/blob_helper.rb1
-rw-r--r--app/helpers/form_helper.rb3
-rw-r--r--app/helpers/search_helper.rb2
-rw-r--r--app/helpers/tree_helper.rb6
-rw-r--r--locale/gitlab.pot12
5 files changed, 13 insertions, 11 deletions
diff --git a/app/helpers/blob_helper.rb b/app/helpers/blob_helper.rb
index 24f8de237ca..a809debf847 100644
--- a/app/helpers/blob_helper.rb
+++ b/app/helpers/blob_helper.rb
@@ -1,4 +1,3 @@
-
# frozen_string_literal: true
module BlobHelper
diff --git a/app/helpers/form_helper.rb b/app/helpers/form_helper.rb
index 4934c3279d1..8b3d270e873 100644
--- a/app/helpers/form_helper.rb
+++ b/app/helpers/form_helper.rb
@@ -4,8 +4,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_errors}:") % { type: type, pluralized_errors: 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) <<
diff --git a/app/helpers/search_helper.rb b/app/helpers/search_helper.rb
index 3a67eb66cdb..a62c00df60b 100644
--- a/app/helpers/search_helper.rb
+++ b/app/helpers/search_helper.rb
@@ -30,7 +30,7 @@ module SearchHelper
to = collection.offset_value + collection.to_a.size
count = collection.total_count
- _("Showing %{from} - %{to} of %{count} %{scope} for \"%{term}\"") % { from: from, to: to, count: count, scope: scope.humanize(capitalize: false), term: 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)
diff --git a/app/helpers/tree_helper.rb b/app/helpers/tree_helper.rb
index 8c124d74998..4690b6ffbe1 100644
--- a/app/helpers/tree_helper.rb
+++ b/app/helpers/tree_helper.rb
@@ -86,11 +86,13 @@ module TreeHelper
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)
diff --git a/locale/gitlab.pot b/locale/gitlab.pot
index fbe00ce0a12..075d7b5080a 100644
--- a/locale/gitlab.pot
+++ b/locale/gitlab.pot
@@ -7091,6 +7091,9 @@ msgstr ""
msgid "SearchAutocomplete|in this project"
msgstr ""
+msgid "SearchResults|Showing %{from} - %{to} of %{count} %{scope} for \"%{term}\""
+msgstr ""
+
msgid "Secret"
msgstr ""
@@ -7348,9 +7351,6 @@ msgid_plural "Showing %d events"
msgstr[0] ""
msgstr[1] ""
-msgid "Showing %{from} - %{to} of %{count} %{scope} for \"%{term}\""
-msgstr ""
-
msgid "Side-by-side"
msgstr ""
@@ -7924,8 +7924,10 @@ msgstr ""
msgid "Test failed."
msgstr ""
-msgid "The %{type} contains the following %{pluralized_errors}:"
-msgstr ""
+msgid "The %{type} contains the following error:"
+msgid_plural "The %{type} contains the following errors:"
+msgstr[0] ""
+msgstr[1] ""
msgid "The Git LFS objects will <strong>not</strong> be synced."
msgstr ""