Static messages are not localized when requested

Bug #1215192 reported by Brant Knudson on 2013-08-21
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Identity (keystone)
Brant Knudson

Bug Description

Messages created at import-time are not being translated when
the request is made with Accept-Language.

Note that messages created a run-time are being translated.

Since not many messages are translated at this point, to recreate
can set a translated message yourself. For example, update

 #: keystone/
 msgid "The request you have made requires authentication."
 msgstr "Wonderful Italian rendition of this"

before running `python compile_catalog`

Then run Keystone and request a resource that requires authentication.

curl -s -H "Accept-Language: it" http://localhost:5000/v3/auth/tokens | python -mjson.tool

    "error": {
        "code": 401,
        "message": "The request you have made requires authentication.",
        "title": "Unauthorized"

-- this should return

    "error": {
        "code": 401,
        "message": "Wonderful Italian rendition of this",
        "title": "Unauthorized"

Brant Knudson (blk-u) on 2013-08-21
Changed in keystone:
assignee: nobody → Brant Knudson (blk-u)

Fix proposed to branch: master

Changed in keystone:
status: New → In Progress
Dolph Mathews (dolph) on 2013-08-26
Changed in keystone:
importance: Undecided → Low

Submitter: Jenkins
Branch: master

commit 2fe72a0d5786ad633daea769ddbbd2e2d9be2406
Author: Brant Knudson <email address hidden>
Date: Wed Aug 21 18:30:56 2013 -0500

    Fix translate static messages in response

    Messages created statically (during import) were not being
    translated in responses when the Accept-Language header was
    used to set the expected language in the response. The static
    messages were being created before the _ built-in had been
    installed by gettextutils.install().

    Change-Id: Ie56b1d3a836bc5f2262d7af68f803a08ebdf016f
    Resolves-Bug: #1215192

Changed in keystone:
status: In Progress → Fix Committed
Thierry Carrez (ttx) on 2013-09-05
Changed in keystone:
milestone: none → havana-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx) on 2013-10-17
Changed in keystone:
milestone: havana-3 → 2013.2
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers