Project

General

Profile

Bug #10662

Foreman apidoc index shows mixed language translations

Added by Xavier Naveira about 4 years ago. Updated about 1 year ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
API
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

Tested on Foreman 1.8.0 api v2 with firefox and chrome.

The api shows asian characters when using JSONView plugin.

Example: http://imgur.com/LkPjNXs

Associated revisions

Revision f3582159 (diff)
Added by Dominic Cleal over 3 years ago

fixes #10662 - set default_locale to 'en'

When a default locale isn't set and FastGettext.set_locale() is called
with an unknown locale, it picks the first available. This depends on
the readdir order of locale/, which depends on filesystem behaviour.

Now when generating the default language API docs, they are always in
English and when accessing the web UI with an unknown language
preference, the 'en' locale is provided.

Revision a355157f (diff)
Added by Dominic Cleal over 3 years ago

fixes #10662 - set default_locale to 'en'

When a default locale isn't set and FastGettext.set_locale() is called
with an unknown locale, it picks the first available. This depends on
the readdir order of locale/, which depends on filesystem behaviour.

Now when generating the default language API docs, they are always in
English and when accessing the web UI with an unknown language
preference, the 'en' locale is provided.

(cherry picked from commit f3582159e2bc0cb5cd01741598e6f9a883d8fb9f)

History

#1 Updated by Xavier Naveira about 4 years ago

This issue presents itself when querying the api root page: https://foreman.domain.ext/api/v2/

#2 Updated by Dominic Cleal about 4 years ago

  • Subject changed from Foreman api output shows asian characters when using JSONView plugin to Foreman apidoc index shows mixed language translations

I suspect the locale isn't initialised properly from within the apipie-rails controller, as we normally do it in a before_filter on our own controllers.

Also I see this on http://foreman.example.com/apidoc/v2.html which I suppose ought to be English (there are also per-language pages).

#3 Updated by Dominic Cleal over 3 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

#4 Updated by The Foreman Bot over 3 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman/pull/3212 added

#5 Updated by Dominic Cleal over 3 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

#6 Updated by Dominic Cleal over 3 years ago

  • Legacy Backlogs Release (now unused) set to 71

Also available in: Atom PDF