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

Add the ability in the API to remove a translated field from a product #8367

Open
Tracked by #8049
monsieurtanuki opened this issue Apr 26, 2023 · 2 comments
Open
Tracked by #8049
Labels
API WRITE WRITE API to allow sending product info and image 🤳🥫 mobile apps 🌍 Multilingual products Product name, Generic name, Ingredients, Packaging text are multilingual fields. ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. ⭐ 🐛 top bug Top bug.

Comments

@monsieurtanuki
Copy link
Contributor

monsieurtanuki commented Apr 26, 2023

What

  • For some reason, there may be a translation that has nothing to do here (e.g. a product name translated in English, but it was a typo as the language has no translation in English and the user meant a translation in another language).

We should be able to remove it

  • for consistency (e.g. no corrupted English product name translation here)
  • and for side effects (e.g. the English product name taking precedency, it becomes the de facto translation for other languages as product_name).

We cannot remove a translation today: if we put an empty string the translation becomes a "populated" empty string.
I also tried to put explicitly a null value instead of an empty string, but got rejected by /cgi/product_jqm2.pl: "Could not save product - null".

To Reproduce

Affected tags:

  • 'product_name_'
  • 'ingredients_text_'
  • 'packaging_text_'

Affected product:

No "product_name" for the Italian version, and an empty translation for English:
https://it.openfoodfacts.org/api/v3/product/3760091722508?fields=product_name,product_name_languages&lc=it

{
	"code": "3760091722508",
	"errors": [],
	"product": {
		"product_name_languages": {
			"en": "",
			"es": "Chocolate negro Madagascar 85% cacao",
			"fr": "Chocolat noir 85% de Madagascar"
		}
	},
	"result": {
		"id": "product_found",
		"lc_name": "Prodotto trovato",
		"name": "Product found"
	},
	"status": "success",
	"warnings": []
}

Expected behavior

  • we should be able to remove a translation
  • I also expected a default translation in product_name, like the English or the first translation available

Type of device

REST-API

Part of

@github-actions
Copy link
Contributor

github-actions bot commented Aug 7, 2023

This issue is stale because it has been open 90 days with no activity.

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Aug 7, 2023
@teolemon teolemon added 🌍 Multilingual products Product name, Generic name, Ingredients, Packaging text are multilingual fields. and removed multilingual products (old) labels Aug 30, 2023
@github-actions github-actions bot removed the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Aug 31, 2023
@teolemon teolemon changed the title Add the ability to remove a translation Add the ability in the API to remove a translated field from a product Sep 5, 2023
Copy link
Contributor

This issue has been open 90 days with no activity. Can you give it a little love by linking it to a parent issue, adding relevant labels and projets, creating a mockup if applicable, adding code pointers from https://github.com/openfoodfacts/openfoodfacts-server/blob/main/.github/labeler.yml, giving it a priority, editing the original issue to have a more comprehensive description… Thank you very much for your contribution to 🍊 Open Food Facts

@github-actions github-actions bot added the ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. label Dec 17, 2023
@teolemon teolemon removed the 🐛 bug This is a bug, not a feature request. label Oct 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
API WRITE WRITE API to allow sending product info and image 🤳🥫 mobile apps 🌍 Multilingual products Product name, Generic name, Ingredients, Packaging text are multilingual fields. ⏰ Stale This issue hasn't seen activity in a while. You can try documenting more to unblock it. ⭐ 🐛 top bug Top bug.
Projects
Status: To discuss and validate
Development

No branches or pull requests

2 participants