Re: [Freeipa-devel] [PATCH] 206 Fixed object_name and object_name_plural, internationalization

2011-07-12 Thread Adam Young

On 07/12/2011 03:42 PM, Endi Sukma Dewata wrote:

The object_name, object_name_plural and messages that use these
attributes have been converted to support translation. The label
attribute in the Param class has been modified to accept unicode
string.

Ticket #1435


___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

ACK.  Pushed to master
___
Freeipa-devel mailing list
Freeipa-devel@redhat.com
https://www.redhat.com/mailman/listinfo/freeipa-devel

[Freeipa-devel] [PATCH] 206 Fixed object_name and object_name_plural, internationalization

2011-07-12 Thread Endi Sukma Dewata

The object_name, object_name_plural and messages that use these
attributes have been converted to support translation. The label
attribute in the Param class has been modified to accept unicode
string.

Ticket #1435

--
Endi S. Dewata
From 0fb19d888e845dca25df219b374730e010499586 Mon Sep 17 00:00:00 2001
From: Endi S. Dewata 
Date: Tue, 12 Jul 2011 11:01:25 -0500
Subject: [PATCH] Fixed object_name and object_name_plural
 internationalization

The object_name, object_name_plural and messages that use these
attributes have been converted to support translation. The label
attribute in the Param class has been modified to accept unicode
string.

Ticket #1435
---
 ipalib/parameters.py   |2 +-
 ipalib/plugins/automount.py|   12 ++--
 ipalib/plugins/baseldap.py |   22 +++---
 ipalib/plugins/config.py   |2 +-
 ipalib/plugins/delegation.py   |4 ++--
 ipalib/plugins/dns.py  |8 
 ipalib/plugins/entitle.py  |4 ++--
 ipalib/plugins/group.py|4 ++--
 ipalib/plugins/hbacrule.py |4 ++--
 ipalib/plugins/hbacsvc.py  |4 ++--
 ipalib/plugins/hbacsvcgroup.py |4 ++--
 ipalib/plugins/host.py |4 ++--
 ipalib/plugins/hostgroup.py|4 ++--
 ipalib/plugins/krbtpolicy.py   |2 +-
 ipalib/plugins/migration.py|2 +-
 ipalib/plugins/netgroup.py |4 ++--
 ipalib/plugins/permission.py   |4 ++--
 ipalib/plugins/pkinit.py   |2 +-
 ipalib/plugins/privilege.py|4 ++--
 ipalib/plugins/pwpolicy.py |4 ++--
 ipalib/plugins/role.py |4 ++--
 ipalib/plugins/selfservice.py  |4 ++--
 ipalib/plugins/service.py  |4 ++--
 ipalib/plugins/sudocmd.py  |4 ++--
 ipalib/plugins/sudocmdgroup.py |4 ++--
 ipalib/plugins/sudorule.py |4 ++--
 ipalib/plugins/user.py |4 ++--
 27 files changed, 64 insertions(+), 64 deletions(-)

diff --git a/ipalib/parameters.py b/ipalib/parameters.py
index 76ca2d7919823533001fe388742c65817fb4de50..75981e960e788d7f6f25a5607d04223431e90f41 100644
--- a/ipalib/parameters.py
+++ b/ipalib/parameters.py
@@ -301,7 +301,7 @@ class Param(ReadOnly):
 kwargs = (
 ('cli_name', str, None),
 ('cli_short_name', str, None),
-('label', (str, Gettext), None),
+('label', (basestring, Gettext), None),
 ('doc', (basestring, Gettext), None),
 ('required', bool, True),
 ('multivalue', bool, False),
diff --git a/ipalib/plugins/automount.py b/ipalib/plugins/automount.py
index 5f8102d9209bd35ea348c484e994c08a5cea01df..dcfa03559a4ade60362b80c093ca4634997ecf34 100644
--- a/ipalib/plugins/automount.py
+++ b/ipalib/plugins/automount.py
@@ -183,8 +183,8 @@ class automountlocation(LDAPObject):
 Location container for automount maps.
 """
 container_dn = api.env.container_automount
-object_name = 'automount location'
-object_name_plural = 'automount locations'
+object_name = _('automount location')
+object_name_plural = _('automount locations')
 object_class = ['nscontainer']
 default_attributes = ['cn']
 label = _('Automount Locations')
@@ -494,8 +494,8 @@ class automountmap(LDAPObject):
 """
 parent_object = 'automountlocation'
 container_dn = api.env.container_automount
-object_name = 'automount map'
-object_name_plural = 'automount maps'
+object_name = _('automount map')
+object_name_plural = _('automount maps')
 object_class = ['automountmap']
 default_attributes = ['automountmapname', 'description']
 
@@ -575,8 +575,8 @@ class automountkey(LDAPObject):
 """
 parent_object = 'automountmap'
 container_dn = api.env.container_automount
-object_name = 'automount key'
-object_name_plural = 'automount keys'
+object_name = _('automount key')
+object_name_plural = _('automount keys')
 object_class = ['automount']
 default_attributes = [
 'automountkey', 'automountinformation', 'description'
diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py
index 5912b8dcf7f92d87b201e74b8250293111529f64..87a9fbed342a876943eaac3170cb5fd2270264ab 100644
--- a/ipalib/plugins/baseldap.py
+++ b/ipalib/plugins/baseldap.py
@@ -247,8 +247,8 @@ class LDAPObject(Object):
 parent_object = ''
 container_dn = ''
 normalize_dn = True
-object_name = 'entry'
-object_name_plural = 'entries'
+object_name = _('entry')
+object_name_plural = _('entries')
 object_class = []
 object_class_config = None
 # If an objectclass is possible but not default in an entry. Needed for
@@ -1084,7 +1084,7 @@ class LDAPModMember(LDAPQuery):
 Base class for member manipulation.
 """
 member_attributes = ['member']
-member_param_doc = 'comma-separated list of %s'
+member_param_doc = _('comma-separated list of %s')
 member_count_out = ('%i member processed.', '%i members processed.')
 
 def get_options(self):
@@ -1096,7 +1096,7 @@ cla