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

fix: do not use 'and' translations from Crowdin for ingredient analysis #8809

Merged
merged 3 commits into from
Aug 10, 2023

Conversation

stephanegigandet
Copy link
Contributor

Relying on translated strings from Crowdin for translation analysis (e.g. strings like "and") is too fragile, use translations from Ingredients.pm instead.

Fixes #8794

@stephanegigandet stephanegigandet requested a review from a team as a code owner August 8, 2023 09:12
@github-actions github-actions bot added 🥗 Ingredients 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org labels Aug 8, 2023
my $and = $Lang{_and_}{$lc};
#my $enumeration_separators = $obrackets . '|' . $cbrackets . '|\/| \/ | ' . $dashes . ' |' . $commas . ' |' . $commas. '|' . $Lang{_and_}{$lc};
# do not match anything if we don't have a translation for "and"
my $and = $and{$lc} || " will not match ";
Copy link
Member

Choose a reason for hiding this comment

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

it's a bit confusing to have $and named as %and… but it's ok.

Also we don't support a lot of languages in %and for now… shan't you report current translations in %and ?

grep -A 3 'msgctxt "_and_"' -r po/common/ |grep msgstr

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@alexgarel Nice, I never used the -A option :)

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I added some of the translations, and left out the ones for languages we have poor support (non roman characters mostly)

@teolemon teolemon added the 🌐 i18n Regarding software localization label Aug 8, 2023
@codecov-commenter
Copy link

codecov-commenter commented Aug 10, 2023

Codecov Report

Merging #8809 (8202345) into main (799f250) will not change coverage.
Report is 31 commits behind head on main.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #8809   +/-   ##
=======================================
  Coverage   48.75%   48.75%           
=======================================
  Files         118      118           
  Lines       22000    22000           
  Branches     4888     4888           
=======================================
  Hits        10726    10726           
  Misses       9968     9968           
  Partials     1306     1306           
Files Changed Coverage Δ
lib/ProductOpener/Ingredients.pm 90.99% <100.00%> (ø)

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

@sonarcloud
Copy link

sonarcloud bot commented Aug 10, 2023

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
0.0% 0.0% Duplication

@stephanegigandet stephanegigandet merged commit 7c4cec4 into main Aug 10, 2023
15 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
🌐 i18n Regarding software localization 🥗🔍 Ingredients analysis https://wiki.openfoodfacts.org/Ingredients_Extraction_and_Analysis 🥗 Ingredients Template::Toolkit The templating toolkit used by product opener. The starting point for HTML/JS/CSS fixes. Translations We use a non-standard version of GetText, lack language variants support translate.openfoodfacts.org
Projects
None yet
Development

Successfully merging this pull request may close these issues.

bug: parsing vitamins from ingredients list
4 participants