From c187702bfe2c2dbc9614175db5cfa060936159bf Mon Sep 17 00:00:00 2001 From: Adam Young Date: Fri, 24 Sep 2010 20:48:23 -0400 Subject: I18N for web Performing I18N completely on the server, to leverage the existing gettext architecture. Also, the browser does not have access to the Language header. Added the additional po files for a set of required languages conflict with install/static/ipa.js was resolved. Note that the addition of the .po files in this patch is necessary. In order to get Transifex support, we need to update the LINGUAS file with the languages for which we want support. If we don't add the .po files in, they get automatically generated by the rpmbuild process. Our implementation of gettext has a bug in it (It might be F13 thing) where the the Plurals line is not getting correctly transformed, which causes a build failure. However, since the RPM would have the .po files anyway, we should revision control the ones we have, even if they are empty. Fixed the Bug reporting url to the original value. Corrected the Chartype encoding for UK --- ipalib/plugins/internal.py | 36 ++++++++++++++++++++++++++++++------ 1 file changed, 30 insertions(+), 6 deletions(-) (limited to 'ipalib/plugins/internal.py') diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py index 6f0c2cf10..a77705540 100644 --- a/ipalib/plugins/internal.py +++ b/ipalib/plugins/internal.py @@ -33,7 +33,29 @@ class json_metadata(Command): """ Export plugin meta-data for the webUI. """ - INTERNAL = True + INTERNAL = False + + messages={ + "login": {"header" :_("Logged In As")}, + "button":{ + "add":_("Add"), + "find": _("Find"), + "reset":_("Reset"), + "update":_("Update"), + "enroll":_("Enroll") + }, + "search":{ + "quick_links":_("Quick Links") + }, + "details":{ + "identity":_("Identity Details"), + "account":_("Account Details"), + "contact":_("Contact Details"), + "mailing":_("Mailing Address"), + "employee":_(" Employee Information"), + "misc":_("Misc. Information"), + "to_top":_("Back to Top")} + } takes_args = ( Str('objname?', @@ -42,7 +64,8 @@ class json_metadata(Command): ) has_output = ( - Output('result', dict, doc=_('Dict of JSON encoded IPA Objects')), + Output('metadata', dict, doc=_('Dict of JSON encoded IPA Objects')), + Output('messages', dict, doc=_('Dict of I18N messages')), ) def execute(self, objname): @@ -52,11 +75,12 @@ class json_metadata(Command): ((objname, json_serialize(self.api.Object[objname])), ) ) ) - return dict( - result=dict( - (o.name, json_serialize(o)) for o in self.api.Object() + result=dict( + (o.name, json_serialize(o)) for o in self.api.Object() ) - ) + retval= dict([("metadata",result),("messages",json_serialize(self.messages))]) + + return retval def output_for_cli(self, textui, result, *args, **options): print json.dumps(result, default=json_serialize) -- cgit