Bug 1351969

Summary: UI Constants need to use delayed translations
Product: Red Hat CloudForms Management Engine Reporter: Milan Zázrivec <mzazrivec>
Component: InternationalizationAssignee: Milan Zázrivec <mzazrivec>
Status: CLOSED CURRENTRELEASE QA Contact: Bhushan Barve <bbarve>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 5.6.0CC: cpelland, dajohnso, hkataria, jhardy, mpovolny, mshriver, obarenbo, simaishi
Target Milestone: GAKeywords: TestOnly, ZStream
Target Release: 5.7.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: 5.7.0.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1353290 (view as bug list) Environment:
Last Closed: 2017-01-11 20:12:08 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Bug Depends On:    
Bug Blocks: 1353290    
Attachments:
Description Flags
Dashboard widgets tree
none
VM list advanced search
none
ON_QA - Form dropdowns none

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