From a602d4c2310106af89779bc4f9017cb9b3c40b6a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fredrik=20J=C3=B6nsson?= Date: Tue, 10 Feb 2015 22:28:20 +0100 Subject: [PATCH] Translate dialogs in dynreg.js. --- .../src/main/webapp/resources/js/dynreg.js | 10 +++++----- .../main/webapp/resources/js/locale/en/messages.json | 2 ++ .../main/webapp/resources/js/locale/sv/messages.json | 2 ++ 3 files changed, 9 insertions(+), 5 deletions(-) diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js b/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js index ea73565a3..a972c871c 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/dynreg.js @@ -95,7 +95,7 @@ var DynRegRootView = Backbone.View.extend({ } $('#loadingbox').sheet('show'); - $('#loading').html('Scopes '); + $('#loading').html('' + $.t('common.scopes') + ' '); $.when(this.options.systemScopeList.fetchIfNeeded({success:function(e) {$('#loading-scopes').addClass('label-success');}})) .done(function() { @@ -144,12 +144,12 @@ var DynRegRootView = Backbone.View.extend({ view.load(function() { $('#content').html(view.render().el); view.delegateEvents(); - setPageTitle("Edit a Dynamically Registered Client"); + setPageTitle($.t('dynreg.edit-dynamically-registered')); app.navigate('dev/dynreg/edit', {trigger: true}); self.remove(); }); }, error: function() { - $('#modalAlert div.modal-body').html("Invalid client or registration access token."); + $('#modalAlert div.modal-body').html($.t('dynreg.invalid-access-token')); $("#modalAlert").modal({ // wire up the actual modal functionality and show the dialog "backdrop" : "static", @@ -188,7 +188,7 @@ var DynRegEditView = Backbone.View.extend({ } $('#loadingbox').sheet('show'); - $('#loading').html('Scopes '); + $('#loading').html('' + $.t('common.scopes') + ' '); $.when(this.options.systemScopeList.fetchIfNeeded({success:function(e) {$('#loading-scopes').addClass('label-success');}})) .done(function() { @@ -213,7 +213,7 @@ var DynRegEditView = Backbone.View.extend({ deleteClient:function (e) { e.preventDefault(); - if (confirm("Are you sure sure you would like to delete this client?")) { + if (confirm($.t('client.client-table.confirm'))) { var self = this; this.model.destroy({ diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json b/openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json index 6057faeca..e93e20916 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/locale/en/messages.json @@ -202,8 +202,10 @@ "dynreg": { "client-id-placeholder": "Enter Client ID", "configuration-url": "Client Configuration URL", + "edit-dynamically-registered": "Edit a Dynamically Registered Client", "edit-existing": "Edit an existing client", "edit-existing-help": "Paste in your client ID and registration access token to access the client.", + "invalid-access-token": "Invalid client or registration access token.", "new-client": "Register a new client", "or": " - OR - ", "regtoken-placeholder": "Enter Registration Access Token", diff --git a/openid-connect-server-webapp/src/main/webapp/resources/js/locale/sv/messages.json b/openid-connect-server-webapp/src/main/webapp/resources/js/locale/sv/messages.json index c8a85f976..163892bd0 100644 --- a/openid-connect-server-webapp/src/main/webapp/resources/js/locale/sv/messages.json +++ b/openid-connect-server-webapp/src/main/webapp/resources/js/locale/sv/messages.json @@ -205,8 +205,10 @@ "dynreg": { "client-id-placeholder": "Mata in klient-ID", "configuration-url": "Konfigurationslänk för klienten", + "edit-dynamically-registered": "Ändra en dynamiskt registrerad klient", "edit-existing": "Ändra en befintlig klient", "edit-existing-help": "Klistra in ditt klient-ID och registrerings-access-token för att komma åt klienten.", + "invalid-access-token": "Ogiltig klient eller registration-access-token.", "new-client": "Registrera en ny klient", "or": " - ELLER - ", "regtoken-placeholder": "Mata in registration-access-token",