Bug 1351969 - UI Constants need to use delayed translations
Summary: UI Constants need to use delayed translations
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Red Hat CloudForms Management Engine
Classification: Red Hat
Component: Internationalization
Version: 5.6.0
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: GA
: 5.7.0
Assignee: Milan Zázrivec
QA Contact: Bhushan Barve
URL:
Whiteboard:
Depends On:
Blocks: 1353290
TreeView+ depends on / blocked
 
Reported: 2016-07-01 09:29 UTC by Milan Zázrivec
Modified: 2017-08-30 02:02 UTC (History)
8 users (show)

Fixed In Version: 5.7.0.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1353290 (view as bug list)
Environment:
Last Closed: 2017-01-11 20:12:08 UTC
Category: ---
Cloudforms Team: ---
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
Dashboard widgets tree (136.21 KB, image/jpeg)
2016-07-01 09:29 UTC, Milan Zázrivec
no flags Details
VM list advanced search (182.38 KB, image/jpeg)
2016-07-01 09:30 UTC, Milan Zázrivec
no flags Details
ON_QA - Form dropdowns (88.88 KB, image/png)
2016-12-19 19:41 UTC, Mike Shriver
no flags Details

Description Milan Zázrivec 2016-07-01 09:29:23 UTC
Description of problem:
Some string constans that we use in UI use _() routine for translation.

This poses a problem, because the UI constants are being loaded only
once during application start, i.e. if they are wrapped in _(), they
are being translated at the application start. At this point, the application
locale is set to English. When these strings are then being rendered
in the UI in a non-English locale, the strings will still be in English.

What we need to do here is:
1. use N_() when defining the constant
2. use _() when the constant is being rendered (run-time)

Version-Release number of selected component (if applicable):
CFME-5.6

How reproducible:
Always

Steps to Reproduce:
1. Set Japanese locale
2. Navigate to VM list advanced search and select search-type date field
3. Navigate to Cloud Intel -> Reports -> Dashboard Widgets

Actual results:
The constant UI strings remain in English. See screenshots.

Expected results:
The strings need to be translated into the respective locale.

Additional info:
N/A

Comment 1 Milan Zázrivec 2016-07-01 09:29:52 UTC
Created attachment 1174853 [details]
Dashboard widgets tree

Comment 2 Milan Zázrivec 2016-07-01 09:30:22 UTC
Created attachment 1174854 [details]
VM list advanced search

Comment 3 Milan Zázrivec 2016-07-01 09:30:36 UTC
https://github.com/ManageIQ/manageiq/pull/9257

Comment 7 Mike Shriver 2016-12-19 19:40:36 UTC
In CFME 5.7.0.16.20161213213754_1ad3545 I see that the widgets tree translations have been updated, but the dropdown selections in the Dashboard Widgets form are still in the default locale (English).

Should these have been covered by this bug, or should a new bug be written against the lack of translation in those forms?

Attaching screenshot report_dropdowns_noTranslation.png

Thanks.

Comment 8 Mike Shriver 2016-12-19 19:41:49 UTC
Created attachment 1233546 [details]
ON_QA - Form dropdowns

Forms on the Dashboard Widgets page have elements that aren't translated, though the accordion tree is now translated.

Comment 9 Milan Zázrivec 2016-12-20 12:51:50 UTC
(In reply to Mike Shriver from comment #8)
> Created attachment 1233546 [details]
> ON_QA - Form dropdowns
> 
> Forms on the Dashboard Widgets page have elements that aren't translated,
> though the accordion tree is now translated.

As things are, the untranslated entries you're showing in your screenshot
happen to come from the database, so we cannot really have them translated.

Comment 10 Mike Shriver 2016-12-20 13:26:44 UTC
Noted, thanks for the clarification.

Both the date field selections on advanced search and the dashboard widget accordion folder names are now both translated properly when the locale is set.

Tested on CFME 5.7.0.16.20161213213754_1ad3545


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