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

#468 Minutes instead of minutos in Spanish #538

Merged

Conversation

jmunoz94
Copy link
Contributor

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 a timedelta, a new filter to get the duration as a timedelta was added (since I could not find an existing, straightforward function to use, the closes was timesince which returns a str).

Changes

  • Add deltasince, a new filter that calculates duration and returns a timedelta.
  • Update *_last.html templates to use deltasince followed by duration_string (with minutes precision) instead of timesince.
  • Add a test for deltasince.
  • Fix a typo in duration.py.

Spanish:
image

Portuguese:
image

Italian (this one already worked, adding it as a proof that other languages did not break):
image

@coveralls
Copy link

Coverage Status

Coverage decreased (-0.04%) to 99.152% when pulling 648ca6c on jmunoz94:468_minutes_instead_of_minutos_in_spanish into 62bde09 on babybuddy:master.

@cdubz cdubz temporarily deployed to babybuddy-pr-538 October 12, 2022 02:07 Inactive
@cdubz cdubz added bug Reports of unexpected problems or errors enhancement Feature requests or improvements to existing functionality i18n/L10n Issues relating to internationalization and/or localization hacktoberfest-accepted PRs accepted for Hacktoberfest events labels Oct 12, 2022
Copy link
Member

@cdubz cdubz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks, again, for your deep research and work on this! Really appreciate getting this fixed.

@cdubz cdubz merged commit 5b171ff into babybuddy:master Oct 12, 2022
@cdubz cdubz added this to the 1.12.3 milestone Oct 12, 2022
@jmunoz94 jmunoz94 deleted the 468_minutes_instead_of_minutos_in_spanish branch October 12, 2022 18:28
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Reports of unexpected problems or errors enhancement Feature requests or improvements to existing functionality hacktoberfest-accepted PRs accepted for Hacktoberfest events i18n/L10n Issues relating to internationalization and/or localization
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Minutes instead of minutos in Spanish
3 participants