[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Health-dev] [bug #64445] Make y, m, d of years_months_days string retur

From: Feng Shu
Subject: [Health-dev] [bug #64445] Make y, m, d of years_months_days string returned by compute_age_from_dates translatable.
Date: Wed, 19 Jul 2023 20:26:26 -0400 (EDT)

Follow-up Comment #5, bug #64445 (project health):

[comment #4 comment #4:]
> I did update the DB but with health_gyneco from last refresh. Funny the "h"

I have found the reason, update health is needed, if not:

gettext('health.msg_compute_age_from_dates_year_str') =


gettext('health.msg_compute_age_from_dates_year_str')[0] = 'h'   :-)

> Since it's a new feature, we'll move it to a task to incorporate in 4.4
> We have to check things such as the translated string does not take more
than 1 char and things like that.

At the moment, I use gettext('health.msg_compute_age_from_dates_year_str')[0],
so alway get a char string, if a language
can not find a char abbr of year, month, day.   y/m/d should be use.

> The actual age string is used in many places, including the page of life
({"name": "age", "value": "35y 4m 27d") that goes to the Thalamus and
Federation, so we must be very careful with this.

Thalamus and Federation use unicode at the moment, so I think utf-8 is not

if thalamus and federation do not parse age info depend 'y' 'm' 'd' three
string, I think no other problem :-)

> I like the idea of having the localized representation of years, months and
days, but the original string should be the one that is stored.
> Another option is to use the date elements (year, month, day) within
brackets. That will give us the possibility of using more than one char in the
representation. Something like this:

seem to good idea, but I do not know how many code need to edit :-)

> 42[Y] 11[M] 9[D] 
> The long repr should be valid too
> 42[Years] 11[Months] 9[Days] 

I think long repr may be not a good idea, the reason:
1. it will use more space in view and report ...
2. it will break mamy (third part) packages depend on health
3. '42y 11m 9d' style work well in most situation, if a language support one
char abbr of year, month, day, translation is good, if not, i think just use


> I have implemented the "raw_age" argument in the compute_age_from_dates
method, that returns a list in the form [year, months, days]. We can probably
play with this too.

seem to be a good idea, but many code need change :-)

> Finally, I started a while ago transitioning to f-string. I think is a great
moment to do it on years_months_days var.
> PS.Check on the doc, the 
>         ##   day   = split(' ')[1][:-1]
> Should be
>         ##   day   = split(' ')[2][:-1]

I will fix it.

> Let me know your thoughts and thank you for these great contributions!
> Bests
> Luis


Reply to this item at:


Message sent via Savannah

reply via email to

[Prev in Thread] Current Thread [Next in Thread]