Bug 830713 - broken gettext translations
Summary: broken gettext translations
Keywords:
Status: CLOSED UPSTREAM
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: WebUI
Version: 6.0.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: Unspecified
Assignee: Petr Chalupa
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-11 09:50 UTC by Petr Chalupa
Modified: 2019-09-26 13:34 UTC (History)
3 users (show)

Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2012-08-31 19:55:49 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Petr Chalupa 2012-06-11 09:50:14 UTC
Description of problem:
When gettext (#_) is called like this:

_("Install of Packages '%{p}' scheduled for System Group '%{s}'." % 
    {:s => @group['name'], :p => params[:packages]})

#_ gets as a paramater String with user-data already interpolated into it. Therefore it can't be found and translated properly. Method #% should be always called on already translated String

_("Install of Packages '%{p}' scheduled for System Group '%{s}'.") %
    {'s' => @group['name'], 'p' => params[:packages]}

The difference is subtle, the bug is in placement of the encapsulating ')' for #_.

How reproducible:
always

Actual results:
Translations (with this mistake) into different languages than en wont get translated.

Expected results:
Translations will work.

Comment 1 Petr Chalupa 2012-06-11 14:35:58 UTC
fixed in 38db814f648b4bc3f9d3d866a1cf5cbf9051f65a

Comment 3 Petr Chalupa 2012-06-13 08:45:54 UTC
There are some broken translations left. Changing to assigned.

Comment 4 Petr Chalupa 2012-06-14 10:37:53 UTC
fixed in 7685490cd4e4a844d76d2d39204fd9c343f9f7e1

Comment 5 Lukas Zapletal 2012-07-31 15:13:56 UTC
Petr,

your patch does not work with 1.9 therefore I have disabled it for 1.9. Can you please look on it and provide solution?

http://pastie.org/4365581

https://github.com/lzap/katello/commit/8ea2ee41a1aca5ab73bb7938a41936abd947b4f3

Comment 6 Petr Chalupa 2012-08-15 07:24:01 UTC
fixed in 31311aa1b541af19afc057a938ce82440262d7b2

Comment 7 Petr Chalupa 2012-08-16 13:42:24 UTC
I set modified by mistake, returning to on_dev

Comment 8 Mike McCune 2012-08-31 19:55:49 UTC
fixed in upstream and not going to get tested by QE so I'm closing this


Note You need to log in before you can comment on or make changes to this bug.