Commit 9b533937 authored by Bob Van Landuyt's avatar Bob Van Landuyt

Validate if changed translations are checked in

parent a9ebcfa5
......@@ -50,6 +50,32 @@ namespace :gettext do
end
end
task :updated_check do
# Removeing all pre-translated files speeds up `gettext:find` as the
# files don't need to be merged.
`rm locale/*/gitlab.po`
# `gettext:find` writes touches to temp files to `stderr` which would cause
# `static-analysis` to report failures. We can ignore these
silence_stream(STDERR) { Rake::Task['gettext:find'].invoke }
changed_files = `git diff --name-only`.lines.map(&:strip)
# reset the locale folder for potential next tasks
`git checkout locale`
if changed_files.include?('locale/gitlab.pot')
raise <<~MSG
Newly translated strings found, please add them to `gitlab.pot` by running:
bundle exec rake gettext:find; git checkout locale/*/gitlab.po;
Then check in the resulting `locale/gitlab.pot`
MSG
end
end
def report_errors_for_file(file, errors_for_file)
puts "Errors in `#{file}`:"
......
......@@ -27,6 +27,7 @@ unless Rails.env.production?
scss_lint
flay
gettext:lint
gettext:updated_check
lint:static_verification
].each do |task|
pid = Process.fork do
......
......@@ -8,8 +8,8 @@ msgid ""
msgstr ""
"Project-Id-Version: gitlab 1.0.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2018-06-12 18:57+1000\n"
"PO-Revision-Date: 2018-06-12 18:57+1000\n"
"POT-Creation-Date: 2018-06-13 14:05+0200\n"
"PO-Revision-Date: 2018-06-13 14:05+0200\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"Language: \n"
......@@ -133,12 +133,12 @@ msgid "- show less"
msgstr ""
msgid "1 %{type} addition"
msgid_plural "%d %{type} additions"
msgid_plural "%{count} %{type} additions"
msgstr[0] ""
msgstr[1] ""
msgid "1 %{type} modification"
msgid_plural "%d %{type} modifications"
msgid_plural "%{count} %{type} modifications"
msgstr[0] ""
msgstr[1] ""
......@@ -2252,10 +2252,10 @@ msgstr ""
msgid "Gitaly"
msgstr ""
msgid "Gitaly|Address"
msgid "Gitaly Servers"
msgstr ""
msgid "Gitaly Servers"
msgid "Gitaly|Address"
msgstr ""
msgid "Go Back"
......@@ -2419,6 +2419,15 @@ msgstr ""
msgid "If your HTTP repository is not publicly accessible, add authentication information to the URL: <code>https://username:password@gitlab.company.com/group/project.git</code>."
msgstr ""
msgid "ImageDiffViewer|2-up"
msgstr ""
msgid "ImageDiffViewer|Onion skin"
msgstr ""
msgid "ImageDiffViewer|Swipe"
msgstr ""
msgid "Import"
msgstr ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment