Commit 92c30e57 authored by Michael Kozono's avatar Michael Kozono

Merge branch 'jh-fix_translation_linter' into 'master'

Fix failure with PO translation linter when there are no translations

See merge request gitlab-org/gitlab!38788
parents 7234f0be 8027388d
......@@ -106,7 +106,7 @@ module Gitlab
end
def translations_html_allowed?
html_allowed.present? && all_translations.all? do |translation|
msgid_html_allowed? && html_allowed['translations'].present? && all_translations.all? do |translation|
html_allowed['translations'].include?(translation)
end
end
......
......@@ -328,5 +328,13 @@ RSpec.describe Gitlab::I18n::TranslationEntry do
expect(entry.translations_html_allowed?).to be false
end
end
context 'when the todolist only has the msgid' do
let(:html_todo) { { 'plural_id' => nil, 'translations' => nil } }
it 'returns false' do
expect(entry.translations_html_allowed?).to be false
end
end
end
end
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