Closed smacintyre closed 1 month ago
Thanks for the detailed report @smacintyre, it definitely helps!
Regarding the borders, the calculation for the spaces up to the border needs to be improved to account for the width that Thai characters occupy. There is some logic that was tested with e.g. Chinese characters, but this issue makes it clear that it is lacking.
Regarding the translations, it currently works like this: languages other than the default are translated via the Google Translation API. If wthrr is run and saved with a different language, the translated texts are also written to the config directory (on macOS: ~/Library/Application Support/weathercrab/
) in locales/<language_code>.json
. This file is then used instead of making a slower API call. Editing texts in that file also allows users to fix and customize translations.
At the time of implementation, this was a practical way to support many languages. Unfortunately, it also increases the chance of translation errors due to the automated translator.
I'll look into it if this same concept could be extended to save translations in the repository, so they are correct right away. You could submit the appropriate Thai translations than. Other languages could still be auto-translated until there is a human reviewed and verified translation.
Thank you for the response @ttytm
For translations, I'd recommend using ChatGPT instead of Google Translate. ChatGPT deals with high context languages much better.
This is very true in terms of the GPT results. But there would be an additional setup step required for the users to get the translation working as an API key would be required. It would be a nice feature to have the choice.
The border bug should be fixed. Lets track the enhancement regarding the translation source in a separate issue.
Looks great! Thank you 🙏
The right border is broken when displaying Thai language words.
Steps to reproduce
Run:
wthrr กรุงเทพมหานคร -f d -l th_TH
Result
Expected Result
The right border is solid
Tested in
OS: macOS 14.5.1 Terminals:
A note on the translations
The intro string "Hey friend. I'm glad you are asking." is translated as "เฮ้เพื่อน. ฉันดีใจที่คุณถาม". This is weird as it lacks a polite particle, the tenses are wrong, it mixes formality levels, and is not a complete sentence. Maybe it should say "สวัสดีเพือน ฉันดีใจที่คุณถามคำถามมาค่ะ". Also note, spaces are used to separate sentences, not periods.