Skip to content

Commit

Permalink
Merge branch 'main' into discover-cleanup-obf
Browse files Browse the repository at this point in the history
  • Loading branch information
teolemon authored Nov 17, 2024
2 parents eeb255d + ed3a7de commit 5b9c2a4
Show file tree
Hide file tree
Showing 178 changed files with 725 additions and 24,867 deletions.
15 changes: 9 additions & 6 deletions .github/labeler.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,19 +8,19 @@ Crowdin:

🧴 Open Beauty Facts:
- changed-files:
- any-glob-to-any-file: 'lang/obf/**/*'
- any-glob-to-any-file: '**/*obf*'

🍊 Open Food Facts:
- changed-files:
- any-glob-to-any-file: 'lang/en/texts/mobileapp/features/fooddecyphering.html'

🐾 Open Pet Food Facts:
- changed-files:
- any-glob-to-any-file: 'lang/opff/**/*'
- any-glob-to-any-file: '**/*opff*'

📸 Open Products Facts:
- changed-files:
- any-glob-to-any-file: 'lang/opf/**/*'
- any-glob-to-any-file: '**/*opf*'

Eco-Score:
- changed-files:
Expand All @@ -35,9 +35,9 @@ Eco-Score:
🚥 Nutri-Score:
- changed-files:
- any-glob-to-any-file: 'lang/en/texts/nutriscore/**/*'
- any-glob-to-any-file: '- lang/en/texts/open-food-facts-and-the-nutriscore.html'
- any-glob-to-any-file: '- lang/en/texts/nutriscore-formula.html'
- any-glob-to-any-file: '- lang/en/texts/nutriscore.html'
- any-glob-to-any-file: 'lang/en/texts/open-food-facts-and-the-nutriscore.html'
- any-glob-to-any-file: 'lang/en/texts/nutriscore-formula.html'
- any-glob-to-any-file: 'lang/en/texts/nutriscore.html'

roadmap2019-roadmap:
- changed-files:
Expand All @@ -46,9 +46,11 @@ roadmap2019-roadmap:
Advanced user guide:
- changed-files:
- any-glob-to-any-file: 'lang/en/texts/advanced-user-guide.html'

better-food-choices-for-a-better-health-lets-mobilize:
- changed-files:
- any-glob-to-any-file: 'lang/en/texts/better-food-choices-for-a-better-health-lets-mobilize.html'

Code of conduct:
- changed-files:
- any-glob-to-any-file: 'lang/en/texts/code-of-conduct.html'
Expand All @@ -60,6 +62,7 @@ Contact page:
Press - contacts:
- changed-files:
- any-glob-to-any-file: 'lang/en/texts/contacts.html'

contribute-to-open-food-facts-by-playing:
- changed-files:
- any-glob-to-any-file: 'lang/en/texts/contribute-to-open-food-facts-by-playing.html'
Expand Down
7 changes: 5 additions & 2 deletions .github/workflows/build-additives.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,10 @@ jobs:
uses: actions/checkout@v4

- name: Upgrade assets
run: chmod +x knowledge_panels/build_html.py && knowledge_panels/build_html.py
run: |
cd knowledge_panels
python3 -m pip install -r requirements.txt --user
python3 build_html.py additives ingredients
- name: Check for uncommitted changes
id: check-changes
Expand All @@ -29,7 +32,7 @@ jobs:
id: cpr
uses: peter-evans/create-pull-request@v7
with:
base: develop
base: main
commit-message: Automated update of additives HTML files
committer: GitHub <[email protected]>
author: ${{ github.actor }} <${{ github.actor }}@users.noreply.github.com>
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/crowdin-per-language.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: Matrix
uses: crowdin/github-action@v2.2.0
uses: crowdin/github-action@v2.3.0
with:
upload_translations: false # default is false
download_translations: true
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/crowdin.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: crowdin action
uses: crowdin/github-action@v2.2.0
uses: crowdin/github-action@v2.3.0
with:
upload_translations: false # default is false
# Use this option to upload translations for a single specified language
Expand Down
8 changes: 7 additions & 1 deletion .github/workflows/github-projects.yml
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ jobs:
label-operator: OR
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/openfoodfacts/projects/11 # Add issue to the open products facts project
project-url: https://github.com/orgs/openfoodfacts/projects/43 # Add issue to the open products facts project
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: 📸 Open Products Facts
label-operator: OR
Expand Down Expand Up @@ -112,3 +112,9 @@ jobs:
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: autorelease:\pending
label-operator: OR
- uses: actions/add-to-project@main
with:
project-url: https://github.com/orgs/openfoodfacts/projects/42 # Add issue to the Knowledge Panels issues board
github-token: ${{ secrets.ADD_TO_PROJECT_PAT }}
labeled: 📖 Knowledge panels
label-operator: OR
5 changes: 3 additions & 2 deletions .github/workflows/label.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,9 @@
# file with configuration. For more information, see:
# https://github.com/actions/labeler

