Bug 887095

Summary: [de_DE][zh_TW][pt_BR][ru_RU][SAM CLI] user module "translation missing: de.activerecord.errors.messages.record_invalid" errors
Product: Red Hat Satellite Reporter: Hedda Peters <hpeters>
Component: Content ManagementAssignee: Lukas Zapletal <lzap>
Status: CLOSED NEXTRELEASE QA Contact: SAM QE List <sam-qe-list>
Severity: high Docs Contact:
Priority: unspecified    
Version: NightlyCC: cpelland, eng-l10n-bugs, lijli, lzap, mmccune, qe-i18n-bugs, ypoyarko
Target Milestone: UnspecifiedKeywords: Translation, Triaged, ZStream
Target Release: Unused   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
: 891411 896251 (view as bug list) Environment:
Last Closed: 2013-06-07 18:28:43 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: 891411, 896251    

Description Hedda Peters 2012-12-14 02:41:12 UTC
Filed from caserun https://tcms.engineering.redhat.com/run/53065/#caserun_1907284

Version-Release number of selected component (if applicable):
SAM-20121130.n.0

Steps to Reproduce: 
set --default_locale=xx for your test language locale.

Many commands (examples see below) from the above referenced test case produce the error message "translation missing: de.activerecord.errors.messages.record_invalid". [de_DE][zh_TW][pt_BR] locales, maybe more.



Actual results: 
[root@i18nsamtest ~]# headpin -u admin -p admin user create --username=te --password=red --email=
translation missing: de.activerecord.errors.messages.record_invalid

[root@i18nsamtest ~]# headpin -u admin -p admin user create --username=test --password=redhat --email=test@localhost --disabled=true  --default_locale=en
translation missing: de.activerecord.errors.messages.record_invalid

[root@i18nsamtest ~]# headpin -u admin -p admin user create --username=test --password=redhat --email=test@localhost --disabled=true --default_organization=test --default_environment=test --default_locale=en
translation missing: de.activerecord.errors.messages.record_invalid

[root@i18nsamtest ~]# headpin -u admin -p admin user assign_role --username=test --role=Administrator
translation missing: de.activerecord.errors.messages.record_invalid

[root@i18nsamtest ~]# headpin -u admin -p admin user update --username=test --password=redhat --email=test@localhost --disabled=false --default_organization=test --default_environment=test --default_locale=t
translation missing: de.activerecord.errors.messages.record_invalid


Expected results:
Valid, localized output.

Comment 1 Lijun Li 2012-12-14 02:58:13 UTC
Build: SAM-1.2-RHEL-6-20121211.n.0

katello-headpin-all.noarch 0:1.2.6-6h.el6_3

Comment 2 Hedda Peters 2012-12-14 03:42:31 UTC
Same issue found in user role module: https://tcms.engineering.redhat.com/run/53065/#caserun_1907284 

examples:
 
[root@i18nsamtest ~]# headpin -u admin -p admin user_role create --name=
translation missing: de.activerecord.errors.messages.record_invalid

[root@i18nsamtest ~]# headpin -u admin -p admin user_role add_ldap_group --name=test --group_name=test
translation missing: de.activerecord.errors.messages.record_invalid

Comment 3 Hedda Peters 2012-12-14 03:58:17 UTC
Same issue in permission module, examples:

[root@i18nsamtest ~]# headpin -u admin -p admin permission create --user_role=test --name=test --scope=all
translation missing: de.activerecord.errors.messages.record_invalid

[root@i18nsamtest ~]# headpin -u admin -p admin permission create --user_role=test --name=testqe --scope=environments --verbs=test
translation missing: de.activerecord.errors.messages.record_invalid

Comment 4 Hedda Peters 2012-12-14 04:58:37 UTC
Same issue in org module, example:

[root@i18nsamtest ~]# headpin -u admin -p admin org create --name=
translation missing: de.activerecord.errors.messages.record_invalid


Same issue in environment module, example:

[root@i18nsamtest ~]# headpin -u admin -p admin environment create --org=test --name=test --prior=Library --label=
translation missing: de.activerecord.errors.messages.record_invalid 

[root@i18nsamtest ~]# headpin -u admin -p admin environment update --name=test --org=test --prior=test
translation missing: de.activerecord.errors.messages.record_invalid

Comment 5 Hedda Peters 2012-12-14 07:10:34 UTC
Last one: 

Same issue in activation_key module, example:

[root@i18nsamtest ~]# headpin -u admin -p admin activation_key create --name=test --environment=test --org=test
translation missing: de.activerecord.errors.messages.record_invalid

[root@i18nsamtest ~]# headpin -u admin -p admin activation_key update --name=test --org=test --new_name=
translation missing: de.activerecord.errors.messages.record_invalid

Comment 6 Tom McKay 2012-12-18 14:12:17 UTC
Mass moving i18n BZs to CFSE where they are also present

Comment 8 Lukas Zapletal 2013-01-09 15:12:25 UTC
Taking, acking and will improve our i18n code according to the:

http://lslezak.blogspot.cz/2012/01/switching-from-gettext-to-fastgettext.html

This bug was cloned into SAM as https://bugzilla.redhat.com/show_bug.cgi?id=891411

Comment 10 Lukas Zapletal 2013-01-22 14:32:32 UTC
The issue is in set_locale. In CLI we throw away anything after two characters. We should do something similar as in UI.

Maybe we want to pick this - 4f131bd43453dab89d5d424b8adef5c2151e70e2 - and re-use the UI set_locale code.

Comment 11 Lukas Zapletal 2013-01-23 14:39:14 UTC
I am taking comment 10 back, this is the fix:

https://github.com/Katello/katello/pull/1446

There will be a conflict during merging!

Comment 12 Lukas Zapletal 2013-01-25 09:07:44 UTC
Ok pull request 1446 was NOT merged and this one instead: https://github.com/Katello/katello/pull/1461

Comment 13 Lukas Zapletal 2013-01-29 15:57:55 UTC
I have been told by cswii that this FAILS QA:

# LC_ALL=de_DE katello  -u admin -p admin user create --username=de_DE --password=red --email=
translation missing: de.activerecord.errors.messages.record_invalid

Ok the patch that has been cherrypicked fixed issue when CLI ignored LC_ALL setting. But since the namespace was changed in Rails 3.x

https://github.com/rails/rails/pull/5274/files

we have old and outdated locale files in SE 1.1.z now.

We need to cherry pick this rails locale update:

https://github.com/Katello/katello/commit/54db6b1b4e49808450856a4427bc8b180ab8a1fc

To get this working.

Comment 15 Bryan Kearney 2013-06-06 20:50:43 UTC
Moving all POST / MODIFIED bugs to ON_QA due to the new builds.

Comment 16 Bryan Kearney 2013-06-07 18:28:43 UTC
We will be doing a new round of translations for the 1.3 drop. Closing out these bugs so that the beta starts with a clean slate.