rezemika / humanized_opening_hours

A parser for the opening_hours fields from OpenStreetMap
GNU Affero General Public License v3.0
26 stars 20 forks source link

The pt translation requires a different approach on reference to the days of the week #21

Closed ogabrielluiz closed 5 years ago

ogabrielluiz commented 5 years ago

In english we write "on {weekday}" but in portuguese we have to write "na segunda"(on monday) and "no sábado"(on saturday). Weekend days are male nouns. Basically this: na segunda-feira na terça-feira na quarta-feira na quinta-feira na sexta-feira no sábado no domingo

rezemika commented 5 years ago

Oh, it's quite annoying... I confess that I'm really far to be an expert of localization, I don't really know how to do a workaround for this... Anyway, thank you for your report!

ogabrielluiz commented 5 years ago

I'll think a bit about this. Maybe a condition to check the locale and change an element in the appropriate function based on weekday_name.

Em Sáb, 6 de out de 2018 13:05, Michael Marx notifications@github.com escreveu:

Oh, it's quite annoying... I confess that I'm really far to be an expert of localization, I don't really know how to do a workaround for this... Anyway, thank you for your report!

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/rezemika/humanized_opening_hours/issues/21#issuecomment-427585494, or mute the thread https://github.com/notifications/unsubscribe-auth/AXrd1Yo6xOIsyydBAXOTOnACvT0O6Z54ks5uiNTQgaJpZM4XLasf .

GioBonvi commented 5 years ago

I'll just leave this here because it's related: we do have similar rules in italian (mainly related to male/female names, but also to ellipsis between articles/prepositions and names).
When I wrote the translation I tried to make the choices that would make it work for most cases.

This is one example: "from {month} {day1} to {day2}" is usually translated to "dal {day1} {month} al {day2}", but some numbers are different: e.g. if {day1} is 1 ("uno" in italian) it should become "dall'{day1} {month} al {day2}" instead.
However, while technically "dal 1" is not correct it's universally understood and often used in internationalizations to avoid complicating the code for such a small number of edge cases.

rezemika commented 5 years ago

As the fix of this issue would probably require a complete rewrite of the rendering logic, I think I'll mark this issue as a wontfix, and I'll think about it if I do a v2.