i18n for UMA policy management page

pull/820/merge
Justin Richer 2015-07-03 20:43:05 -04:00
parent ee9413b882
commit 2db607ec28
4 changed files with 45 additions and 26 deletions

View File

@ -1137,7 +1137,7 @@ var AppRouter = Backbone.Router.extend({
{text:$.t('admin.home'), href:""}, {text:$.t('admin.home'), href:""},
{text:$.t('policy.resource-sets'), href:"manage/#user/policy"}, {text:$.t('policy.resource-sets'), href:"manage/#user/policy"},
{text:$.t('policy.edit-policies'), href:"manage/#user/policy/" + rsid}, {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'); this.updateSidebar('user/policy');

View File

@ -341,24 +341,41 @@
}, },
"policy" : { "policy" : {
"resource-sets": "Resource Sets", "resource-sets": "Resource Sets",
"edit-policies": "Edit Policies",
"new-policy": "New Policy",
"edit-policy": "Edit Policy", "edit-policy": "Edit Policy",
"required-claims": "Required Claims", "loading-policies": "Policies",
"policy-table": { "loading-policy": "Policy",
"confirm": "Are you sure you want to delete this resource set?", "loading-rs": "Resource Set",
"delete": "Delete", "rs-table": {
"edit": "Edit Policies", "confirm": "Are you sure you want to delete this resource set?"
"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.",
"no-resource-sets": "There are no resource sets registered. Introduce a protected to this authorization server to let it register some.", "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.", "scopes": "Scopes"
"share-email": "Share with email address",
"shared-with": "Shared with:", "shared-with": "Shared with:",
"shared-nobody": "NOBODY", "shared-nobody": "NOBODY",
"shared-nobody-tooltip": "This resource is not accessible by anyone else, edit the policies and share it with someone.", "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", "issuers": "Issuers",
"claim": "Claim", "claim": "Claim",
"value": "Value" "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": "Error",
"webfinger-error-description": "The server was unable to find an identity provider for <code>__email__</code>." "webfinger-error-description": "The server was unable to find an identity provider for <code>__email__</code>."
}, },

View File

@ -183,7 +183,7 @@ var ResourceSetView = Backbone.View.extend({
deleteResourceSet:function(e) { deleteResourceSet:function(e) {
e.preventDefault(); e.preventDefault();
if (confirm($.t('policy.policy-table.confirm'))) { if (confirm($.t('policy.rs-table.confirm'))) {
var _self = this; var _self = this;
this.model.destroy({ this.model.destroy({
@ -310,7 +310,7 @@ var PolicyListView = Backbone.View.extend({
}, this); }, this);
this.togglePlaceholder(); this.togglePlaceholder();
// $(this.el).i18n(); $(this.el).i18n();
return this; return this;
} }
}); });
@ -346,7 +346,7 @@ var PolicyView = Backbone.View.extend({
removePolicy:function(e) { removePolicy:function(e) {
e.preventDefault(); e.preventDefault();
if (confirm($.t('policy.policy-table.policy-confirm'))) { if (confirm($.t('policy.policy-table.confirm'))) {
var _self = this; var _self = this;
this.model.destroy({ this.model.destroy({
success:function () { 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})); $('.scope-list', this.el).html(this.scopeTemplate({scopes: this.model.get('scopes'), systemScopes: this.options.systemScopeList}));
//$(this.el).i18n(); $(this.el).i18n();
return this; return this;
} }
@ -423,7 +423,7 @@ var PolicyFormView = Backbone.View.extend({
$('#loadingbox').sheet('show'); $('#loadingbox').sheet('show');
$('#loading').html( $('#loading').html(
'<span class="label" id="loading-policies">' + $.t('policy.loading-policies') + '</span> ' + '<span class="label" id="loading-policies">' + $.t('policy.loading-policy') + '</span> ' +
'<span class="label" id="loading-rs">' + $.t('policy.loading-rs') + '</span> ' + '<span class="label" id="loading-rs">' + $.t('policy.loading-rs') + '</span> ' +
'<span class="label" id="loading-scopes">' + $.t("common.scopes") + '</span> ' '<span class="label" id="loading-scopes">' + $.t("common.scopes") + '</span> '
); );
@ -531,6 +531,8 @@ var PolicyFormView = Backbone.View.extend({
this.$el.html(this.template({policy: json, rs: rs})); this.$el.html(this.template({policy: json, rs: rs}));
$(this.el).i18n();
return this; return this;
} }
}); });

View File

@ -21,7 +21,7 @@
<button class="btn btn-small refresh-table"><i class="icon-refresh"></i> <span data-i18n="common.refresh">Refresh</span></button> <button class="btn btn-small refresh-table"><i class="icon-refresh"></i> <span data-i18n="common.refresh">Refresh</span></button>
</div> </div>
<div id="resource-set-table-empty" class="alert alert-info" data-i18n="policy.policy-table.no-resource-sets"> <div id="resource-set-table-empty" class="alert alert-info" data-i18n="policy.rs-table.no-resource-sets">
There are no resource sets registered. Introduce a protected to this authorization server to let it register some. There are no resource sets registered. Introduce a protected to this authorization server to let it register some.
</div> </div>
@ -47,11 +47,11 @@
<span title="<%- client.clientId %>"><%- client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %></span> <span title="<%- client.clientId %>"><%- client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %></span>
<div class="client-more-info-block"></div> <div class="client-more-info-block"></div>
<div class="scope-list"></div> <div class="scope-list"></div>
<div><span class="text-warning" data-i18n="policy.policy-table.shared-with"><i class="icon-share"></i> Shared with:</span> <div><span class="text-warning" data-i18n="policy.rs-table.shared-with"><i class="icon-share"></i> Shared with:</span>
<% if (!_.isEmpty(rs.policies)) { <% if (!_.isEmpty(rs.policies)) {
%><span class="label label-info"><%- _.size(rs.policies) %></span> %><span class="label label-info"><%- _.size(rs.policies) %></span>
<% } else { %> <% } else { %>
<span class="label label-important" data-i18n="policy.policy-table.shared-nobody;[title]policy.policy-table.shared-nobody-tooltip" title="This resource is not accessible by anyone else, edit the policies and share it with someone.">NOBODY</span> <span class="label label-important" data-i18n="policy.rs-table.shared-nobody;[title]policy.rs-table.shared-nobody-tooltip" title="This resource is not accessible by anyone else, edit the policies and share it with someone.">NOBODY</span>
<% } %> <% } %>
@ -60,8 +60,8 @@
<td> <td>
<div class="btn-group pull-right"> <div class="btn-group pull-right">
<button class="btn btn-info btn-edit"><i class="icon-share icon-white"></i> <span data-i18n="policy.policy-table.sharing">Sharing Policies</span></button> &nbsp; <button class="btn btn-info btn-edit"><i class="icon-share icon-white"></i> <span data-i18n="policy.rs-table.sharing">Sharing Policies</span></button> &nbsp;
<button class="btn btn-danger btn-delete"><i class="icon-trash icon-white"></i> <span data-i18n="policy.policy-table.delete">Delete</span></button> &nbsp; <button class="btn btn-danger btn-delete"><i class="icon-trash icon-white"></i> <span data-i18n="policy.rs-table.delete">Delete</span></button> &nbsp;
</div> </div>
</td> </td>
@ -73,19 +73,19 @@
<button class="btn btn-small btn-cancel"><i class="icon-list"></i> <span data-i18n="policy.policy-table.return">Return to list</span></button> <button class="btn btn-small btn-cancel"><i class="icon-list"></i> <span data-i18n="policy.policy-table.return">Return to list</span></button>
</div> </div>
<div id="policy-info" class="alert alert-info" data-i18n="policy.policy-table.required-claims"> <div id="policy-info" class="alert alert-info" data-i18n="policy.policy-table.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. Users that you share this resource will with need to be able to present the following claims in order to access the resource.
</div> </div>
<div id="policy-table-empty" class="alert alert-danger" data-i18n="policy.policy-table.no-required-claims"> <div id="policy-table-empty" class="alert alert-danger" data-i18n="policy.policy-table.no-policies">
There are no policies for this resource set: This resource set is inaccessible by others. There are no policies for this resource set: This resource set is inaccessible by others.
</div> </div>
<table id="policy-table" class="table table-hover table-striped"> <table id="policy-table" class="table table-hover table-striped">
<thead> <thead>
<tr> <tr>
<th data-i18n="policy.policy-table.issuers">Required Claims</th> <th data-i18n="policy.policy-table.required-claims">Required Claims</th>
<th data-i18n="policy.policy-table.claim">Scopes</th> <th data-i18n="policy.rs-table.scopes">Scopes</th>
<th></th> <th></th>
</thead> </thead>
<tbody> <tbody>
@ -154,8 +154,8 @@
<div id="add-required-claim"> <div id="add-required-claim">
<form class="form-horizontal"> <form class="form-horizontal">
<fieldset> <fieldset>
<input type="text" id="email" placeholder="email address" data-i18n="[placeholder]policy.policy-table.email-address" /> <input type="text" id="email" placeholder="email address" data-i18n="[placeholder]policy.policy-form.email-address" />
<button class="btn btn-info btn-share"><i class="icon-share icon-white"></i> <span data-i18n="policy.policy-table.share-email">Share with email address</span></button> <button class="btn btn-info btn-share"><i class="icon-share icon-white"></i> <span data-i18n="policy.policy-form.share-email">Share with email address</span></button>
</fieldset> </fieldset>
</form> </form>
</div> </div>