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

Added italian (it_IT) translation. #17

Closed GioBonvi closed 5 years ago

GioBonvi commented 5 years ago

As per the title I've added the italian translation.

I've tested it running all the supported field formats and the language looks ok to me:

['Aperto 24 ore al giorno, 7 giorni alla settimana.']
['Di domenica: 10:00 - 20:00.']
['Da domenica a giovedì: 10:00 - 20:00.']
['Da venerdì a sabato: 10:00 - 20:00.']
['Nei giorni festivi e di sabato: chiuso.']
['Tutti i giorni: 10:00 - 20:00.']
['Tutti i giorni: 20:00 - 02:00.']
['Tutti i giorni: sorgere del sole - tramonto.']
['Tutti i giorni: alba - crepuscolo.']
['Tutti i giorni: 60 minuti dopo il sorgere del sole - 20:00.']
['Gennaio: 10:00 - 20:00.']
['Da gennaio a febbraio: 10:00 - 20:00.']
['Gennaio e dicembre: 10:00 - 20:00.']
['Gennaio, di domenica: 10:00 - 20:00.']
['Gennaio e febbraio, di domenica: 10:00 - 20:00.']
['Da gennaio a febbraio, di domenica: 10:00 - 20:00.']
['Gennaio, da domenica a giovedì: 10:00 - 20:00.']
['Gennaio e febbraio, da domenica a giovedì: 10:00 - 20:00.']
['Da gennaio a febbraio, da domenica a giovedì: 10:00 - 20:00.']
['Nelle vacanze scolastiche, di domenica: 10:00 - 20:00.']
['Nelle vacanze scolastiche, da domenica a giovedì: 10:00 - 20:00.']
['A pasqua: 10:00 - 20:00.']
['Nei giorni festivi e nelle vacanze scolastiche, da domenica a giovedì: 10:00 - 20:00.']
['Nei giorni festivi e nelle vacanze scolastiche, da domenica a giovedì, di sabato: 10:00 - 20:00.']
['Da gennaio a febbraio e agosto, da domenica a giovedì e di sabato: 10:00 - 20:00.']
['Nella settimana 1, di domenica: 09:00 - 12:00.']
['Dalla settimana 1 alla settimana 10, di sabato: 09:00 - 12:00.']
['Dalla settimana 1 alla settimana 10, ogni 2 settimane, da venerdì a sabato: 09:00 - 12:00.']
['Nel 2018, da domenica a giovedì: 10:00 - 20:00.']
['Dal 2018 al 2022, da domenica a giovedì: 10:00 - 20:00.']
['Dal 2018 al 2022, ogni 2 anni, da domenica a giovedì: 10:00 - 20:00.']

However, there seems to be some kind of problem with the first day of the week, because the weekdays in those examples are "monday-friday", but get translated to "domenica-giovedì" (which is "sunday-thursday"). I do not think this is a translation problem, because I get the same problem running the basic example a t the beginning of the README:

> print(hoh.OHParser("Mo-Fr 06:00-21:00; Sa,Su 08:00-12:00", locale="en").description())
['From Sunday to Thursday: 6:00 AM – 9:00 PM.', 'From Friday to Saturday: 8:00 AM – 12:00 PM.']

Let me know if I'm doing anything wrong: if this is a bug I'll open an issue to discuss it.

GioBonvi commented 5 years ago

I did not notice @fklement's PR (or he opened it after I started working on mine) and it lloks like there are some differences between our versions: I'm open to discussion, especially regarding the dusk/dawn/sunrise/sunset translations, which are a bit vague as they are not terms often used in italian.

@rezemika let us know how you want to proceed.

rezemika commented 5 years ago

Thank you for your work!

However, as I don't speak italian at all, it would be difficult for me to judge which translation is "the best"...

Concerning the bug when parsing the fields, it's quite weird: I don't have the same result.

>>> print(hoh.OHParser("Mo-Fr 06:00-21:00; Sa,Su 08:00-12:00", locale="en").description())
['From Monday to Friday: 6:00 AM – 9:00 PM.', 'From Saturday to Sunday: 8:00 AM – 12:00 PM.']
GioBonvi commented 5 years ago

Concerning the bug when parsing the fields, it's quite weird: I don't have the same result.

I'll open an issue on the matter then: it might have to do with some kind of "local" default settings

However, as I don't speak italian at all, it would be difficult for me to judge which translation is "the best"...

I can discuss the differences between our versions with @fklement if you prefer: from what I can see they are mainly about preposition usage and order of day/month in the date (e. g. "febbraio 2" vs "2 febbraio"), plus one or two miscellaneous ("on public and school holidays" and "dusk").

rezemika commented 5 years ago

I'll open an issue on the matter then: it might have to do with some kind of "local" default settings

Ok, thank you! Maybe related to a "first day of week" parameter or something?

I can discuss the differences between our versions with @fklement if you prefer: from what I can see they are mainly about preposition usage and order of day/month in the date (e. g. "febbraio 2" vs "2 febbraio"), plus one or two miscellaneous ("on public and school holidays" and "dusk").

Indeed, if you're okay with that, I would appreciate cause, as I said, I don't think I'm competent to judge.

Thanks! :)

GioBonvi commented 5 years ago

Ok, thank you! Maybe related to a "first day of week" parameter or something?

Yeah, I strongly suspect so. I've opened the issue here (#20) and will look in the code for anything suspicious as soon as I can.

Indeed, if you're okay with that, I would appreciate cause, as I said, I don't think I'm competent to judge.

I'll wait for a prompt from @fklement on this thread then.

fklement commented 5 years ago

Sorry for answering so late.
Actually i'm currently learning italian.
So @GioBonvi is probably right. As he says dusk/dawn/sunrise/sunset translations are a bit vague in the italian language.
@rezemika you should definitely go for his pull request as he is a native italian speaker.

rezemika commented 5 years ago

No problem, it's okay. :)

Thank you for your answer, and good luck for the Hacktoberfest!