#468 Minutes instead of minutos in Spanish #538
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #468
Background
Users noticed that in the home cards in the Spanish version instead of "minutos" babybuddy shows "minutes". Upon further investigation, we noticed that "minuto" is also misspelled as "minutos" in Spanish and Portuguese is also affected by the bug.
The root cause of this issue are incorrect translations in Django. PO files for Spanish and Portuguese use either the wrong format or have been wrongly translated. As a workaround, it was suggested that we use
duration_string
.Since
duration_string
string expects atimedelta
, a new filter to get the duration as atimedelta
was added (since I could not find an existing, straightforward function to use, the closes wastimesince
which returns astr
).Changes
deltasince
, a new filter that calculates duration and returns a timedelta.deltasince
followed byduration_string
(withm
inutes precision) instead oftimesince
.deltasince
.duration.py
.Spanish:
Portuguese:
Italian (this one already worked, adding it as a proof that other languages did not break):