Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: Add test to check Nutri-Score, Eco-Score and NOVA are not translated #6085

Merged
merged 11 commits into from
Dec 12, 2022

Conversation

stephanegigandet
Copy link
Contributor

This checks that if there is Nutri-Score, Eco-Score or NOVA in an English string, that it has not been changed in all the translations.

Currently this test fails:

Looks like you failed 142 tests

Sample output:

not ok 877 - string nutrition_grade_fr_tea_bags_note in language ro does not contain Nutri-Score: Notă: Nutri-Scorul ceaiurilor și ceaiurilor din plante corespunde produsului preparat doar cu apă, fără zahăr sau lapte.

There are some languages where Nutri-Score is being changed according to grammatical rules for nouns, we will need to check, but we probably want to treat Nutri-Score as a brand that cannot be changed. e.g. in English, we should say "The Nutri-Score of several products" and not "The Nutri-Scores of several products".

@stephanegigandet stephanegigandet added the Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org label Nov 18, 2021
@stephanegigandet stephanegigandet requested a review from a team as a code owner November 18, 2021 17:52
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@teolemon
Copy link
Member

#   Failed test 'string app_banner_text in language ms does not contain Nutri-Score: Imbas kod bar untuk mendapatkan Skor Nutri, Skor Eko dan banyak lagi!'
#   at t/lang.t line 89.

#   Failed test 'string app_banner_text in language ms does not contain Eco-Score: Imbas kod bar untuk mendapatkan Skor Nutri, Skor Eko dan banyak lagi!'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_grade_title in language da does not contain Eco-Score: �ko-Score %s'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_grade_title in language it does not contain Eco-Score: Punteggio ecologico %s'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_grade_title in language ro does not contain Eco-Score: Scor ecologic %s'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_grade_title in language fr does not contain Eco-Score: �co-Score %s'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
t/lang.t ......................... 

Dubious, test returned 134 (wstat 34304, 0x8600)
Failed 134/513 subtests 
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_ecoscore_grade_title in language zh does not contain Eco-Score: 生态得分 %s'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_name in language nl does not contain Eco-Score: Eco-score'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_ecoscore_name in language zh does not contain Eco-Score: 生态得分'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_name in language fr does not contain Eco-Score: �co-Score'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_name in language da does not contain Eco-Score: �ko-Score'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_ecoscore_setting_name in language zh does not contain Eco-Score: 低环境影响(生态得分)'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_ecoscore_setting_name in language ro does not contain Eco-Score: Impact scăzut asupra mediului (Scor ecologic)'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_ecoscore_setting_name in language tr does not contain Eco-Score: Düşük çevresel etki (Eko-Skor)'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_setting_name in language fr does not contain Eco-Score: Faible impact environnemental (�co-Score)'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_unknown_title in language ro does not contain Eco-Score: Scorul Eco nu a fost calculat'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_unknown_title in language ca does not contain Eco-Score: Puntuaci� ecol�gica no calculada'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_unknown_title in language hu does not contain Eco-Score: Az Eco-score nincs kisz�m�tva'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_ecoscore_unknown_title in language sl does not contain Eco-Score: Eko-ocena ni izračunana'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_unknown_title in language fi does not contain Eco-Score: Eco-Scorea ei laskettu'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_ecoscore_unknown_title in language zh does not contain Eco-Score: 未计算的生态分数'
#   at t/lang.t line 89.

#   Failed test 'string attribute_ecoscore_unknown_title in language sv does not contain Eco-Score: Eco-score ej ber�knad'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_low_fat_setting_note in language zh does not contain Nutri-Score: 脂肪水平是由营养指数考虑的。只有在低脂饮食时才使用此设置。'
#   at t/lang.t line 89.

#   Failed test 'string attribute_low_fat_setting_note in language es does not contain Nutri-Score: Nutri-score tiene en cuenta el nivel de grasa. Usa esta opci�n solo si est� espec�ficamente en una dieta baja en grasa.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_low_salt_setting_note in language zh does not contain Nutri-Score: 营养指数会考虑盐的含量。只有当你的饮食特别低盐时才使用此设置。'
#   at t/lang.t line 89.

