Skip to content

Commit

Permalink
Merge branch 'main' into aleene-week6
Browse files Browse the repository at this point in the history
  • Loading branch information
aleene committed Feb 13, 2024
2 parents 291335b + e06db12 commit fc1aca6
Show file tree
Hide file tree
Showing 441 changed files with 39,423 additions and 3,301 deletions.
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@v1.16.1
uses: crowdin/github-action@v1.18.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 @@ -13,7 +13,7 @@ jobs:
- name: Checkout
uses: actions/checkout@v4
- name: crowdin action
uses: crowdin/github-action@v1.16.1
uses: crowdin/github-action@v1.18.0
with:
upload_translations: false # default is false
# Use this option to upload translations for a single specified language
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pull_request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ jobs:
run: |
make coverage_txt
make codecov
- uses: codecov/codecov-action@v3
- uses: codecov/codecov-action@v4
if: always()
with:
files: cover_db/codecov.json
Expand Down
71 changes: 71 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,76 @@
# Changelog

## [2.27.1](https://github.com/openfoodfacts/openfoodfacts-server/compare/v2.27.0...v2.27.1) (2024-02-06)


### Bug Fixes

* load Brevo.pm in Users.pm ([#9759](https://github.com/openfoodfacts/openfoodfacts-server/issues/9759)) ([a14d4d2](https://github.com/openfoodfacts/openfoodfacts-server/commit/a14d4d2bc236d163726fa1b203583a6fd5218a43)), closes [#9758](https://github.com/openfoodfacts/openfoodfacts-server/issues/9758)
* single allergen infinite loop ([#9757](https://github.com/openfoodfacts/openfoodfacts-server/issues/9757)) ([50fc596](https://github.com/openfoodfacts/openfoodfacts-server/commit/50fc5969101e79bad0f0967f102b6133541adab9)), closes [#9755](https://github.com/openfoodfacts/openfoodfacts-server/issues/9755)

## [2.27.0](https://github.com/openfoodfacts/openfoodfacts-server/compare/v2.26.0...v2.27.0) (2024-02-06)


### Features

* Added email warning in the Producers Platform ([#9690](https://github.com/openfoodfacts/openfoodfacts-server/issues/9690)) ([5739557](https://github.com/openfoodfacts/openfoodfacts-server/commit/5739557eca6e3b7c3e2459c9844e647550d01a8d))
* Allowing Users to subscribe to the pro-newsletter ([#8856](https://github.com/openfoodfacts/openfoodfacts-server/issues/8856)) ([385b03d](https://github.com/openfoodfacts/openfoodfacts-server/commit/385b03d18a3465a133e202ce6af93ef219bb6b74))
* dq_category_specific_ingredient_percent_3 ([#9707](https://github.com/openfoodfacts/openfoodfacts-server/issues/9707)) ([473db4c](https://github.com/openfoodfacts/openfoodfacts-server/commit/473db4cbcba774a5f2a853ec112509efcb2f164b))
* dq_detect_url_in_ingredients ([#9586](https://github.com/openfoodfacts/openfoodfacts-server/issues/9586)) ([5695fb4](https://github.com/openfoodfacts/openfoodfacts-server/commit/5695fb48b060fa89b54b8e3fa159beeb7be3b6e8))
* new Nutri-Score v2 2023 knowledge panels ([#9689](https://github.com/openfoodfacts/openfoodfacts-server/issues/9689)) ([8fb04fa](https://github.com/openfoodfacts/openfoodfacts-server/commit/8fb04face03a79578b4336c5159cb6e7c2625e08))
* quality translations ([#9671](https://github.com/openfoodfacts/openfoodfacts-server/issues/9671)) ([4f8d11c](https://github.com/openfoodfacts/openfoodfacts-server/commit/4f8d11cca433c5c7ef00260716123c24602b4388))


### Bug Fixes

* add unit to output of /cgi/nutrients.pl ([#9751](https://github.com/openfoodfacts/openfoodfacts-server/issues/9751)) ([fd02df6](https://github.com/openfoodfacts/openfoodfacts-server/commit/fd02df6dffa10b41e0e1347e07b9b09f4bb18783))
* ADEME logo upload ([#9738](https://github.com/openfoodfacts/openfoodfacts-server/issues/9738)) ([c0a8c55](https://github.com/openfoodfacts/openfoodfacts-server/commit/c0a8c55e824998666a78afabafa24ea2df1b3244))
* avoid division by 0 in image crop ([#9192](https://github.com/openfoodfacts/openfoodfacts-server/issues/9192)) ([417a4c0](https://github.com/openfoodfacts/openfoodfacts-server/commit/417a4c0de43b234b07f608400fdbf12aaf38c25d))
* dq_all_val_in_nutrition_are_identical_2 ([#9598](https://github.com/openfoodfacts/openfoodfacts-server/issues/9598)) ([8e91c90](https://github.com/openfoodfacts/openfoodfacts-server/commit/8e91c9027c44d557638dd0c4a910f08f6b78ea91))
* fix cache on countries list ([#9721](https://github.com/openfoodfacts/openfoodfacts-server/issues/9721)) ([867c794](https://github.com/openfoodfacts/openfoodfacts-server/commit/867c794229d516b9ca30b4cd7869e217c746f7b2))
* fix docker profile repetition for postgresql container ([#9693](https://github.com/openfoodfacts/openfoodfacts-server/issues/9693)) ([55a9b22](https://github.com/openfoodfacts/openfoodfacts-server/commit/55a9b221fd8aa6f2d6af05c27b78febd9b398cc1))
* fix madenearme script name ([#9719](https://github.com/openfoodfacts/openfoodfacts-server/issues/9719)) ([8bc9295](https://github.com/openfoodfacts/openfoodfacts-server/commit/8bc9295516a0afe848daaecae6ece1ccd043bd70))
* fix test taxonomies ([2f08865](https://github.com/openfoodfacts/openfoodfacts-server/commit/2f08865bec83724af70bb392bbc65655036ead01))
* fix_dq_facet_all_values_identical ([#9722](https://github.com/openfoodfacts/openfoodfacts-server/issues/9722)) ([dc04d18](https://github.com/openfoodfacts/openfoodfacts-server/commit/dc04d189c6010f9bc06b62d025056ddb7abc4ccd))
* last_modified_t needs to be a number and not a string ([#9705](https://github.com/openfoodfacts/openfoodfacts-server/issues/9705)) ([3f42fa7](https://github.com/openfoodfacts/openfoodfacts-server/commit/3f42fa71738b12428542948158711a1921599dd1)), closes [#9686](https://github.com/openfoodfacts/openfoodfacts-server/issues/9686)
* line endings in taxonomies ([#9749](https://github.com/openfoodfacts/openfoodfacts-server/issues/9749)) ([6cad186](https://github.com/openfoodfacts/openfoodfacts-server/commit/6cad1865d4682e7703db27204c6d7ddbb3d5fd37))
* move script syncing images to s3 to product-opener ([#9724](https://github.com/openfoodfacts/openfoodfacts-server/issues/9724)) ([46479c4](https://github.com/openfoodfacts/openfoodfacts-server/commit/46479c44f325c0da8801b68e13a59058b5a91c2f))
* new logo on how much sugar ([#9704](https://github.com/openfoodfacts/openfoodfacts-server/issues/9704)) ([2319dcb](https://github.com/openfoodfacts/openfoodfacts-server/commit/2319dcb34be0657aaf25a1ff5f6d810b5c5d3e03))
* use a different redis stream depending on the project ([#9725](https://github.com/openfoodfacts/openfoodfacts-server/issues/9725)) ([cdcdf05](https://github.com/openfoodfacts/openfoodfacts-server/commit/cdcdf054ba5bb70fbabf0384f986db4d798e5455))


### Taxonomy

* Add polish herbs translations ([#9662](https://github.com/openfoodfacts/openfoodfacts-server/issues/9662)) ([d26a27b](https://github.com/openfoodfacts/openfoodfacts-server/commit/d26a27b670d74a5dd5ff3b960d6e761015d6a91e))
* Add translations in Spanish ([#9657](https://github.com/openfoodfacts/openfoodfacts-server/issues/9657)) ([b9ed1c5](https://github.com/openfoodfacts/openfoodfacts-server/commit/b9ed1c56758f0cacfaecf1cb4a24ec535d392aee))
* Add/update translations ([#8930](https://github.com/openfoodfacts/openfoodfacts-server/issues/8930)) ([391b2fc](https://github.com/openfoodfacts/openfoodfacts-server/commit/391b2fc529a16de283b5c7d97298e7aee81e0f4c))
* Category translations ([#9673](https://github.com/openfoodfacts/openfoodfacts-server/issues/9673)) ([36f884a](https://github.com/openfoodfacts/openfoodfacts-server/commit/36f884a219fd8972d0e98a1078ae6c63e71668de))
* correction sweet spreads ([#9709](https://github.com/openfoodfacts/openfoodfacts-server/issues/9709)) ([8b70598](https://github.com/openfoodfacts/openfoodfacts-server/commit/8b705988b50d088959091ff1ffe6963a394e141c))
* fix taxonomies ([#9730](https://github.com/openfoodfacts/openfoodfacts-server/issues/9730)) ([03721b6](https://github.com/openfoodfacts/openfoodfacts-server/commit/03721b63ae8820dfca771be89d5951e07516907c))
* fix test taxonomies ([#9672](https://github.com/openfoodfacts/openfoodfacts-server/issues/9672)) ([2f08865](https://github.com/openfoodfacts/openfoodfacts-server/commit/2f08865bec83724af70bb392bbc65655036ead01))
* food_groups ([#9696](https://github.com/openfoodfacts/openfoodfacts-server/issues/9696)) ([829f750](https://github.com/openfoodfacts/openfoodfacts-server/commit/829f750e0780230e7c911af55d89be5e541d78c4))
* frozen food boost plus many additions ([#9753](https://github.com/openfoodfacts/openfoodfacts-server/issues/9753)) ([28610f8](https://github.com/openfoodfacts/openfoodfacts-server/commit/28610f82e7dcffa90e2076c9e73db13d5b049c11))
* hr_upd_label_provratna_naknada ([#9656](https://github.com/openfoodfacts/openfoodfacts-server/issues/9656)) ([ea274db](https://github.com/openfoodfacts/openfoodfacts-server/commit/ea274dbe854178a53e1a9ae6b8d73a9d0008b0f7))
* ingredients processing ([#9700](https://github.com/openfoodfacts/openfoodfacts-server/issues/9700)) ([d98aedb](https://github.com/openfoodfacts/openfoodfacts-server/commit/d98aedb96cadf42d138e875d4d8b088c2f71c006))
* labels_categories ([#9699](https://github.com/openfoodfacts/openfoodfacts-server/issues/9699)) ([0762007](https://github.com/openfoodfacts/openfoodfacts-server/commit/0762007e2d1e844d12d8aef93d007c9e152c506a))
* meringue roulades ([#9675](https://github.com/openfoodfacts/openfoodfacts-server/issues/9675)) ([dabd3c3](https://github.com/openfoodfacts/openfoodfacts-server/commit/dabd3c31f59b6b7ed9d37f9cb2d80de7f9fc9fb8))
* more CIQUAL categories for ingredients ([#9717](https://github.com/openfoodfacts/openfoodfacts-server/issues/9717)) ([9093b69](https://github.com/openfoodfacts/openfoodfacts-server/commit/9093b6966a5014d898443e02b91d70631a6117c0))
* parsing plant proteins in French and German ([#9605](https://github.com/openfoodfacts/openfoodfacts-server/issues/9605)) ([5dd23ff](https://github.com/openfoodfacts/openfoodfacts-server/commit/5dd23ff5448a6b97fb98db48faff7fd0b5da395a))
* soy_sauce_vegan ([#9589](https://github.com/openfoodfacts/openfoodfacts-server/issues/9589)) ([0708361](https://github.com/openfoodfacts/openfoodfacts-server/commit/0708361855c44453f965558cd6221ab11a7f7c9e))
* syn german nuts ([#9743](https://github.com/openfoodfacts/openfoodfacts-server/issues/9743)) ([9476a56](https://github.com/openfoodfacts/openfoodfacts-server/commit/9476a569d024768247bf3ec53c94bb5af9e3c9e0))
* tax_world_forum_request ([#9668](https://github.com/openfoodfacts/openfoodfacts-server/issues/9668)) ([aef237f](https://github.com/openfoodfacts/openfoodfacts-server/commit/aef237fbf9937b8c76c9a633b24b0c0c73f0e0b0))
* translate states ([#9697](https://github.com/openfoodfacts/openfoodfacts-server/issues/9697)) ([035c3ea](https://github.com/openfoodfacts/openfoodfacts-server/commit/035c3ea7a037b4048e06a473d2681240e06e2ff5))
* upd categories to reflect EU regulations ([#9601](https://github.com/openfoodfacts/openfoodfacts-server/issues/9601)) ([a76af70](https://github.com/openfoodfacts/openfoodfacts-server/commit/a76af70a26a731ffe700d875d13c38352bb882ae))


### Technical

* add comment field ([#9703](https://github.com/openfoodfacts/openfoodfacts-server/issues/9703)) ([d183732](https://github.com/openfoodfacts/openfoodfacts-server/commit/d183732b19b9cd3b2efe400f15d26e68f8e88d64))
* document OCR detection type ([#9750](https://github.com/openfoodfacts/openfoodfacts-server/issues/9750)) ([0aca46a](https://github.com/openfoodfacts/openfoodfacts-server/commit/0aca46af4028c4fa1784ca1a8a20d55b55ae8810))
* images url computation ([#9670](https://github.com/openfoodfacts/openfoodfacts-server/issues/9670)) ([3deb4e0](https://github.com/openfoodfacts/openfoodfacts-server/commit/3deb4e03b9e0e744010c0f1488f9a525385459ad))
* mark nutrients properties that are readOnly ([#9720](https://github.com/openfoodfacts/openfoodfacts-server/issues/9720)) ([a777e49](https://github.com/openfoodfacts/openfoodfacts-server/commit/a777e49b6fee9793eb07fed5e87fdce3bf9cd93a))
* small improvement to eco score api ref ([#9691](https://github.com/openfoodfacts/openfoodfacts-server/issues/9691)) ([905cbbd](https://github.com/openfoodfacts/openfoodfacts-server/commit/905cbbdfff5ed7ff01aca76c07bc0c8517513523))

## [2.26.0](https://github.com/openfoodfacts/openfoodfacts-server/compare/v2.25.0...v2.26.0) (2024-01-17)


Expand Down
4 changes: 4 additions & 0 deletions cgi/nutrients.pl
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,10 @@
if (defined $name) {
$current_ref->{name} = $name;
}
my $unit = get_property("nutrients", "zz:$onid", "unit:en") // 'g';
if (defined $unit) {
$current_ref->{unit} = $unit;
}

my $prefix_length = 0;
if ($nid =~ s/^--//g) {
Expand Down
53 changes: 32 additions & 21 deletions docs/api/ref/api-v3.yml
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,8 @@ paths:
schema:
type: string
example: '3017620422003'
- schema:
type: string
in: query
name: lc
description: '2 letter code of the language of the interface. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the language may be inferred by the country of the user (passed through the cc field or inferred by the IP address).'
- schema:
type: string
in: query
name: cc
description: '2 letter code of the country of the user. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the country may be inferred by the IP address of the request.'
- $ref: '#/components/parameters/cc'
- $ref: '#/components/parameters/lc'
- schema:
type: string
in: query
Expand Down Expand Up @@ -265,23 +257,14 @@ paths:
If a string is passed, an additional sort is done to put first suggestions that start with the string, followed by suggestions with a word that start with the string, and then suggestions that contain the string anywhere.
parameters:
- $ref: ./api.yml#/components/parameters/tagtype
- schema:
type: string
example: en
in: query
name: lc
description: 2 letter code of the language used for suggestions and for matching the input string
- $ref: '#/components/parameters/cc'
- $ref: '#/components/parameters/lc'
- schema:
type: string
example: pe
in: query
name: string
description: 'Optional string used to filter suggestions (useful for autocomplete). If passed, suggestions starting with the string will be returned first, followed by suggestions matching the string at the beginning of a word, and suggestions matching the string inside a word.'
- schema:
type: string
in: query
name: cc
description: '2 letter country code, used to return popular packaging shapes and materials for products sold in the country'
- schema:
type: string
example: yougurts
Expand All @@ -306,6 +289,8 @@ paths:
description: Alias for the "string" parameter provided for backward compatibility. "string" takes precedence.
'/api/v3/tag/{tagtype}/{tag_or_tagid}':
parameters:
- $ref: '#/components/parameters/cc'
- $ref: '#/components/parameters/lc'
- schema:
type: string
example: categories
Expand Down Expand Up @@ -364,6 +349,32 @@ paths:
Categories:
- Packaging stats for a category
components:
parameters:
cc:
schema:
type: string
example: 'us'
in: query
name: cc
required: false
description: '2 letter code of the country of the user. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the country may be inferred by the IP address of the request.'
lc:
schema:
type: string
example: 'fr'
in: query
name: lc
required: false
description: '2 letter code of the language of the user. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the language may be inferred by the Accept-Language header of the request.'
code:
schema:
type: string
example: '4251105501381'
in: query
name: code
description: Barcode of the product
required: true
tags:
- name: Read Requests
- name: Write Requests
35 changes: 34 additions & 1 deletion docs/api/ref/api.yml
Original file line number Diff line number Diff line change
Expand Up @@ -295,6 +295,24 @@ paths:
all packaging_shapes containing "fe" will be returned.
This is useful if you have a search in your application,
for a specific product field.
/cgi/nutrients.pl:
get:
summary: Get a nested list of nutrients that can be displayed in the nutrition facts table for a specific country and language
tags:
- Read Requests
responses:
'200':
description: OK
content:
application/json:
schema:
$ref: ./responses/get_nutrients.yaml
operationId: get-cgi-nutrients.pl
parameters:
- $ref: '#/components/parameters/cc'
- $ref: '#/components/parameters/lc'
description: |
Used to display the nutrition facts table of a product, or to display a form to input those nutrition facts.
components:
schemas:
"Product-Base":
Expand Down Expand Up @@ -327,6 +345,22 @@ components:
in: query
name: id
required: true
cc:
schema:
type: string
example: 'us'
in: query
name: cc
required: false
description: '2 letter code of the country of the user. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the country may be inferred by the IP address of the request.'
lc:
schema:
type: string
example: 'fr'
in: query
name: lc
required: false
description: '2 letter code of the language of the user. Used for localizing some fields in returned values (e.g. knowledge panels). If not passed, the language may be inferred by the Accept-Language header of the request.'
code:
schema:
type: string
Expand Down Expand Up @@ -363,7 +397,6 @@ components:
in: query
name: angle
required: true

sort_by:
schema:
type: string
Expand Down
1 change: 1 addition & 0 deletions docs/api/ref/responses/get_nutrients.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
$ref: ../schemas/nutrients.yaml
21 changes: 21 additions & 0 deletions docs/api/ref/schemas/nutrient_unit.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
description: |
The unit in which the nutrient for 100g or per serving is measured.
The possible values depends on the nutrient.
* `g` for grams
* `mg` for milligrams
* `μg` for micrograms
* `cl` for centiliters
* `ml` for mililiters
* `dv` for recommended daily intakes (aka [Dietary Reference Intake](https://en.wikipedia.org/wiki/Dietary_Reference_Intake))
* `% vol` for percentage per volume (e.g. alcohol vol per 100 ml)
* `%` for percentage
🤓 code: see the [Units module][units-module],
and [Food:default_unit_for_nid function][default-unit]
[units-module]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Units.html
[default-unit]: https://openfoodfacts.github.io/openfoodfacts-server/dev/ref-perl-pod/ProductOpener/Food.html#default_unit_for_nid_(_%24nid)
type: string
enum: ['g','mg','μg','cl','ml','dv','% vol','%']
26 changes: 26 additions & 0 deletions docs/api/ref/schemas/nutrients.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
type: array
description: |
Nutrients and sub-nutrients of a product, with their name and default unit.
items:
type: object
properties:
id:
type: string
description: id of the nutrient
name:
type: string
description: Name of the nutrient in the requested language
important:
type: boolean
description: Indicates if the nutrient is always shown on the nutrition facts table
display_in_edit_form:
type: boolean
description: Indicates if the nutrient should be shown in the nutrition facts edit form
unit:
description: Default unit of the nutrient
$ref: "./nutrient_unit.yaml"
nutrients:
description: |
Sub-nutrients (e.g. saturated-fat is a sub-nutrient of fat).
# self recursive
$ref: "#/"
2 changes: 1 addition & 1 deletion html/donate/fi.html
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@

<meta property="fb:app_id" content="219331381518041" />
<meta property="og:type" content="article" />
<meta property="og:title" content="Help us lead the change in the food sector!" />
<meta property="og:title" content="Auta meitä johtamaan muutosta elintarvikealalla!" />
<meta
property="og:url"
content="https://world.openfoodfacts.org/donate-to-open-food-facts?utm_source=donate-page-share&utm_campaign=donation-2024&utm_content=donate-page-share-en"
Expand Down
Loading

0 comments on commit fc1aca6

Please sign in to comment.