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

missing translation of Nutrition Information #495

Closed
cloud2018 opened this issue Jan 10, 2021 · 10 comments
Closed

missing translation of Nutrition Information #495

cloud2018 opened this issue Jan 10, 2021 · 10 comments
Assignees
Labels
bug Something isn't working

Comments

@cloud2018
Copy link

Description

  1. In edit mode in block Nutrition Information "Select option" is not translated and the string is not available in Transifex
  2. In view mode in block Nutrition Information the names of nutrions are not translated, but the strings are available in Transifex and are used in the drop down box

Screenshot 1
cb1

Screenshot 2
cb2

@cloud2018 cloud2018 added the bug Something isn't working label Jan 10, 2021
@christianlupus
Copy link
Collaborator

In general this should be translatable. In the vue files the translation is prepared. This is most probably an issue with the parser of transifex.

@christianlupus christianlupus self-assigned this Jan 11, 2021
@cloud2018
Copy link
Author

@christianlupus yes, when editing the nutrions are translated ("Zuckergehalt" in 1st screenshot) as in your linked file cookbook/src/components/RecipeEdit.vue. Only "Select option" is not translated, perhaps a nextcloud issue, not a cookbook issue.

But in the view-mode the nutrions are not translated. Maybe because the t-functions inside the titles are surrounded by ",

<recipe-nutrition-info-item v-if="('servingSize' in nutrition) && !isNullOrEmpty(nutrition['servingSize'])" :title="t('cookbook', 'Serving Size')" :data="nutrition['servingSize']" />

@christianlupus
Copy link
Collaborator

@cloud2018 No I doubt that. The " are there from the Vue.js requirements. The must be there. See e.g. here where it is working.

I just checked and found that the translations seem to be exported from the vue files correctly but are somehow not transferred to transifex. I opened an issue there and now we have to see what's happening next.

@christianlupus
Copy link
Collaborator

I just found a workaround for the problem but that needs a complete overhaul of the code base. In fact, after the translation no more arguments should be given. Exampe see the upstream bug report.

@seyfeb
Copy link
Collaborator

seyfeb commented Feb 13, 2021

So you’re saying that writing

<recipe-nutrition-info-item v-if="('sugarContent' in recipe.nutrition) && !isNullOrEmpty(recipe.nutrition['sugarContent'])" :title="t('cookbook', 'Sugar')" :data="recipe.nutrition['sugarContent']" />

as

<recipe-nutrition-info-item v-if="('sugarContent' in recipe.nutrition) && !isNullOrEmpty(recipe.nutrition['sugarContent'])"
  :title="t('cookbook', 'Sugar')" 
  :data="recipe.nutrition['sugarContent']" />

should solve the issue as long as the upstream bug is present? Then, I would update those to have a quick fix.

@christianlupus
Copy link
Collaborator

Yes, this is correct. In the example above the regex currently in use by the transifex integration will use Sugar')" :data="recipe.nutrition['sugarContent as the original (English) text which in turn will break other file formats.

One remark: I am just working on issue #532 and #531. During the run of prettier (part of it), the suggested changes from you will be auto-generated. That would speed up that refactoring process much.

@seyfeb
Copy link
Collaborator

seyfeb commented Feb 13, 2021

Alright, I leave you to it then!

@cloud2018
Copy link
Author

Is there a workaround for untranslated "Select option" from screenhot 1, too?

@seyfeb
Copy link
Collaborator

seyfeb commented Feb 16, 2021

It wouldn’t’ve worked for “Select option” but should now.

@christianlupus
Copy link
Collaborator

With #607 the missing translations should be available by the next nightly run of the nextcloud bot.

I will close here as we have to wait for the next release to get the translations into the app.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants