joeycastillo / Sensor-Watch

A board replacement for the classic Casio F-91W wristwatch
Other
1.17k stars 233 forks source link

i18n: Add compile-time language setting #323

Open WesleyAC opened 10 months ago

WesleyAC commented 10 months ago

This currently supports Spanish and German (with English being the default), and simply translates the weekdays, although more translations should be added.

German translations are from @Kaoala on GH Discussions. Spanish translations are from ltzamatema on Discord.

DO is a little hard to read (it looks a little like OO if you're not expecting it). Possibly dO would look better, but I've chosen to keep everything in caps for now. If someone who uses the watch in another language would like to change it, feel free.

xurizaemon commented 10 months ago

Great to see this @WesleyAC! Thanks.

Here's a link to my writeup of the Reo Māori translation - similarly to DO, I found AP wouldn't render on the day characters, and settled for now on A - appreciate input from anyone with more than my limited knowledge.

I expect this would be used with make LANGUAGE=SPANISH when building. I looked for where we'd add documentation to clarify that for folks, seems like this page touches on compile time flags, and it would be a separate MR for a different target branch.

WesleyAC commented 10 months ago

I saw you mention those on Discord and just added them in a second commit :)

The reason AP can't display properly is that the two segements on the left side and the two segments on the right side of that character are each tied together — https://www.sensorwatch.net/docs/wig/display/#limitations-of-the-weekday-digits has a diagram that explains it. I think that just showing "A" is a good solution.

And yep, it's used in that way. I'll send a PR to update the docs as well.

xurizaemon commented 9 months ago

Just want to say I'm using this and the PR has my thumbs up to accept :) thanks @WesleyAC

maxz commented 8 months ago

I also used a custom patch to set different weekday abbreviations. It would be nice if this PR got merged. The fewer things to maintain in a personal branch the better.

We probably should collect places where it makes sense to have translations. Due to display space constraints it probably does not make sense in all places where it would be theoretically possible.

https://github.com/joeycastillo/Sensor-Watch/blob/main/movement/watch_faces/complication/alarm_face.c#L42 For German it would be static const char _dow_strings[ALARM_DAY_STATES + 1][2] ={"AL", "MO", "DI", "MI", "DO", "FR", "SA", "SO", "JT", "1x", "MF", "WE"}; I have no idea what the original "AL" stands for. Alarm?

And the original "SO" should probably be "SU" in the English version. "WE" instead of "WN" would also be more intuitive for English and fits within the display constraints. (Or maybe it was chosen as "WN" to not be confused with weekly?)

The entries in https://github.com/joeycastillo/Sensor-Watch/blob/main/movement/watch_faces/settings/preferences_face.c also seem very suitable to receive translations, but I'd have to invest more time in finding proper values for the display for those.