Skip to content

Commit

Permalink
Add test to check Nutri-Score, Eco-Score and NOVA are not translated
Browse files Browse the repository at this point in the history
  • Loading branch information
stephanegigandet authored and alexgarel committed May 20, 2022
1 parent f0026a8 commit c47dbb8
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion t/lang.t
Original file line number Diff line number Diff line change
Expand Up @@ -102,7 +102,11 @@ foreach my $stringid (sort keys %Lang) {
foreach my $word (@words_that_should_not_be_translated) {
if ($Lang{$stringid}{'en'} =~ /\b$word\b/) {
foreach my $l (keys %{$Lang{$stringid}}) {
if ($Lang{$stringid}{$l} !~ /\b$word\b/) {
if (($Lang{$stringid}{$l} !~ /\b$word\b/)
# in CJK languages, allow the words to not have a word boundary around them
and not (($l =~ /^(ko|ja|zh)$/) and ($Lang{$stringid}{$l} =~ /$word/))
)
{
fail("string $stringid in language $l does not contain $word: $Lang{$stringid}{$l}");
}
}
Expand Down

0 comments on commit c47dbb8

Please sign in to comment.