#   Failed test 'string attribute_low_salt_setting_note in language es does not contain Nutri-Score: Nutri-score tiene en cuenta el nivel de sal. Usa esta opci�n solo si est� espec�ficamente en una dieta baja en sal.'
#   at t/lang.t line 89.

#   Failed test 'string attribute_low_saturated_fat_setting_note in language es does not contain Nutri-Score: Nutri-score tiene en cuenta el nivel de grasa saturada. Usa esta opci�n solo si est� espec�ficamente en una dieta baja en grasa saturada.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_low_saturated_fat_setting_note in language zh does not contain Nutri-Score: 饱和脂肪水平是由营养评分考虑的。只有当你的饮食是低饱和脂肪时才使用此设置。'
#   at t/lang.t line 89.

#   Failed test 'string attribute_low_sugars_setting_note in language es does not contain Nutri-Score: Nutri-score tiene en cuenta el nivel de az�car. Usa esta opci�n solo si est� espec�ficamente en una dieta baja en az�car.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_low_sugars_setting_note in language zh does not contain Nutri-Score: 糖的含量是由营养评分考虑的。只有当你在低糖饮食时才使用这个设置。'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_nova_group_title in language zh does not contain NOVA: 小组%s'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_nova_name in language ko does not contain NOVA: 노바 그룹'
#   at t/lang.t line 89.

#   Failed test 'string attribute_nova_name in language it does not contain NOVA: Gruppo Nova'
#   at t/lang.t line 89.

#   Failed test 'string attribute_nova_name in language da does not contain NOVA: Nova-gruppe'
#   at t/lang.t line 89.

#   Failed test 'string attribute_nova_name in language es does not contain NOVA: Grupo Nova'
#   at t/lang.t line 89.

#   Failed test 'string attribute_nova_name in language sv does not contain NOVA: Nova grupp'
#   at t/lang.t line 89.

#   Failed test 'string attribute_nova_name in language de does not contain NOVA: Nova-Gruppe'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_nova_setting_name in language zh does not contain NOVA: 没有或很少进行食品加工(小组)'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_nova_unknown_title in language zh does not contain NOVA: 小组不计算'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_nutriscore_grade_title in language zh does not contain Nutri-Score: 营养分数 %s'
#   at t/lang.t line 89.

#   Failed test 'string attribute_nutriscore_grade_title in language id does not contain Nutri-Score: Nutri-Skor %s'
#   at t/lang.t line 89.

#   Failed test 'string attribute_nutriscore_grade_title in language ro does not contain Nutri-Score: Nutri-Scor %s'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_nutriscore_name in language zh does not contain Nutri-Score: 营养分数'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_nutriscore_setting_name in language zh does not contain Nutri-Score: 良好的营养质量(nutrition - score)'
#   at t/lang.t line 89.

#   Failed test 'string attribute_nutriscore_setting_name in language es does not contain Nutri-Score: Buena informaci�n nutricional (Nutri-score)'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_nutriscore_setting_note in language zh does not contain Nutri-Score: 营养值是计算出来的,可以考虑到所有产品,即使没有显示在包装上。'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string attribute_nutriscore_unknown_title in language zh does not contain Nutri-Score: 未计算营养分数'
#   at t/lang.t line 89.

