From 2db607ec28e74666f6d7926c2e2ba39cb81344fe Mon Sep 17 00:00:00 2001 From: Justin Richer Date: Fri, 3 Jul 2015 20:43:05 -0400 Subject: [PATCH] i18n for UMA policy management page --- .../src/main/webapp/resources/js/admin.js | 2 +- .../resources/js/locale/en/messages.json | 35 ++++++++++++++----- .../src/main/webapp/resources/js/policy.js | 12 ++++--- .../webapp/resources/template/policy.html | 22 ++++++------ 4 files changed, 45 insertions(+), 26 deletions(-) diff --git a/uma-server-webapp/src/main/webapp/resources/js/admin.js b/uma-server-webapp/src/main/webapp/resources/js/admin.js index e8eebaad4..f6cc186f6 100644 --- a/uma-server-webapp/src/main/webapp/resources/js/admin.js +++ b/uma-server-webapp/src/main/webapp/resources/js/admin.js @@ -1137,7 +1137,7 @@ var AppRouter = Backbone.Router.extend({ {text:$.t('admin.home'), href:""}, {text:$.t('policy.resource-sets'), href:"manage/#user/policy"}, {text:$.t('policy.edit-policies'), href:"manage/#user/policy/" + rsid}, - {text:$.t('policy.edit-policy'), href:"manage/#user/policy/" + rsid + "/new"} + {text:$.t('policy.new-policy'), href:"manage/#user/policy/" + rsid + "/new"} ]); this.updateSidebar('user/policy'); diff --git a/uma-server-webapp/src/main/webapp/resources/js/locale/en/messages.json b/uma-server-webapp/src/main/webapp/resources/js/locale/en/messages.json index 40a1338e3..aa77f3bf5 100644 --- a/uma-server-webapp/src/main/webapp/resources/js/locale/en/messages.json +++ b/uma-server-webapp/src/main/webapp/resources/js/locale/en/messages.json @@ -341,24 +341,41 @@ }, "policy" : { "resource-sets": "Resource Sets", + "edit-policies": "Edit Policies", + "new-policy": "New Policy", "edit-policy": "Edit Policy", - "required-claims": "Required Claims", - "policy-table": { - "confirm": "Are you sure you want to delete this resource set?", - "delete": "Delete", - "edit": "Edit Policies", - "email-address": "email address", - "required-claims": "Users that you share this resource will with need to be able to present the following claims in order to access the resource.", + "loading-policies": "Policies", + "loading-policy": "Policy", + "loading-rs": "Resource Set", + "rs-table": { + "confirm": "Are you sure you want to delete this resource set?" "no-resource-sets": "There are no resource sets registered. Introduce a protected to this authorization server to let it register some.", - "no-required-claims": "There are no required claims for this resource set: This resource set is inaccessible by others.", - "share-email": "Share with email address", + "scopes": "Scopes" "shared-with": "Shared with:", "shared-nobody": "NOBODY", "shared-nobody-tooltip": "This resource is not accessible by anyone else, edit the policies and share it with someone.", + "sharing": "Sharing Policies" + }, + "policy-table": { + "new": "Add New Policy", + "return": "Return to list", + "edit": "Edit Policy", + "confirm": "Are you sure you want to delete this policy?", + "delete": "Delete", + "no-policies": "There are no policies for this resource set: This resource set is inaccessible by others.", + "required-claims": "Required Claims", + "required-claims-info": "Users that you share this resource will with need to be able to present the following claims in order to access the resource.", + "remove": "Remove", "issuers": "Issuers", "claim": "Claim", "value": "Value" }, + "policy-form": { + "email-address": "email address", + "share-email": "Share with email address", + "new": "New Policy", + "edit": "Edit Policy" + }, "webfinger-error": "Error", "webfinger-error-description": "The server was unable to find an identity provider for __email__." }, diff --git a/uma-server-webapp/src/main/webapp/resources/js/policy.js b/uma-server-webapp/src/main/webapp/resources/js/policy.js index 952647720..83ed99b9c 100644 --- a/uma-server-webapp/src/main/webapp/resources/js/policy.js +++ b/uma-server-webapp/src/main/webapp/resources/js/policy.js @@ -183,7 +183,7 @@ var ResourceSetView = Backbone.View.extend({ deleteResourceSet:function(e) { e.preventDefault(); - if (confirm($.t('policy.policy-table.confirm'))) { + if (confirm($.t('policy.rs-table.confirm'))) { var _self = this; this.model.destroy({ @@ -310,7 +310,7 @@ var PolicyListView = Backbone.View.extend({ }, this); this.togglePlaceholder(); - // $(this.el).i18n(); + $(this.el).i18n(); return this; } }); @@ -346,7 +346,7 @@ var PolicyView = Backbone.View.extend({ removePolicy:function(e) { e.preventDefault(); - if (confirm($.t('policy.policy-table.policy-confirm'))) { + if (confirm($.t('policy.policy-table.confirm'))) { var _self = this; this.model.destroy({ success:function () { @@ -386,7 +386,7 @@ var PolicyView = Backbone.View.extend({ $('.scope-list', this.el).html(this.scopeTemplate({scopes: this.model.get('scopes'), systemScopes: this.options.systemScopeList})); - //$(this.el).i18n(); + $(this.el).i18n(); return this; } @@ -423,7 +423,7 @@ var PolicyFormView = Backbone.View.extend({ $('#loadingbox').sheet('show'); $('#loading').html( - '' + $.t('policy.loading-policies') + ' ' + + '' + $.t('policy.loading-policy') + ' ' + '' + $.t('policy.loading-rs') + ' ' + '' + $.t("common.scopes") + ' ' ); @@ -531,6 +531,8 @@ var PolicyFormView = Backbone.View.extend({ this.$el.html(this.template({policy: json, rs: rs})); + $(this.el).i18n(); + return this; } }); \ No newline at end of file diff --git a/uma-server-webapp/src/main/webapp/resources/template/policy.html b/uma-server-webapp/src/main/webapp/resources/template/policy.html index 48b859cfa..7322b3daa 100644 --- a/uma-server-webapp/src/main/webapp/resources/template/policy.html +++ b/uma-server-webapp/src/main/webapp/resources/template/policy.html @@ -21,7 +21,7 @@ -
+
There are no resource sets registered. Introduce a protected to this authorization server to let it register some.
@@ -47,11 +47,11 @@ <%- client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %>
-
Shared with: +
Shared with: <% if (!_.isEmpty(rs.policies)) { %><%- _.size(rs.policies) %> <% } else { %> - NOBODY + NOBODY <% } %> @@ -60,8 +60,8 @@
-   -   +   +  
@@ -73,19 +73,19 @@
-
+
Users that you share this resource will with need to be able to present the following claims in order to access the resource.
-
+
There are no policies for this resource set: This resource set is inaccessible by others.
- - + + @@ -154,8 +154,8 @@
- - + +
Required ClaimsScopesRequired ClaimsScopes