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 an example line to the import spreadsheet template on the producers platform #9874

Closed
Tracked by #9872
stephanegigandet opened this issue Mar 6, 2024 · 4 comments
Labels
good first issue Welcome to Open Food Facts. This issue should be approachable if you're new. Get in touch for help. 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers

Comments

@stephanegigandet
Copy link
Contributor

stephanegigandet commented Mar 6, 2024

This issue is part of #9872 , please see the parent issue for context and guidance on how to work on this issue.

We want to add 2 lines to the import template (generated by https://world.pro.openfoodfacts.org/cgi/generate_sample_import_file.pl ):

  • a description line that should contain what we currently have in the comments in the header line (and then we can remove the comments)
  • an example line

This issue is about adding the example line.

We also need add one first column that just contains "description" and "example" for those 2 lines, and nothing for the the other rows.

See the template proposal: https://docs.google.com/spreadsheets/d/148PWIsSfDRsj8gLJ7cHbQtdapIEscUwX/edit#gid=1221199414 :

We will need to change the importing so that rows that contain something in the first column are skipped.

Examples should be translated in different languages.
https://fr.pro.openfoodfacts.org/cgi/generate_sample_import_file.pl should have examples in French.

The examples translations are stored in a TSV file in GitHub: https://github.com/openfoodfacts/openfoodfacts-server/blob/main/conf/pro-platform/Import%20template%20-%20Example%20translations%20-%20Import%20sheet.tsv

The TSV file has the same columns as the English template, and one row per language, with the language code in the first column. That way it will be easy to edit the examples, add more languages etc.

When generating the import template, we will need to:

  • load the conf/pro-platform/Import%20template%20-%20Example%20translations%20-%20Import%20sheet.tsv TSV file
  • select the line with language corresponding to the language of the import template we are generating ( $lc contains the language code). If there isn't a matching language (e.g. Italian is requested, but we only have English and French: use English).
  • For each column of the generated import template, check if we have a corresponding column (same header name) in the example file. We cannot rely in the order of the columns, because it's possible that we will be adding / removing some columns. e.g. we will soon generate a "simple" version of the import template with less columns.
@stephanegigandet stephanegigandet added good first issue Welcome to Open Food Facts. This issue should be approachable if you're new. Get in touch for help. 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers labels Mar 6, 2024
@stephanegigandet stephanegigandet changed the title Add description and example lines to the import spreadsheet template on the producers platform Add an example line to the import spreadsheet template on the producers platform Mar 7, 2024
@Shruti-S0405
Copy link

Hello, I would like to contribute on this issue.

@anaritadauane
Copy link
Contributor

Hi @Shruti-S0405, are you still working on this?

@TheSussex
Copy link
Collaborator

Looks like @Shruti-S0405 is no longer working on this so I have started working on it.

@stephanegigandet
Copy link
Contributor Author

Fixed by @TheSussex : #9975 Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Welcome to Open Food Facts. This issue should be approachable if you're new. Get in touch for help. 🏭 Producers Platform https://wiki.openfoodfacts.org/Platform_for_producers
Projects
4 participants