diff options
author | John Dennis <jdennis@redhat.com> | 2010-03-05 16:11:21 -0500 |
---|---|---|
committer | Jason Gerard DeRose <jderose@redhat.com> | 2010-03-08 21:10:36 -0700 |
commit | b75d06e18938015ad6eafe53e15aa2d7a2f92f02 (patch) | |
tree | 856e8b5457e91cb1a9bd628ef8ce82c99dc79657 /ipalib/plugins | |
parent | b9df4f7f29a638d3646c5ff1ffc33c00f7d715c6 (diff) | |
download | freeipa-b75d06e18938015ad6eafe53e15aa2d7a2f92f02.tar.gz freeipa-b75d06e18938015ad6eafe53e15aa2d7a2f92f02.tar.xz freeipa-b75d06e18938015ad6eafe53e15aa2d7a2f92f02.zip |
localize doc strings
A number of doc strings were not localized, wrap them in _().
Some messages were not localized, wrap them in _()
Fix a couple of failing tests:
The method name in RPC should not be unicode.
The doc attribute must use the .msg attribute for comparison.
Also clean up imports of _() The import should come from
ipalib or ipalib.text, not ugettext from request.
Diffstat (limited to 'ipalib/plugins')
-rw-r--r-- | ipalib/plugins/aci.py | 2 | ||||
-rw-r--r-- | ipalib/plugins/baseldap.py | 8 | ||||
-rw-r--r-- | ipalib/plugins/cert.py | 2 | ||||
-rw-r--r-- | ipalib/plugins/config.py | 2 | ||||
-rw-r--r-- | ipalib/plugins/group.py | 2 | ||||
-rw-r--r-- | ipalib/plugins/migration.py | 46 | ||||
-rw-r--r-- | ipalib/plugins/misc.py | 8 | ||||
-rw-r--r-- | ipalib/plugins/netgroup.py | 2 | ||||
-rw-r--r-- | ipalib/plugins/pwpolicy.py | 2 | ||||
-rw-r--r-- | ipalib/plugins/service.py | 2 |
10 files changed, 40 insertions, 36 deletions
diff --git a/ipalib/plugins/aci.py b/ipalib/plugins/aci.py index 4914efe1f..03e5639fa 100644 --- a/ipalib/plugins/aci.py +++ b/ipalib/plugins/aci.py @@ -78,7 +78,7 @@ _valid_permissions_values = [ class ListOfACI(output.Output): type = (list, tuple) - doc = 'A list of ACI values' + doc = _('A list of ACI values') def validate(self, cmd, entries): assert isinstance(entries, self.type) diff --git a/ipalib/plugins/baseldap.py b/ipalib/plugins/baseldap.py index 2266d851c..31f4b4e7c 100644 --- a/ipalib/plugins/baseldap.py +++ b/ipalib/plugins/baseldap.py @@ -381,11 +381,11 @@ class LDAPAddMember(LDAPModMember): output.Entry('result'), output.Output('failed', type=dict, - doc='Members that could not be added', + doc=_('Members that could not be added'), ), output.Output('completed', type=int, - doc='Number of members added', + doc=_('Number of members added'), ), ) @@ -454,11 +454,11 @@ class LDAPRemoveMember(LDAPModMember): output.Entry('result'), output.Output('completed', type=int, - doc='Number of members removed', + doc=_('Number of members removed'), ), output.Output('failed', type=dict, - doc='Members that could not be removed', + doc=_('Members that could not be removed'), ), ) diff --git a/ipalib/plugins/cert.py b/ipalib/plugins/cert.py index e266c9ac2..a2ecce421 100644 --- a/ipalib/plugins/cert.py +++ b/ipalib/plugins/cert.py @@ -201,7 +201,7 @@ class cert_request(VirtualCommand): has_output = ( Output('result', type=dict, - doc='Dictionary mapping variable name to value', + doc=_('Dictionary mapping variable name to value'), ), ) diff --git a/ipalib/plugins/config.py b/ipalib/plugins/config.py index 31e29f573..b89f17cab 100644 --- a/ipalib/plugins/config.py +++ b/ipalib/plugins/config.py @@ -85,7 +85,7 @@ class config(LDAPObject): Str('ipagroupsearchfields?', cli_name='groupsearch', label='Group search fields', - doc='A comma-separated list of fields to search when searching for groups', + doc=_('A comma-separated list of fields to search when searching for groups'), ), Bool('ipamigrationenabled?', cli_name='enable_migration', diff --git a/ipalib/plugins/group.py b/ipalib/plugins/group.py index 14b73cea8..a78529404 100644 --- a/ipalib/plugins/group.py +++ b/ipalib/plugins/group.py @@ -148,7 +148,7 @@ class group_mod(LDAPUpdate): takes_options = LDAPUpdate.takes_options + ( Flag('posix', cli_name='posix', - doc='change to posix group', + doc=_('change to posix group'), ), ) diff --git a/ipalib/plugins/migration.py b/ipalib/plugins/migration.py index 5ae63567c..d64aeacac 100644 --- a/ipalib/plugins/migration.py +++ b/ipalib/plugins/migration.py @@ -32,14 +32,13 @@ from ipalib import Command, List, Password, Str from ipalib.cli import to_cli from ipaserver.plugins.ldap2 import ldap2 from ipalib import _ +from ipalib.text import Gettext # FIXME: remove once the other Gettext FIXME is removed # USER MIGRATION CALLBACKS AND VARS -_krb_err_msg = 'Kerberos principal %s already exists. ' \ - 'Use \'ipa user-mod\' to set it manually.' -_grp_err_msg = 'Failed to add user to the default group. ' \ - 'Use \'ipa group-add-member\' to add manually.' +_krb_err_msg = _('Kerberos principal %s already exists. Use \'ipa user-mod\' to set it manually.') +_grp_err_msg = _('Failed to add user to the default group. Use \'ipa group-add-member\' to add manually.') def _pre_migrate_user(ldap, pkey, dn, entry_attrs, failed, config, ctx): @@ -168,7 +167,7 @@ class migrate_ds(Command): ), Password('bindpw', cli_name='password', - doc='bind password', + doc=_('bind password'), ), ) @@ -198,30 +197,34 @@ class migrate_ds(Command): has_output = ( output.Output('result', type=dict, - doc='Lists of objects migrated; categorized by type.', + doc=_('Lists of objects migrated; categorized by type.'), ), output.Output('failed', type=dict, - doc='Lists of objects that could not be migrated; ' \ - 'categorized by type.', + doc=_('Lists of objects that could not be migrated; categorized by type.'), ), output.Output('enabled', type=bool, - doc='False if migration mode was disabled.', + doc=_('False if migration mode was disabled.'), ), ) - exclude_doc = 'comma-separated list of %s to exclude from migration' - truncated_err_msg = 'search results for objects to be migrated ' \ - 'have been truncated by the server; migration ' \ - 'process might be uncomplete\n' - migration_disabled_msg = 'Migration mode is disabled. ' \ - 'Use \'ipa config-mod\' to enable it.' - pwd_migration_msg = 'Passwords have been migrated in pre-hashed format. ' \ - 'IPA is unable to generate Kerberos keys unless provided ' \ - 'with clear text passwords. All migrated users need to ' \ - 'login at https://your.domain/ipa/migration/ before they ' \ - 'can use their Kerberos accounts.' + exclude_doc = _('comma-separated list of %s to exclude from migration') + + truncated_err_msg = _('''\ +search results for objects to be migrated +have been truncated by the server; +migration process might be uncomplete\n''') + + migration_disabled_msg = _('''\ +Migration mode is disabled. Use \'ipa config-mod\' to enable it.''') + + pwd_migration_msg = _('''\ +Passwords have been migrated in pre-hashed format. +IPA is unable to generate Kerberos keys unless provided +with clear text passwords. All migrated users need to +login at https://your.domain/ipa/migration/ before they +can use their Kerberos accounts.''') def get_options(self): """ @@ -233,7 +236,8 @@ class migrate_ds(Command): for ldap_obj_name in self.migrate_objects: ldap_obj = self.api.Object[ldap_obj_name] name = 'exclude_%ss' % to_cli(ldap_obj_name) - doc = self.exclude_doc % ldap_obj.object_name_plural + # FIXME: can't substitute strings static Gettext instance + doc = Gettext(self.exclude_doc % ldap_obj.object_name_plural) yield List( '%s?' % name, cli_name=name, doc=doc, default=tuple(), autofill=True diff --git a/ipalib/plugins/misc.py b/ipalib/plugins/misc.py index 0584654f7..428c7120f 100644 --- a/ipalib/plugins/misc.py +++ b/ipalib/plugins/misc.py @@ -43,15 +43,15 @@ class env(LocalOrRemote): has_output = ( Output('result', type=dict, - doc='Dictionary mapping variable name to value', + doc=_('Dictionary mapping variable name to value'), ), Output('total', type=int, - doc='Total number of variables env (>= count)', + doc=_('Total number of variables env (>= count)'), ), Output('count', type=int, - doc='Number of variables returned (<= total)', + doc=_('Number of variables returned (<= total)'), ), summary, ) @@ -100,7 +100,7 @@ class plugins(LocalOrRemote): Output('result', dict, 'Dictionary mapping plugin names to bases'), Output('count', type=int, - doc='Number of plugins loaded', + doc=_('Number of plugins loaded'), ), summary, ) diff --git a/ipalib/plugins/netgroup.py b/ipalib/plugins/netgroup.py index 124b860e3..6fd0670b0 100644 --- a/ipalib/plugins/netgroup.py +++ b/ipalib/plugins/netgroup.py @@ -65,7 +65,7 @@ class netgroup(LDAPObject): Str('ipauniqueid?', cli_name='uuid', label='IPA unique ID', - doc='IPA unique ID', + doc=_('IPA unique ID'), flags=['no_create', 'no_update'], ), Str('member_user?', diff --git a/ipalib/plugins/pwpolicy.py b/ipalib/plugins/pwpolicy.py index 9580d1574..2d4b70486 100644 --- a/ipalib/plugins/pwpolicy.py +++ b/ipalib/plugins/pwpolicy.py @@ -277,7 +277,7 @@ class pwpolicy_del(crud.Delete): msg_summary = _('Deleted policy for group "%(value)s"') takes_options = ( Str('group', - doc='Group to remove policy from', + doc=_('Group to remove policy from'), ), ) diff --git a/ipalib/plugins/service.py b/ipalib/plugins/service.py index 36988bd32..0a878cacc 100644 --- a/ipalib/plugins/service.py +++ b/ipalib/plugins/service.py @@ -141,7 +141,7 @@ class service_add(LDAPCreate): member_attributes = ['managedby'] takes_options = ( Flag('force', - doc='force principal name even if not in DNS', + doc=_('force principal name even if not in DNS'), ), ) def pre_callback(self, ldap, dn, entry_attrs, attrs_list, *keys, **options): |