-
-
Notifications
You must be signed in to change notification settings - Fork 383
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: Added a description line to the import spreadsheet template #9920
fix: Added a description line to the import spreadsheet template #9920
Conversation
@anaritadauane Thank you! For some reason, I get a completely empty spreadsheet when I run your branch, that's weird. |
Really? Let me check |
This is what I get in the logs:
There's a missing $ |
To see errors, you can do ~/openfoodfacts-server/logs/apache2$ tail -f modperl_error_log |
Thanks, I had to fork the repo to pull the request, then copy the changes and add some changes to the unforked repo to make a PR. I think I needed to go back and test the code to see if there were any errors. |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #9920 +/- ##
==========================================
- Coverage 49.54% 49.52% -0.03%
==========================================
Files 67 71 +4
Lines 20650 20897 +247
Branches 4980 5018 +38
==========================================
+ Hits 10231 10349 +118
- Misses 9131 9254 +123
- Partials 1288 1294 +6 ☔ View full report in Codecov by Sentry. |
I have fixed the errors |
@anaritadauane It works now, thank you! This is what I'm getting when I open the file with LibreOffice Calc, is there a way to get more height in Description cells? |
cgi/generate_sample_import_file.pl
Outdated
my $comment; | ||
|
||
$worksheet->set_column('A:A', 30); | ||
$worksheet->write( $description_row, 0, "Description", $formats{'description'}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you make "Description" a translatable string?
To do that, you need to put lang("description") instead, and then add a stringid "description" in po/common.po and po/en.po (and it would be good to add it in another language so that you can test that you get a different string if you load for instance the site in Spanish: http://es.openfoodfacts.localhost/cgi/generate_sample_import_file.pl
Once you have added / changed a string in po/common.pot / en.po / es.po , you need to run:
make build_lang
make restart
and then you can use lang("description") in the Perl file instead of "Description".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Followed the instructions and turned "Description" into a translatable string
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@anaritadauane Great :)
Can you also add this to en.po so that we have an English translation (English is the default):
msgctxt "description"
msgid "Description"
msgstr "Description"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done
@anaritadauane looks good, thank you! just one request to make the "Description" text translatable |
Great! I will add the additional requests. |
po/common/es.po
Outdated
@@ -489,6 +489,10 @@ msgctxt "delete_confirmation" | |||
msgid "This will delete your user details and anonymise all of your contributions. Please re-enter your user name to confirm." | |||
msgstr "Esto eliminará sus datos de usuario y anonimizará todas sus contribuciones. Vuelva a ingresar su nombre de usuario para confirmar." | |||
|
|||
msgctxt "description" | |||
msgid "Descripton" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
small typo, msgid should always be the same as the English translation
msgid "Descripton" | |
msgid "Description" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
sorry 😅, fixed the typo and changed the en.po file
@anaritadauane Could you run "make lint" to fix the formatting? Thank you! |
Quality Gate passedIssues Measures |
Yes |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good, thank you! :)
What
I added a description row to the import spreadsheet template, which now includes all the comments previously located in the header line.
Screenshot
Related issue(s) and discussion