diff options
author | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
---|---|---|
committer | GitLab Bot <gitlab-bot@gitlab.com> | 2020-08-20 21:42:06 +0300 |
commit | 6e4e1050d9dba2b7b2523fdd1768823ab85feef4 (patch) | |
tree | 78be5963ec075d80116a932011d695dd33910b4e /lib/tasks/gettext.rake | |
parent | 1ce776de4ae122aba3f349c02c17cebeaa8ecf07 (diff) |
Add latest changes from gitlab-org/gitlab@13-3-stable-ee
Diffstat (limited to 'lib/tasks/gettext.rake')
-rw-r--r-- | lib/tasks/gettext.rake | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/lib/tasks/gettext.rake b/lib/tasks/gettext.rake index a192293fae6..31030d061f2 100644 --- a/lib/tasks/gettext.rake +++ b/lib/tasks/gettext.rake @@ -12,6 +12,14 @@ namespace :gettext do ) end + # Disallow HTML from translatable strings + # See: https://docs.gitlab.com/ee/development/i18n/externalization.html#html + def html_todolist + return @html_todolist if defined?(@html_todolist) + + @html_todolist = YAML.load_file(Rails.root.join('lib/gitlab/i18n/html_todo.yml')) + end + task :compile do # See: https://gitlab.com/gitlab-org/gitlab-foss/issues/33014#note_31218998 FileUtils.touch(File.join(Rails.root, 'locale/gitlab.pot')) @@ -54,11 +62,11 @@ namespace :gettext do linters = files.map do |file| locale = File.basename(File.dirname(file)) - Gitlab::I18n::PoLinter.new(file, locale) + Gitlab::I18n::PoLinter.new(po_path: file, html_todolist: html_todolist, locale: locale) end pot_file = Rails.root.join('locale/gitlab.pot') - linters.unshift(Gitlab::I18n::PoLinter.new(pot_file)) + linters.unshift(Gitlab::I18n::PoLinter.new(po_path: pot_file, html_todolist: html_todolist)) failed_linters = linters.select { |linter| linter.errors.any? } |