From c1d0f72c20f5ae09c9872fa4434ba5040248b6b3 Mon Sep 17 00:00:00 2001 From: Endi Sukma Dewata Date: Wed, 7 Dec 2011 02:46:08 -0600 Subject: Fixed I18n labels for HBAC Test Hard-coded labels in HBAC Test have been moved into internal.py to allow translation. Ticket #388 --- install/ui/hbactest.js | 67 ++++++++++++++++++++------------------ install/ui/ipa.css | 4 +-- install/ui/test/data/ipa_init.json | 12 ++++++- ipalib/plugins/internal.py | 10 ++++++ 4 files changed, 59 insertions(+), 34 deletions(-) diff --git a/install/ui/hbactest.js b/install/ui/hbactest.js index 602cba6f..57ded45b 100644 --- a/install/ui/hbactest.js +++ b/install/ui/hbactest.js @@ -39,7 +39,7 @@ IPA.hbac.test_entity = function(spec) { facet({ factory: IPA.hbac.test_select_facet, name: 'user', - label: 'Who', + label: IPA.messages.objects.hbacrule.user, managed_entity_name: 'user', disable_breadcrumb: true, facet_group: 'default', @@ -52,7 +52,7 @@ IPA.hbac.test_entity = function(spec) { facet({ factory: IPA.hbac.test_select_facet, name: 'targethost', - label: 'Accessing', + label: IPA.messages.objects.hbacrule.host, managed_entity_name: 'host', disable_breadcrumb: true, facet_group: 'default', @@ -68,7 +68,7 @@ IPA.hbac.test_entity = function(spec) { facet({ factory: IPA.hbac.test_select_facet, name: 'service', - label: 'Via Service', + label: IPA.messages.objects.hbacrule.service, managed_entity_name: 'hbacsvc', disable_breadcrumb: true, facet_group: 'default', @@ -80,7 +80,7 @@ IPA.hbac.test_entity = function(spec) { facet({ factory: IPA.hbac.test_select_facet, name: 'sourcehost', - label: 'From Host', + label: IPA.messages.objects.hbacrule.sourcehost, managed_entity_name: 'host', disable_breadcrumb: true, facet_group: 'default', @@ -96,7 +96,7 @@ IPA.hbac.test_entity = function(spec) { facet({ factory: IPA.hbac.test_rules_facet, name: 'rules', - label: 'On Rules', + label: IPA.messages.objects.hbactest.rules, managed_entity_name: 'hbacrule', disable_breadcrumb: true, facet_group: 'default', @@ -108,8 +108,8 @@ IPA.hbac.test_entity = function(spec) { }). facet({ factory: IPA.hbac.test_run_facet, - name: 'run', - label: 'Run Test', + name: 'run_test', + label: IPA.messages.objects.hbactest.run_test, managed_entity_name: 'hbacrule', disable_breadcrumb: true, pagination: true, @@ -118,7 +118,7 @@ IPA.hbac.test_entity = function(spec) { 'cn', { name: 'matched', - label: 'Matched' + label: IPA.messages.objects.hbactest.matched }, 'ipaenabledflag', 'description' @@ -161,13 +161,13 @@ IPA.hbac.test_facet = function(spec) { var index = facet_group.get_facet_index(that.name); if (index > 0) { - that.back_button = IPA.button({ - name: 'back', - label: 'Back', + that.prev_button = IPA.button({ + name: 'prev', + label: IPA.messages.widget.prev, icon: 'ui-icon ui-icon-triangle-1-w', click: function() { - if (!that.back_button.hasClass('action-button-disabled')) { - that.back(); + if (!that.prev_button.hasClass('action-button-disabled')) { + that.prev(); } return false; } @@ -178,7 +178,7 @@ IPA.hbac.test_facet = function(spec) { that.next_button = IPA.button({ name: 'next', - label: 'Next', + label: IPA.messages.widget.next, icon: 'ui-icon ui-icon-triangle-1-e', click: function() { if (!that.next_button.hasClass('action-button-disabled')) { @@ -196,7 +196,7 @@ IPA.hbac.test_facet = function(spec) { IPA.nav.push_state(state); }; - that.back = function() { + that.prev = function() { var facet_group = that.entity.get_facet_group('default'); var index = facet_group.get_facet_index(that.name); if (index <= 0) return; @@ -348,8 +348,11 @@ IPA.hbac.test_select_facet = function(spec) { } }).appendTo(td); + var message = IPA.messages.objects.hbactest.specify_external; + message = message.replace('${entity}', that.managed_entity.metadata.label_singular); + $('