Translated whitelist.

pull/763/head
Fredrik Jönsson 2015-02-06 15:54:46 +01:00
parent 44b8e565ae
commit 004c439711
4 changed files with 65 additions and 25 deletions

View File

@ -23,9 +23,14 @@
"newClient": "New Client"
},
"common": {
"cancel": "Cancel",
"client": "Client",
"clients": "Clients",
"delete": "Delete",
"dynamically-registered": "This client was dynamically registered",
"edit": "Edit",
"revoke": "Revoke",
"save": "Save",
"scopes": "Scopes"
},
"grant": {
@ -65,5 +70,17 @@
"text-refresh": "Refresh tokens are usually long-lived and provide clients with the ability to get new access tokens without end-user involvement.",
"token-info": "Token Information"
}
},
"whitelist": {
"confirm": "Are you sure you want to delete this whitelist entry?",
"whitelist": "Whitelist",
"whitelist-form": {
"allowed-scopes": "Allowed Scopes",
"edit": "Edit Whitelisted Site",
"new": "New Whitelisted Site"
},
"whitelist-table": {
"no-sites": "There are no whitelisted sites. Use the <strong>whitelist</strong> button on the client management page to create one."
}
}
}

View File

@ -23,10 +23,15 @@
"newClient": "Ny klient"
},
"common": {
"cancel": "Avbryt",
"client": "Klient",
"clients": "Klienter",
"delete": "Ta bort",
"dynamically-registered": "Denna klient registrerades dynamiskt",
"edit": "Ändra",
"refresh": "Uppdatera",
"revoke": "Återkalla",
"save": "Spara",
"scopes": "Scope"
},
"grant": {
@ -65,5 +70,17 @@
"text-refresh": "Biljetter för förnyelse (refresh-tokens) är vanligtvis långlivade och ger klienter möjligheten att skaffa nya åtkomstbiljetter utan att involvera slutanvändaren.",
"token-info": "Biljettinformation"
}
},
"whitelist": {
"confirm": "Är du säker på att du vill ta bort den här klienten ifrån vitlistan?",
"whitelist": "Vitlista",
"whitelist-form": {
"allowed-scopes": "Tillåtna scope",
"edit": "Ändra vitlistad webbplats",
"new": "Ny vitlistad webbplats"
},
"whitelist-table": {
"no-sites": "Det finns inga vitlistade webbplatser. Använd knappen <strong>vitlista</strong> på klientadminstrationssidan för att skapa en."
}
}
}

View File