#   Failed test 'string attribute_nutriscore_unknown_title in language fi does not contain Nutri-Score: Nutri-Scorea ei laskettu'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string better_nutriscore in language ko does not contain Nutri-Score: %s 값을 %s(%s 차이)에서 %s(%s 차이)로 변경하여 뉴트리-스코어를 %s에서 %s(%s 차이)로 변경할 수 있습니다.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string better_nutriscore in language zh does not contain Nutri-Score: 通过将%s的值从%s更改为%s (%s的百分比差异),可以将营养分数从%s更改为%s。'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string categories_import_note in language zh does not contain Nutri-Score: 提供一个类别对于使产品易于搜索和计算营养分数非常重要'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string data_source_database_note_about_the_producers_platform in language zh does not contain Nutri-Score: 制造商可以使用 Open Food Facts <a href="<producers_platform_url>">生产者免费平台</a>访问并完成此数据,而且可以获得报告、分析和产品改进机会 (例如,得到更高的营养评分等级)。'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string ecoscore_agribalyse_match_warning in language hu does not contain Eco-Score: Az Eco-score csak akkor számítható ki, ha a termék kellően pontos kategóriával rendelkezik.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string ecoscore_agribalyse_match_warning in language ro does not contain Eco-Score: Scorul Eco poate fi calculat doar dacă produsul are o categorie suficient de precisă.'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_agribalyse_match_warning in language ms does not contain Eco-Score: Skor Eko hanya dapat dikira jika produk mempunyai kategori tepat yang mencukupi.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string ecoscore_description in language ro does not contain Eco-Score: Scorul <a href="/ecoscore">Eco-Scor</a> este un scor experimental care rezumă impactul asupra mediului al produselor alimentare.'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_description in language ms does not contain Eco-Score: <a href="/ecoscore">Skor Eko</a> adalah skor eksperimental yang mengikhtisarkan kesan persekitaran produk makanan.'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_edit_for_more_precise_ecoscore in language ms does not contain Eco-Score: Untuk pengiraan Skor Eko yang lebih tepat, anda boleh menyunting halaman produk dan menambahkannya.'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_edit_for_more_precise_ecoscore in language es does not contain Eco-Score: Para un c�lculo m�s preciso de la puntuaci�n ecol�gica, puede modificar la p�gina del producto y a�adirlas.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string ecoscore_edit_for_more_precise_ecoscore in language zh does not contain Eco-Score: 如需更精确地计算生态评分,您可以修改产品页面并添加信息。'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_edit_for_more_precise_ecoscore in language fi does not contain Eco-Score: Saadaksesi tarkemman laskelman Eco-Scoresta, voit muokata tuotesivua ja lis�t� ne.'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_p in language da does not contain Eco-Score: �ko-Score'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_p in language fr does not contain Eco-Score: �co-Score'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_p in language ro does not contain Eco-Score: Scor Ecologic'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string ecoscore_p in language zh does not contain Eco-Score: 生态得分'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_p in language nl does not contain Eco-Score: Eco-score'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_s in language ro does not contain Eco-Score: Scor Ecologic'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_s in language fr does not contain Eco-Score: �co-Score'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_s in language da does not contain Eco-Score: �ko-Score'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_s in language nl does not contain Eco-Score: Eco-score'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string ecoscore_s in language zh does not contain Eco-Score: 生态得分'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_warning_fr in language ms does not contain Eco-Score: Formula Skor Eko adalah tertakluk kepada perubahan kerana ia ditambah baik secara berkala untuk menjadikannya lebih tepat.'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_warning_international in language ms does not contain Eco-Score: Skor Eko pada mulanya dibangunkan untuk Perancis dan ia diperluaskan ke negara-negara Eropah yang lain. Formula Skor Eko adalah tertakluk kepada perubahan kerana ia ditambah baik secara berkala untuk menjadikannya lebih tepat dan lebih sesuai untuk setiap negara.'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_warning_missing_information in language ca does not contain Eco-Score: Advertiment: no es proporciona part de la informaci� necess�ria per calcular la puntuaci� ecol�gica amb precisi� (vegeu els detalls del c�lcul a continuaci�).'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_warning_missing_information in language fi does not contain Eco-Score: Varoitus: joitakin Eco-Scoren tarkkaan laskemiseen tarvittavia tietoja ei ole toimitettu (katso laskelman yksityiskohdat alla).'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string ecoscore_warning_missing_information in language zh does not contain Eco-Score: 警告:未提供精确计算生态评分所需的一些信息 (请参阅下面的计算详细信息)。'
#   at t/lang.t line 89.

