strautomator / core

Strautomator Core
MIT License
45 stars 6 forks source link

Weather tags translation improvements #31

Closed Glennmen closed 1 year ago

Glennmen commented 1 year ago

After playing around with Strautomator I did notice that the weather tags seem to be a little weird when I try to use it for me (in Dutch).

CleanShot 2023-06-27 at 17 29 11@2x

For example kph would for us be better translated to km/u

Also looking at the code it would be similar with the wind directions: https://github.com/strautomator/core/blob/f95953f5c7fe92b8807450d213b5817b4035f094/src/weather/utils.ts#L409 S (South) -> Z (Zuid) E (East) -> O (Oost)

These are little details but it does bring the result to a higher level 😅

If I understood the translations/index.ts function correctly you wouldn't need to add the translations for each language as it would fall back to returning the id/key. The behaviour would remain the same for other users (until they have provided/requested translations).

Let me know what you think.

igoramadas commented 1 year ago

Makes sense. I'll add directions and units to the translations as well.

Glennmen commented 1 year ago

I would like to add that I did find Omit tag suffixes (initially the description wasn't clear to me, until I used the weather tags) in the settings so a workaround would be to disable it and hardcode km/u. But that wouldn't fix the wind directions of course.

igoramadas commented 1 year ago

https://github.com/strautomator/core/commit/95cdd9d4a02576548e59a456b2c3fc3f4ef312c4 https://github.com/strautomator/core/commit/36f3b5a6cc6c565bd0e4d797fd9ef724735f8326 https://github.com/strautomator/core/commit/a39bf76cb153b453f0e0ed3bcfcad2f8751858a1

Glennmen commented 1 year ago

Awesome! Will see if I can try it out later today.

igoramadas commented 1 year ago

Released: https://github.com/strautomator/web/releases/tag/v23.276.11230