@ -59,9 +59,10 @@ var WhiteListListView = Backbone.View.extend({
}
$('#loadingbox').sheet('show');
$('#loading').html('<span class="label" id="loading-whitelist">Whitelist</span>' +
'<span class="label" id="loading-clients">Clients</span>' +
'<span class="label" id="loading-scopes">Scopes</span>'
$('#loading').html(
'<span class="label" id="loading-whitelist">' + $.t('whitelist.whitelist') + '</span> ' +
'<span class="label" id="loading-clients">' + $.t('common.clients') + '</span> ' +
'<span class="label" id="loading-scopes">' + $.t('common.scopes') + '</span> '
);
$.when(this.model.fetchIfNeeded({success:function(e) {$('#loading-whitelist').addClass('label-success');}}),
@ -97,7 +98,7 @@ var WhiteListListView = Backbone.View.extend({
}, this);
this.togglePlaceholder();
$(this.el).i18n();
return this;
},
@ -115,9 +116,10 @@ var WhiteListListView = Backbone.View.extend({
e.preventDefault();
var _self = this;
$('#loadingbox').sheet('show');
$('#loading').html('<span class="label" id="loading-whitelist">Whitelist</span> ' +
'<span class="label" id="loading-clients">Clients</span> ' +
'<span class="label" id="loading-scopes">Scopes</span> '
$('#loading').html(
'<span class="label" id="loading-whitelist">' + $.t('whitelist.whitelist') + '</span> ' +
'<span class="label" id="loading-clients">' + $.t('common.clients') + '</span> ' +
'<span class="label" id="loading-scopes">' + $.t('common.scopes') + '</span> '
);
$.when(this.model.fetch({success:function(e) {$('#loading-whitelist').addClass('label-success');}}),
@ -160,8 +162,9 @@ var WhiteListView = Backbone.View.extend({
$('.client-more-info-block', this.el).html(this.moreInfoTemplate({client: this.options.client.toJSON()}));
this.$('.dynamically-registered').tooltip({title: 'This client was dynamically registered'});
this.$('.dynamically-registered').tooltip({title: $.t('common.dynamically-registered')});
$(this.el).i18n();
return this;
},
@ -179,7 +182,7 @@ var WhiteListView = Backbone.View.extend({
deleteWhitelist:function(e) {
e.preventDefault();
if (confirm("Are you sure you want to delete this whitelist entry?")) {
if (confirm($.t('whitelist.confirm'))) {
var _self = this;
this.model.destroy({
@ -342,7 +345,7 @@ var WhiteListFormView = Backbone.View.extend({
$("#scope .controls",this.el).html(scopeView.render().el);
this.listWidgetViews.push(scopeView);
$(this.el).i18n();
return this;
}

View File

@ -34,8 +34,8 @@
<td>
<div class="btn-group pull-right">
<button class="btn btn-edit"><i class="icon-edit"></i> Edit</button> &nbsp;
<button class="btn btn-danger btn-delete"><i class="icon-trash icon-white"></i> Delete</button>
<button class="btn btn-edit"><i class="icon-edit"></i> <span data-i18n="common.edit">Edit</span></button> &nbsp;
<button class="btn btn-danger btn-delete"><i class="icon-trash icon-white"></i> <span data-i18n="common.delete">Delete</span></button>
</div>
</td>
@ -43,10 +43,10 @@
<script type="text/html" id="tmpl-whitelist-table">
<div class="well well-small">
<button class="btn btn-small refresh-table"><i class="icon-refresh"></i> Refresh</button>
<button class="btn btn-small refresh-table"><i class="icon-refresh"></i> <span data-i18n="common.refresh">Refresh</span></button>
</div>
<div id="whitelist-table-empty" class="alert alert-info">
<div id="whitelist-table-empty" class="alert alert-info" data-i18n="[html]whitelist.whitelist-table.no-sites">
There are no whitelisted sites. Use the <strong>whitelist</strong> button on the client management page to create one.
</div>
@ -54,8 +54,8 @@
<thead>
<tr>
<th></th>
<th>Client</th>
<th>Scopes</th>
<th data-i18n="common.client">Client</th>
<th data-i18n="common.scopes">Scopes</th>
<th><i class="icon-edit"></i></th>
</tr>
</thead>
@ -64,25 +64,28 @@
</table>
<div class="well well-small">
<button class="btn btn-small refresh-table"><i class="icon-refresh"></i> Refresh</button>
<button class="btn btn-small refresh-table"><i class="icon-refresh"></i> <span data-i18n="common.refresh">Refresh</span></button>
</div>
</script>
<script type="text/html" id="tmpl-whitelist-form">
<h1><%-(whiteList.id == null ? 'New' : 'Edit')%> Whitelisted Site</h1>
<% if (whiteList.id == null) { %>
<h1 data-i18n="whitelist.whitelist-form.new">New Whitelisted Site</h1>
<% } else { %>
<h1 data-i18n="whitelist.whitelist-form.edit">Edit Whitelisted Site</h1>
<% } %>
<form class="form-horizontal">
<fieldset>
<div class="well well-small">
<button class="btn btn-small btn-save btn-success"><i class="icon-ok-circle icon-white"></i> Save</button> &nbsp;
<button class="btn btn-small btn-cancel"><i class="icon-ban-circle"></i> Cancel</button>
<button class="btn btn-small btn-save btn-success"><i class="icon-ok-circle icon-white"></i> <span data-i18n="common.save">Save</span></button> &nbsp;
<button class="btn btn-small btn-cancel"><i class="icon-ban-circle"></i> <span data-i18n="common.cancel">Cancel</span></button>
</div>
<div class="control-group" id="clientId">
<label class="control-label">Client</label>
<label class="control-label" data-i18n="common.client">Client</label>
<div class="controls">
<input type="hidden" name="clientId" value="<%- client.clientId %>" />
<span title="<%- client.clientId %>"><%- client.clientName != null ? client.clientName : ( client.clientId.substr(0,8) + '...' ) %></span>
@ -90,14 +93,14 @@
</div>
<div class="control-group" id="scope">
<label class="control-label">Allowed Scopes</label>
<label class="control-label" data-i18n="whitelist.whitelist-form.allowed-scopes">Allowed Scopes</label>
<div class="controls">
</div>
</div>
<div class="well well-small">
<button class="btn btn-small btn-save btn-success"><i class="icon-ok-circle icon-white"></i> Save</button> &nbsp;
<button class="btn btn-small btn-cancel"><i class="icon-ban-circle"></i> Cancel</button>
<button class="btn btn-small btn-save btn-success"><i class="icon-ok-circle icon-white"></i> <span data-i18n="common.save">Save</span></button> &nbsp;
<button class="btn btn-small btn-cancel"><i class="icon-ban-circle"></i> <span data-i18n="common.cancel">Cancel</span></button>
</div>
</fieldset>