#   Failed test 'string ecoscore_warning_missing_information in language ms does not contain Eco-Score: Amaran: sesetengah maklumat yang diperlukan untuk mengira Skor Eko dengan tepat tidak diberikan (lihat perincian pengiraan di bawah).'
#   at t/lang.t line 89.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string improvements_facet_description_1 in language ro does not contain Nutri-Score: Acest tabel enumeră posibilele oportunități de îmbunătățire a calității nutriționale, a Scorului Nutrițional și a compoziției produselor alimentare.'
#   at t/lang.t line 89.

#   Failed test 'string improvements_facet_description_1 in language de does not contain Nutri-Score: Diese Tabelle listet m�gliche Ans�tze zur Verbesserung der N�hrstoffqualit�t, des Nutri-Scores und der Zusammensetzung von Lebensmitteln auf.'
#   at t/lang.t line 89.

#   Failed test 'string improvements_facet_description_1 in language fi does not contain Nutri-Score: T�m� taulukko listaa parannusmahdollisuudet ravinnolliseen laatuun, Nutri-Scoreen ja elintarvikkeiden koostumukseen.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string improvements_facet_description_1 in language zh does not contain Nutri-Score: 该表列出了改善营养质量、营养分数和食品成分的可能机会。'
#   at t/lang.t line 89.

#   Failed test 'string improvements_facet_description_2 in language da does not contain Nutri-Score: For at opn� relevante resultater, s� s�rg for, at produktdataene er komplette (ern�ringsfakta med v�rdier for fiber, frugt og gr�ntsager til beregning af Nutri-score, og en pr�cis kategori til sammenligning af hvert produkt med lignende produkter).'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string improvements_facet_description_2 in language ro does not contain Nutri-Score: Pentru a obține rezultate relevante, vă rugăm să vă asigurați că datele despre produs sunt complete (informații nutriționale cu valori pentru fibre și fructe și legume pentru a calcula Scorul Nutrițional și o categorie precisă pentru a compara fiecare produs cu produse similare).'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string improvements_facet_description_2 in language zh does not contain Nutri-Score: 为了得到相关结果,请确保产品数据完整(含纤维和水果蔬菜值的营养事实,以计算营养评分,以及一个精确的类别,以比较每个产品与类似的产品)。'
#   at t/lang.t line 89.