name: Labeler
on: [pull_request]
name: "Pull Request Labeler"
on:
- pull_request_target

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/preprod-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
concurrency: off-net
steps:
- name: Checkout git repository
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.1.0
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
Expand All @@ -40,7 +40,7 @@ jobs:
git checkout -qf ${{ github.sha }}
# we need to restart staging backend to see deployed changes
- name: Restart staging backend
uses: appleboy/ssh-action@v1.0.3
uses: appleboy/ssh-action@v1.1.0
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-please.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@
release-please:
runs-on: ubuntu-latest
steps:
- uses: GoogleCloudPlatform/[email protected]
- uses: googleapis/[email protected]
with:
token: ${{ secrets.GITHUB_TOKEN }}
release-type: simple
20 changes: 19 additions & 1 deletion crowdin.yml
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
pull_request_body: '### What\n- Automated pull request pulling in new or updated translations from Crowdin (https://translate.openfoodfacts.org).\n## Checklist\n- [ ] Check that they are no bad translations. If there are, correct them directly in Crowdin so that they are not resynced again. Then you can correct them here as well, or wait 24 hours for the sync to happen automatically.\n- [ ] Put extra attention on Acholi, which is used mistakenly as a sandbox by people discovering the self-service translation button on Open Food Facts\n- [ ] Once you are happy, that automated checks pass, you can approve the PR and merge it.\n### Part of\n- Translations'
project_id_env: CROWDIN_PROJECT_ID
api_token_env: CROWDIN_PERSONAL_TOKEN
pull_request_title: 'chore: New Crowdin translations to review and merge'
pull_request_body: '### What\n- Automated pull request pulling in new or updated translations from Crowdin (https://translate.openfoodfacts.org).\n## Checklist\n- [ ] Check that they are no bad translations. If there are, correct them directly in Crowdin so that they are not resynced again. Then you can correct them here as well, or wait 24 hours for the sync to happen automatically.\n- [ ] Put extra attention on Acholi, which is used mistakenly as a sandbox by people discovering the self-service translation button on Open Food Facts\n- [ ] Once you are happy, that automated checks pass, you can approve the PR and merge it.\n### Part of\n- Translations'
pull_request_labels : 'translations'
preserve_hierarchy: 1
files:
- source: /lang/en/texts/google-impact-challenge-on-climate.html
Expand Down Expand Up @@ -1376,6 +1377,23 @@ files:
sr: sr_RS
ku: kmr_TR
kmr: kmr
- source: /knowledge_panels/ingredients/world-en.yml
translation: /knowledge_panels/ingredients/world-%two_letters_code%.yml
languages_mapping:
two_letters_code:
zh-HK: zh_HK
zh-CN: zh_CN
en-AU: en_AU
en-GB: en_GB
pt-BR: pt_BR
pt-PT: pt_PT
nl-BE: nl_BE
nl-NL: nl_NL
zh-TW: zh_TW
sr-CS: sr_CS
sr: sr_RS
ku: kmr_TR
kmr: kmr
- source: /lang/en/texts/nutriscore-v2.html
translation: /lang/%two_letters_code%/texts/nutriscore-v2.html
languages_mapping:
Expand Down
10 changes: 8 additions & 2 deletions knowledge_panels/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
### How to add a new additive card ?
### How to generate HTML pages for additives from the Yaml page ?
### How to commit those pages as a pull request ?

Install the dependencies, then run the command with the list of directories containing the yaml files.

```bash
python3 build_html.py additives ingredients
```

The name of the directory must correspond to a tag type (ex: additives, ingredients, etc).
34 changes: 0 additions & 34 deletions knowledge_panels/_types.py

This file was deleted.

Loading

0 comments on commit 5b9c2a4

Please sign in to comment.