Open sonntam opened 1 year ago
Hi,
Thanks for the request. It should be reasonably easy to add localisation, effectively the now hard coded strings would be replaced with variables which would reference a localisation file. That file would set the speech related strings based on the localisation set in the config.
Users would still need to manually set up the locale on their echo devices and the skill on the Amazon side. I suspect that the same setup could also disable speech altogether, I wouldn't recommend that though as it is good for troubleshooting.
If you're interested in helping with translation let me know, which languages are you interested in? Also happy to look at a pull request if you want to have a go at it too.
@rosskouk You are right. It shouldn't be that difficult albeit non-trivial. I read a bit about Python and internationalization (= i18n) and it seems Python supports this natively via the gettext module. There are also some nicely written tutorials e.g. this one I found via Google. Unfortunately, in a quick search I couldn't find many major apps written in Python using this. Some examples are
The downside is that a whole toolchain consisting of multiple tools is necessary to create and maintain translations, i.e. pygettext, msgfmt, msgmerge. This would make some kind of build script necessary to have. I'm not quite sure what the best practice here would be. Django is using a build script in Python for that.
I personally am in need of a German translation and will of course provide one with pleasure. The Alexa Skill config JSON I already translated to German (using ChatGPT and some manual clean-up).
If the above approach using gettext appeals to you I'd like to try to contribute. For this I setup a fork with a devel_i18n branch. Along the way I'd document what steps were necessary.
Please let me know your thoughts on this. Thank you!
Hey @sonntam,
That sounds great, happy to include your pull request once it's ready.
Hi @sonntam, I could also help with the translations to Spanish and Portuguese.
I personally am in need of a German translation and will of course provide one with pleasure. The Alexa Skill config JSON I already translated to German (using ChatGPT and some manual clean-up).
Hi @sonntam How did you do it? Can you please explain it or share your JSON? I would like to translate it into spanish. @rosskouk I could help with the spanish translation too
Hi @eagle-phoenix and @andresponte, Any translations are welcome and I'm happy to look at any pull requests you can provide and look at integrating them into the skill in the future.
First of all, thank you for the awesome program. The manual is very easy to follow and I got it setup correctly on the first try. It's working like a charm!
As currently Alexa always utters a confirmation hard-coded in English I'd like to see some way to have localization built into the app such that e.g. via environment variable a different locale can be selected. I have no experience in doing such a thing but maybe I can help if you have a recommendation on how to implement it in a good way. Beware, my Python is sub-par ;-)
Also another useful config option could be to disable spoken confirmations altogether.