#   Failed test 'string improvements_facet_description_2 in language fi does not contain Nutri-Score: Oleellisten hakutulosten saamiseksi varmista, ett� tuotetiedot ovat t�ydellisi� (ravintosis�lt�, joka sis�lt�� arvot kuidulle ja hedelmille ja kasviksille Nutri-Scoren laskemiseksi, ja tarkka tuoteluokka jokaisen tuotteen vertaamiseksi samankaltaisiin tuotteisiin).'
#   at t/lang.t line 89.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.
Use of uninitialized value in pattern match (m//) at t/lang.t line 87.

#   Failed test 'string nova_group_producer in language es does not contain NOVA: Grupo Nova'
#   at t/lang.t line 89.

#   Failed test 'string nova_group_producer in language sv does not contain NOVA: Nova grupp'
#   at t/lang.t line 89.

#   Failed test 'string nova_group_producer in language de does not contain NOVA: Nova-Gruppe'
#   at t/lang.t line 89.

#   Failed test 'string nova_group_producer in language it does not contain NOVA: Gruppo Nova'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nova_group_producer in language ko does not contain NOVA: 노바 그룹'
#   at t/lang.t line 89.

#   Failed test 'string nova_group_producer in language da does not contain NOVA: Nova-gruppe'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nova_groups_info in language ru does not contain NOVA: Группы Nova для классификации полуфабрикатов'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nova_groups_info in language ar does not contain NOVA: مجموعات نوفا للصناعات الغذائية'
#   at t/lang.t line 89.

#   Failed test 'string nova_groups_p in language da does not contain NOVA: Nova-grupper'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nova_groups_p in language ko does not contain NOVA: 노바 그룹'
#   at t/lang.t line 89.

#   Failed test 'string nova_groups_p in language de does not contain NOVA: Nova-Gruppen'
#   at t/lang.t line 89.

#   Failed test 'string nova_groups_p in language es does not contain NOVA: Grupos Nova'
#   at t/lang.t line 89.

#   Failed test 'string nova_groups_s in language sv does not contain NOVA: Nova grupp'
#   at t/lang.t line 89.

#   Failed test 'string nova_groups_s in language es does not contain NOVA: Grupo Nova'
#   at t/lang.t line 89.

#   Failed test 'string nova_groups_s in language de does not contain NOVA: Nova-Gruppe'
#   at t/lang.t line 89.

#   Failed test 'string nova_groups_s in language da does not contain NOVA: Nova-gruppe'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nova_groups_s in language ko does not contain NOVA: 노바 그룹'
#   at t/lang.t line 89.

#   Failed test 'string nova_groups_s in language it does not contain NOVA: Gruppo Nova'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutri_score_grade_calculated in language zh does not contain Nutri-Score: 计算营养等级'
#   at t/lang.t line 89.

#   Failed test 'string nutri_score_grade_calculated in language tr does not contain Nutri-Score: Hesaplanan Nutri-Skor derecesi'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutri_score_grade_from_producer in language zh does not contain Nutri-Score: 由生产商提供的营养评分等级'
#   at t/lang.t line 89.

#   Failed test 'string nutri_score_score_calculated in language tr does not contain Nutri-Score: Hesaplanan Nutri-Puan skor'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutri_score_score_calculated in language zh does not contain Nutri-Score: 计算营养分数'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutri_score_score_from_producer in language tr does not contain Nutri-Score: Üreticiden Nutri-Skor puanı'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutri_score_score_from_producer in language zh does not contain Nutri-Score: 来自制作人的营养评分'
#   at t/lang.t line 89.

#   Failed test 'string nutriscore_calculation_details in language de does not contain Nutri-Score: Details zur Berechnung des Nutri-Scores'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_calculation_details in language zh does not contain Nutri-Score: 详细计算营养分数'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_calculation_details in language ru does not contain Nutri-Score: Детали расчета Nutri-core'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_grade in language zh does not contain Nutri-Score: 营养分数'
#   at t/lang.t line 89.

#   Failed test 'string nutriscore_grade in language ro does not contain Nutri-Score: Nutri-Scor'
#   at t/lang.t line 89.

#   Failed test 'string nutriscore_grade_producer in language ro does not contain Nutri-Score: Nutri-Scor'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_grade_producer in language zh does not contain Nutri-Score: 营养分数'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_grade_producer_import_note in language zh does not contain Nutri-Score: 公开食物事实网站根据提供的信息(营养事实和类别) 计算营养评分等级。如果我们计算的等级与您提供的等级不同,您将在生产者平台上获得一个私有通知,以便解决差异。'
#   at t/lang.t line 89.

#   Failed test 'string nutriscore_is_beverage in language de does not contain Nutri-Score: Dieses Produkt gilt als Getr�nk f�r die Berechnung des Nutri-Scores.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_is_beverage in language zh does not contain Nutri-Score: 该产品被认为是一种饮料的计算营养分数。'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_is_beverage in language uk does not contain Nutri-Score: Цей товар вважається важелем для обчислення Нутрі-Скора.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_is_not_beverage in language zh does not contain Nutri-Score: 在计算营养分数时,产品是否不被认为是饮料'
#   at t/lang.t line 89.

#   Failed test 'string nutriscore_is_not_beverage in language de does not contain Nutri-Score: Dieses Produkt gilt nicht als Getr�nk f�r die Berechnung des Nutri-Scores.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_score_producer in language zh does not contain Nutri-Score: 营养分数'
#   at t/lang.t line 89.

#   Failed test 'string nutriscore_score_producer in language ro does not contain Nutri-Score: Scor Nutri-Scor'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_score_producer_import_note in language zh does not contain Nutri-Score: 公开食物事实网站根据提供的信息(营养事实和类别) 计算营养得分。如果我们计算的分数与您提供的分数不同,您将在生产者平台上获得一个私有通知,以便解决差异。'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutriscore_score_producer_note in language zh does not contain Nutri-Score: 营养得分(A到E级的数值)'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string nutrition_grade_fr_tea_bags_note in language ro does not contain Nutri-Score: Notă: Nutri-Scorul ceaiurilor și ceaiurilor din plante corespunde produsului preparat doar cu apă, fără zahăr sau lapte.'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string product_edits_by_producers_indicators in language zh does not contain Nutri-Score: 该平台计算营养分数、NOVA和生态分数等指标,并自动识别可以加以改进的意见(例如,所有产品成分稍有改变都可以刷新更高的营养分数。)'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string sort_by_ecoscore_score in language zh does not contain Eco-Score: 生态得分最高的产品'
#   at t/lang.t line 89.

#   Failed test 'string sort_by_ecoscore_score in language nl does not contain Eco-Score: Producten met de beste Eco-score'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string sort_by_ecoscore_score in language he does not contain Eco-Score: מוצרים עם ה־Edo-Score הטוב ביותר'
#   at t/lang.t line 89.

#   Failed test 'string sort_by_ecoscore_score in language ro does not contain Eco-Score: Produse cu cel mai bun scor Eco'
#   at t/lang.t line 89.
Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.

Wide character in print at /home/runner/perl5/lib/perl5/Test2/Formatter/TAP.pm line 125.
#   Failed test 'string sort_by_nutriscore_score in language zh does not contain Nutri-Score: 营养得分最高的产品'
#   at t/lang.t line 89.
# Looks like you failed 134 tests of 513.

@alexgarel
Copy link
Member

I got same problems as @teolemon

@stephanegigandet
Copy link
Contributor Author

The point of this test is to find all instances of translations that (wrongly) translated Nutri-Score, Eco-Score and NOVA.

It will not pass untill all those are fixed in CrowdIn.

Once all translations are corrected, we can merge this test, and then new translations PRs from CrowdIn won't pass if they have new wrong translations.

t/lang.t Outdated

foreach my $stringid (sort keys %Lang) {
foreach my $word (@words_that_should_not_be_translated) {
if ($Lang{$stringid}{'en'} =~ /\b$word\b/) {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I didn't notice how much it took to run this, but using a regexp with all words and matching once, should be roughly 3x faster.

/\b(Nutri-Score|Eco-Score|NOVA)\b

I imagine that checking the same regexp in translation (whithout searching which one it is), is engouh, but if needed, we can do an inner loop to then check each words.

t/lang.t Outdated Show resolved Hide resolved
@github-actions github-actions bot removed the Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org label Jan 10, 2022
@teolemon teolemon added the Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org label Jan 10, 2022
@teolemon teolemon changed the title Add test to check Nutri-Score, Eco-Score and NOVA are not translated feat: Add test to check Nutri-Score, Eco-Score and NOVA are not translated Jan 22, 2022
@github-actions github-actions bot added 🧪 tests and removed Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org labels Feb 13, 2022
@openfoodfacts openfoodfacts deleted a comment from sonarqubecloud bot Apr 4, 2022
@openfoodfacts openfoodfacts deleted a comment from sonarqubecloud bot Apr 4, 2022
@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label May 18, 2022
@alexgarel
Copy link
Member

@stephanegigandet what do we want to do with this PR ? Abandon it ?

We can fix part of translations strings, but do you really feel that Nutri-Score should remain Nutri-Score in arabic ?

@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label May 20, 2022
dipietroR added a commit that referenced this pull request Jul 8, 2022
Implementing perltidy to t/lang.t , will have a merge commit with PR #6085
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions github-actions bot added the 💥 Merge Conflicts 💥 Merge Conflicts label Jul 20, 2022
@stephanegigandet
Copy link
Contributor Author

stephanegigandet commented Dec 8, 2022

Removed some broken tests, here are the stats on languages with failing tests:


# {
#   'ar' => 20,
#   'bg' => 1,
#   'bn' => 3,
#   'ca' => 2,
#   'cs' => 6,
#   'da' => 16,
#   'de' => 9,
#   'es' => 12,
#   'fi' => 21,
#   'fr' => 5,
#   'gu' => 3,
#   'ha' => 1,
#   'he' => 5,
#   'hi' => 4,
#   'hu' => 3,
#   'id' => 2,
#   'it' => 5,
#   'ja' => 7,
#   'kk' => 1,
#   'kn' => 1,
#   'ko' => 7,
#   'lb' => 1,
#   'lt' => 6,
#   'lv' => 3,
#   'ms' => 12,
#   'nl' => 5,
#   'pl' => 1,
#   'ro' => 17,
#   'ru' => 4,
#   'sl' => 5,
#   'sr' => 1,
#   'sv' => 4,
#   'te' => 1,
#   'th' => 1,
#   'tl' => 1,
#   'tr' => 8,
#   'uk' => 10,
#   'ur' => 1,
#   'uz' => 1,
#   'vi' => 56,
#   'yo' => 1,
#   'zh' => 52
# }

@github-actions github-actions bot added Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org 🧪 unit tests labels Dec 8, 2022
@stephanegigandet
Copy link
Contributor Author

From @alexgarel :

@stephanegigandet what do we want to do with this PR ? Abandon it ?
We can fix part of translations strings, but do you really feel that Nutri-Score should remain Nutri-Score in arabic ?

Let's merge it for French, then we can gradually add more languages as we solve them in Crowd-in.

I solved the French issues in fr.po and in Crowdin (Éco-Score --> Eco-Score).

The test is activated only or French. We can merge it, and then make another PR where we activate it for more languages.

@teolemon
Copy link
Member

teolemon commented Dec 8, 2022

Creating po_backend_run ... done

tests/unit/lang.t: Begin Error Output Stream
tests/unit/lang.t:141: assertion failure: '--assert-tidy' is set but output differs from input
tests/unit/lang.t:
tests/unit/lang.t: Input file length is 9961 chars
tests/unit/lang.t: Output file length is 9966 chars
tests/unit/lang.t: Files first differ at character 15 of line 106
tests/unit/lang.t: 105:my @words_that_should_not_be_translated = (
tests/unit/lang.t: <106: "Nutri-Score", "Eco-Score", "NOVA",
tests/unit/lang.t: >106: "Nutri-Score",
tests/unit/lang.t: ^
tests/unit/lang.t:
2
make: *** [Makefile:274: check_perltidy] Error 2

@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label Dec 8, 2022
@github-actions github-actions bot added API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🧪 integration tests 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels 💥 Merge Conflicts 💥 Merge Conflicts labels Dec 9, 2022
@sonarqubecloud
Copy link

Kudos, SonarCloud Quality Gate passed!    Quality Gate passed

Bug A 0 Bugs
Vulnerability A 0 Vulnerabilities
Security Hotspot A 0 Security Hotspots
Code Smell A 0 Code Smells

No Coverage information No Coverage information
No Duplication information No Duplication information

@github-actions github-actions bot removed the 💥 Merge Conflicts 💥 Merge Conflicts label Dec 12, 2022
@stephanegigandet stephanegigandet merged commit 8a09834 into main Dec 12, 2022
@stephanegigandet stephanegigandet deleted the do-not-translate branch December 12, 2022 14:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API Issues related to the Open Food Facts API. More specific labels exist & should be used (API WRITE…) 🧪 integration tests 📖 Knowledge Panels https://wiki.openfoodfacts.org/Knowledge_panels 🧪 tests Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org 🧪 unit tests
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

4 participants