summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPetr Vobornik <pvoborni@redhat.com>2014-07-28 16:33:39 +0200
committerPetr Vobornik <pvoborni@redhat.com>2014-09-11 17:55:17 +0200
commit15e85db8f873dc133cfd3962d5a58fdb92b17513 (patch)
tree50c463815a1b29dda0b997762a497276f96150b2
parent325bbf5bbf39da43e590b2dee2044683aaec3a66 (diff)
downloadfreeipa-15e85db8f873dc133cfd3962d5a58fdb92b17513.zip
freeipa-15e85db8f873dc133cfd3962d5a58fdb92b17513.tar.gz
freeipa-15e85db8f873dc133cfd3962d5a58fdb92b17513.tar.xz
webui: add i18n for the rest of QR code strings
https://fedorahosted.org/freeipa/ticket/4402 Reviewed-By: Endi Sukma Dewata <edewata@redhat.com>
-rw-r--r--install/ui/src/freeipa/otptoken.js15
-rw-r--r--install/ui/test/data/ipa_init.json4
-rw-r--r--ipalib/plugins/internal.py4
3 files changed, 15 insertions, 8 deletions
diff --git a/install/ui/src/freeipa/otptoken.js b/install/ui/src/freeipa/otptoken.js
index c32df3c..5e395e4 100644
--- a/install/ui/src/freeipa/otptoken.js
+++ b/install/ui/src/freeipa/otptoken.js
@@ -27,9 +27,10 @@ define([
'./details',
'./facet',
'./qrcode',
+ './text',
'./search',
'./entity'],
- function(IPA, $, menu, phases, reg, mod_details, mod_facet, QRCode) {
+ function(IPA, $, menu, phases, reg, mod_details, mod_facet, QRCode, text) {
/**
* OTP tokens module
* @class
@@ -386,7 +387,7 @@ otptoken.qr_widget = function(spec) {
that.show_uri_link = $('<a/>', {
name: 'show-uri',
href: '#',
- text: 'Show configuration uri',
+ text: text.get('@i18n:objects.otptoken.show_uri'),
click: function(e) {
e.preventDefault();
that.update_display_mode(!that.show_link);
@@ -437,11 +438,11 @@ otptoken.qr_widget = function(spec) {
that.show_link = !!show_link;
if (that.show_link) {
- that.show_uri_link.text('Show QR code');
+ that.show_uri_link.text(text.get('@i18n:objects.otptoken.show_qr'));
that.qr_control.hide();
that.uri_control.show();
} else {
- that.show_uri_link.text('Show configuration uri');
+ that.show_uri_link.text(text.get('@i18n:objects.otptoken.show_uri'));
that.qr_control.show();
that.uri_control.hide();
}
@@ -487,7 +488,7 @@ otptoken.adder_dialog_qrcode_post_op = function(object) {
var uri = data.result.result.uri;
var qr_dialog = otptoken.qr_dialog({
name: 'qr_dialog',
- title: 'Configure your token',
+ title: '@i18n:objects.otptoken.config_title',
widgets: [
{
$type: 'qrcode',
@@ -499,9 +500,7 @@ otptoken.adder_dialog_qrcode_post_op = function(object) {
});
qr_dialog.open();
- qr_dialog.show_message('Configure your token by scanning the QR code \
- below. Click on the QR core if you see this on \
- the device you want to configure.');
+ qr_dialog.show_message(text.get('@i18n:objects.otptoken.config_instructions'));
});
diff --git a/install/ui/test/data/ipa_init.json b/install/ui/test/data/ipa_init.json
index 857f8ee..2f42b36 100644
--- a/install/ui/test/data/ipa_init.json
+++ b/install/ui/test/data/ipa_init.json
@@ -377,9 +377,13 @@
},
"otptoken": {
"add_token": "Add OTP Token",
+ "config_title": "Configure your token",
+ "config_instructions": "Configure your token by scanning the QR code below. Click on the QR code if you see this on the device you want to configure.",
"details": "OTP Token Settings",
"disable": "Disable token",
"enable": "Enable token",
+ "show_qr": "Show QR code",
+ "show_uri": "Show configuration uri",
"type_hotp": "Counter-based (HOTP)",
"type_totp": "Time-based (TOTP)"
},
diff --git a/ipalib/plugins/internal.py b/ipalib/plugins/internal.py
index e4ebac0..af51cab 100644
--- a/ipalib/plugins/internal.py
+++ b/ipalib/plugins/internal.py
@@ -521,9 +521,13 @@ class i18n_messages(Command):
},
"otptoken": {
"add_token": _("Add OTP Token"),
+ "config_title": _("Configure your token"),
+ "config_instructions": _("Configure your token by scanning the QR code below. Click on the QR code if you see this on the device you want to configure."),
"details": _("OTP Token Settings"),
"disable": _("Disable token"),
"enable": _("Enable token"),
+ "show_qr": _("Show QR code"),
+ "show_uri": _("Show configuration uri"),
"type_hotp": _("Counter-based (HOTP)"),
"type_totp": _("Time-based (TOTP)"),
},