litaio / lita

ChatOps for Ruby.
https://www.lita.io
MIT License
1.68k stars 179 forks source link

Localization not working properly #175

Open mtylty opened 8 years ago

mtylty commented 8 years ago

Localization seems like it doesn't work properly. I'm trying to use Lita as an Italian bot but...

I've found at least two problems:

I'm not sure I'm doing something wrong but this is driving me crazy and it looks like it might be an actual bug. If somebody could please confirm this I could start working on PR to fix this.

Thanks!

jimmycuadra commented 8 years ago

Those sound like bugs to me. Thanks for the report!

AHaymond commented 3 years ago

has this ever been fixed? 5 years from the last comment and I am getting DEBUG: translation missing: C.UTF-8.lita.handler.dispatch all over my logs and sending the help message to Lita provides a large dump of such errors.

tim-fitzgerald commented 3 years ago

Running into this as well right now. Interested if anyone has a solution

jimmycuadra commented 3 years ago

Part of the issue should be fixed by using "default locale" instead of "locale" which you can do as of v4.8: https://github.com/litaio/lita/releases/tag/v4.8.0. The problem of handler help text not translating is indeed because they are a class-level construct, so the translation is getting run when the file is loaded, which is before the Lita configuration is loaded. This will be addressed in Lita 5 by setting the locale (and the default locale) based on the environment variables LC_ALL, LC_MESSAGES, or LANG very early in the program's execution. Setting the locale via Lita configuration will be deprecated in favor of these environment variables.

jrcasso commented 3 years ago

@jimmycuadra setting config.robot.default_locale = :en per release instructions did not fix the issue

silvamerica commented 3 years ago

@jrcasso Try setting LANG=en and see if that helps? That was what helped me.