[katello-devel] Locales and API

Lukas Zapletal lzap at redhat.com
Wed Jan 23 12:43:27 UTC 2013


Ok after more investigation, we have more issues with i18 than I
expected :-)

This is what we have in master:

- API  is ignoring _XX suffixes
- UI totally ignores what is set in the browser
- backround jobs sets incorrect lang when running under user with
  default language set (no lang set I mean)

https://github.com/Katello/katello/blob/master/src/app/controllers/application_controller.rb#L306

We have refactored our ApplicationController as a class method,
therefore env hash is no longer available (should be request.env in an
instance method), therefore parse_locale always return empty array which
fallbacks to English (if user has no language set explicitly).

Also this method is used in katello jobs which also returns always
English.

We need to refactor parse_locale and
extract_locale_from_accept_language_header methods and use them properly
in all three places:

- application_controller
- api_controller
- async_operation

Comments?

LZ

On Wed, Jan 23, 2013 at 11:02:17AM +0100, Lukas Zapletal wrote:
> Hey,
> 
> when I was working on some localization bugs yesterday, I have found out
> in the API we only take first two characters of the locale coming
> from the client. Thus from pt_BR we make "pt", the rest is ignored.
> Due this fact, lots of languages were ignored in the server responses
> from the API.
> 
> I am working on a patch that will correct this. If you encounter a
> similar bug report, wait for my patch or ping me.
> 
> Note this is API only issue.
> 
> LZ
> 
> -- 
> Later,
> 
>  Lukas "lzap" Zapletal
>  #katello #systemengine
> 
> _______________________________________________
> katello-devel mailing list
> katello-devel at redhat.com
> https://www.redhat.com/mailman/listinfo/katello-devel

-- 
Later,

 Lukas "lzap" Zapletal
 #katello #systemengine




More information about the katello-devel mailing list