genebean / PiWeatherRock

Displays local weather on a Raspberry Pi
https://piweatherrock.technicalissues.us
MIT License
50 stars 23 forks source link

Language adjustment, especially in German and text size adjustment #31

Open dodas425 opened 4 years ago

dodas425 commented 4 years ago

It would be a nice feature if you could adapt texts in weather.py to German (or other languages). For example date, times of day and days of the week. A simple adjustment of the text size would also be ingenious, so that texts on the info screen and also in the feels like, wind, humidity window could be adjusted accordingly.

genebean commented 4 years ago

I will look into the logistics of this but was wondering if you’d be game to help with the actual translations if I provided a list of words / phrases?

dodas425 commented 4 years ago

Naturally! You help me / us so much, then I can help you. What do you need for phrases / words in German?

dodas425 commented 4 years ago

Hello! Do you already have something in the works regarding language integration? I could give you German translations on a timely basis... Greetings Thomas

dodas425 commented 4 years ago

It would also be very nice if you could help me to reduce text size as needed...

genebean commented 4 years ago

I have to look at how to do i18n with Python and what it will take to apply that to the code. I may have some time this weekend to poke at it some but am not sure. I greatly appreciate the offer to help translate things though and will take you up on it as soon as I figure the other bits out.

dodas425 commented 4 years ago

Oh, that's very nice! But it doesn't burn... :-)

genebean commented 4 years ago

I think this may be easier than I first thought... I will push up a change shortly that adds a new configuration setting so that the results from the Dark Sky api can be in any language they support. For example, here's the daily summary in multiple languages:

Note the non-english ones include unicode characters too

dodas425 commented 4 years ago

Further on and on! I'm glad to see you're making progress!

genebean commented 4 years ago

Have you tried the setting yet @dodas425 ?

Sent with GitHawk

dodas425 commented 4 years ago

Sorry I didn't get back to you sooner. I've been under some stress with work I had to do at home. I haven't had time to apply the changes you've made so nicely. Are the translations in now? Thanks so much!

Von: Gene Liverman notifications@github.com Gesendet: Freitag, 28. Februar 2020 12:48 An: genebean/PiWeatherRock PiWeatherRock@noreply.github.com Cc: dodas425 dodas2277@gmail.com; Mention mention@noreply.github.com Betreff: Re: [genebean/PiWeatherRock] Language adjustment, especially in German and text size adjustment (#31)

Have you tried the setting yet @dodas425 https://github.com/dodas425 ?

Sent with GitHawk http://githawk.com

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/genebean/PiWeatherRock/issues/31?email_source=notifications&email_token=AOBY6ILNXDV2U7U3BM3CWGLRFD2WPA5CNFSM4KMQKDR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENIIJOA#issuecomment-592479416 , or unsubscribe https://github.com/notifications/unsubscribe-auth/AOBY6IOQ6OWN2BXQFQHKEC3RFD2WPANCNFSM4KMQKDRQ . https://github.com/notifications/beacon/AOBY6IKPCTHISQA25Z6S5O3RFD2WPA5CNFSM4KMQKDR2YY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOENIIJOA.gif

genebean commented 4 years ago

No problem! The parts that come directly from Dark Sky like the summary are now translated. I just realized that the only documentation of this is in the sample config file though. I’ll get the docs updated and link them here so it’s more clear.

Sent with GitHawk

dodas425 commented 4 years ago

IMG_6713 IMG_6712

dodas425 commented 4 years ago

Hi there! This is how the 2 views look on my display. Unfortunately, the writing and the texts do not fit on my 320/240 resolution display. Do you already have a solution to my resolution?

repkadan commented 4 years ago

@dodas425 Hi look to line 632 in weather.py, you might be a bit further or closer find this line: time_string = time.strftime("%-d. %b, %-H:%M", time.localtime()) and test this change.

repkadan commented 4 years ago

@dodas425 and here is a nice explanation of what each value means. For example, you may have to use only time to fit the text. try it https://strftime.org/

repkadan commented 4 years ago

@dodas425 or there is time and date text size in line 266 self.time_date_text_height = 0.129

In a similar way it will be possible to reduce size other texts

Sorry my English please

genebean commented 4 years ago

This coming week I am planning on digging into the issues with the 320 resolution. I had another project with a deadline that has taken my time this week.

Sent with GitHawk

genebean commented 4 years ago

https://linkode.org/#RanYQoA2t1cJJVpjFX5PO4 will help with the translation bit

repkadan commented 4 years ago

Hello. This is probably not for me, I filled in this table a long time ago. My language is Czech (cs)

---------- Původní e-mail ---------- Od: Gene Liverman notifications@github.com Komu: genebean/PiWeatherRock PiWeatherRock@noreply.github.com Datum: 11. 5. 2020 15:01:28 Předmět: Re: [genebean/PiWeatherRock] Language adjustment, especially in German and text size adjustment (#31) "

https://linkode.org/#RanYQoA2t1cJJVpjFX5PO4 (https://linkode.org/#RanYQoA2t1cJJVpjFX5PO4) will help with the translation bit

— You are receiving this because you commented. Reply to this email directly, view it on GitHub (https://github.com/genebean/PiWeatherRock/issues/31#issuecomment-626686912) , or unsubscribe (https://github.com/notifications/unsubscribe-auth/AJRBFKEQKNB2TQU5S7G25VTRQ7ZKFANCNFSM4KMQKDRQ) . "

genebean commented 4 years ago

@repkadan sorry, no - the link was because I got @metaMMA to share it with me the other day and I wanted to include it here to keep from losing it. With the move to ClimaCell and the changes I have already merged into the code base its going to be even more important that I deal with all the places that need the language taken into account. Thanks for filling it in too!

repkadan commented 4 years ago

Hello. OK. Have fun.

---------- Původní e-mail ---------- Od: Gene Liverman notifications@github.com Komu: genebean/PiWeatherRock PiWeatherRock@noreply.github.com Datum: 11. 5. 2020 22:37:43 Předmět: Re: [genebean/PiWeatherRock] Language adjustment, especially in German and text size adjustment (#31) "

@repkadan(https://github.com/repkadan) sorry, no - the link was because I got @metaMMA(https://github.com/metaMMA) to share it with me the other day and I wanted to include it here to keep from losing it. With the move to ClimaCell and the changes I have already merged into the code base its going to be even more important that I deal with all the places that need the language taken into account. Thanks for filling it in too!

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub (https://github.com/genebean/PiWeatherRock/issues/31#issuecomment-626948263) , or unsubscribe (https://github.com/notifications/unsubscribe-auth/AJRBFKBKKHJ7FRJY75Y3BY3RRBOZJANCNFSM4KMQKDRQ) . "