Commit 09713025 authored by Sietse Ringers's avatar Sietse Ringers
Browse files

Translate HTML pages

parent bf37411f
......@@ -2,3 +2,4 @@
build
node_modules
bower_components
translated
module.exports = function (grunt) {
// Setup urls for the keyshare server, api server, and irma_js
// these are used to configure the webclient
var api_server_url, api_web_url, irma_js_url, idin_server_url;
if ( (typeof(grunt.option("api_server_url")) === "undefined") ) {
console.log("INFO: set api_server_url (possibly also irma_js_url) to enable issuing");
}
if ( (typeof(grunt.option("idin_server_url")) === "undefined") ) {
console.log("INFO: set idin_server_url to enable app");
}
if ( (typeof(grunt.option("language")) === "undefined") ) {
console.log("INFO: No language chosen, assuming nl");
}
idin_server_url = grunt.option("idin_server_url");
api_server_url = grunt.option("api_server_url") + "/api/v2/";
api_web_url = grunt.option("api_web_url") || grunt.option("api_server_url");
api_web_url += "/server/";
irma_js_url = grunt.option("irma_js_url") || grunt.option("api_server_url");
irma_js_url += "/client/";
var conf = {
idin_server_url: grunt.option("idin_server_url"),
api_server_url: grunt.option("api_server_url") + "/api/v2/",
api_web_url: grunt.option("api_web_url") || grunt.option("api_server_url"),
irma_js_url: grunt.option("irma_js_url") || grunt.option("api_server_url"),
language: grunt.option("language") || "nl",
}
conf.api_web_url += "/server/";
conf.irma_js_url += "/client/";
console.log("idin_server_url:", idin_server_url);
console.log("api_server_url:", api_server_url);
console.log("api_web_url:", api_web_url);
console.log("irma_js_url:", irma_js_url);
console.log("Configuration:", conf);
grunt.initConfig({
copy: {
......@@ -30,36 +32,44 @@ module.exports = function (grunt) {
dest: "build/bower_components",
expand: "true",
},
examples: {
non_html: {
cwd: "src",
src: ["**/*", "!**/*.html"],
dest: "build/",
expand: "true",
},
translated: {
cwd: "translated/" + conf.language,
src: ["**/*.html"],
dest: "build/",
expand: "true",
},
},
"string-replace": {
examples: {
files: [{
cwd: "./src",
src: ["**/*.html"],
dest: "build/",
dest: "translated/",
expand: "true",
}],
options: {
replacements: [{
pattern: /\[API_SERVER_URL\]/g,
replacement: api_server_url,
replacement: conf.api_server_url,
}, {
pattern: /\[API_WEB_URL\]/g,
replacement: api_web_url,
replacement: conf.api_web_url,
}, {
pattern: /\[IRMA_JS_URL\]/g,
replacement: irma_js_url,
replacement: conf.irma_js_url,
}, {
pattern: /\[IDIN_SERVER_URL\]/g,
replacement: idin_server_url,
},
],
replacement: conf.idin_server_url,
}, {
pattern: /\[LANGUAGE\]/g,
replacement: conf.language,
}],
},
},
},
......@@ -69,21 +79,70 @@ module.exports = function (grunt) {
"./src/**/*",
"!./src/**/*.html",
],
tasks: ["copy"],
tasks: ["copy:non_html"],
},
htmlfiles: {
files: [
"./src/**/*.html",
],
tasks: ["string-replace"],
tasks: ["translate"],
},
translationfiles: {
files: [
"./src/languages/*",
],
tasks: ["translate"],
},
},
multi_lang_site_generator: {
default: {
options: {
vocabs: ["en", "nl"],
vocab_directory: "src/languages",
output_directory: "translated",
},
files: {
"index.html": ["translated/index.html"],
"done.html": ["translated/done.html"],
"error.html": ["translated/error.html"],
"enroll.html": ["translated/enroll.html"],
},
},
},
json_generator: {
configuration: {
dest: "build/conf.json",
options: conf,
},
}
});
grunt.loadNpmTasks("grunt-contrib-watch");
grunt.loadNpmTasks("grunt-contrib-copy");
grunt.loadNpmTasks("grunt-string-replace");
grunt.loadNpmTasks("grunt-multi-lang-site-generator");
grunt.loadNpmTasks("grunt-json-generator");
grunt.registerTask("default", ["copy", "string-replace", "watch"]);
grunt.registerTask("build", ["copy", "string-replace"]);
grunt.registerTask("default", [
"copy:non_html",
"json_generator",
"copy:bower_bundle",
"string-replace",
"multi_lang_site_generator",
"copy:translated",
"watch",
]);
grunt.registerTask("build", [
"copy:non_html",
"json_generator",
"copy:bower_bundle",
"string-replace",
"multi_lang_site_generator",
"copy:translated",
]);
grunt.registerTask("translate", [
"string-replace",
"multi_lang_site_generator",
"copy:translated",
]);
};
......@@ -19,34 +19,28 @@
var server = "[IDIN_SERVER_URL]/api/v1/idin";
</script>
<title>iDIN Attributen uitgegeven</title>
<title><%= done_title %></title>
</head>
<body>
<div class="container">
<div class="row">
<div class="col-xs-12 col-md-8 col-lg-6 col-md-offset-2 col-lg-offset-3">
<h2>iDIN attributen zijn geladen</h2>
<h2><%= done_header %></h2>
<div id="alert_box"></div>
<p>
Gefeliciteerd! Uw attributen zijn nu in uw IRMA app geladen.
Daar zijn ze nu zichtbaar.
</p>
<p><%= done_text1 %></p>
<p><%= done_text2 %></p>
<p><%= done_text3 %></p>
<p>
U kunt ze nu gebruiken op iedere website die deze attributen accepteert.<br/>
Door op de knop hieronder te klikken kunt u dit testen; u toont dan uw geboortedatum-attribuut.
</p>
<button id="verify_idin_bd_btn" class="btn btn-primary">Toon geboortedatum-attribuut</button>
<button id="verify_idin_bd_btn" class="btn btn-primary"><%= done_show_button %></button>
<h3 id="result_header"></h3>
<h4 id="result_status"></h4>
<p id="token-content"></p>
<a href="/uitgifte/">Keer terug naar de attribuut-uitgifte pagina</a>
<a href=".."><%= done_return %></a>
</div>
</div>
</div>
......
......@@ -17,7 +17,7 @@
<script type="text/javascript" src="js/common.js"></script>
<script type="text/javascript" src="js/iDIN-enroll.js"></script>
<title> Basis attributen laden met iDIN </title>
<title><%= enroll_title %></title>
</head>
<body>
......@@ -30,23 +30,22 @@
</a>
</div>
<div class="col-xs-12 col-md-8 col-lg-6 col-md-offset-2 col-lg-offset-3">
<h2>Beschikbare attributen</h2>
<h2><%= enroll_header %></h2>
<div id="alert_box"></div>
<p>De volgende attributen zijn beschikbaar gesteld door uw bank:</p>
<p><%= enroll_received_attributes %></p>
<table class="table" id="idinTable">
<tbody></tbody>
</table>
<br/>
<p>De volgende attributen zijn daaruit afgeleid:</p>
<p><%= enroll_derived_attributes %></p>
<table class="table" id="ageTable">
<tbody></tbody>
</table>
<p>Klik de Laad attributen knop om deze attributen in uw IRMA app te laden.</p>
<button id="enroll" class="btn btn-primary">Laad attributen in uw IRMA app</button>
<p><%= enroll_clicktoload %></p>
<button id="enroll" class="btn btn-primary"><%= enroll_load_button %></button>
<hr />
</div>
</div>
......
......@@ -4,7 +4,7 @@
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1">
<title> Basis attributen laden met iDIN - ERROR </title>
<title><%= error_title %></title>
<link href="bower_components/bootstrap/dist/css/bootstrap.min.css" rel="stylesheet">
......@@ -24,11 +24,9 @@
</a>
</div>
<div class="col-xs-12 col-md-8 col-lg-6 col-md-offset-2 col-lg-offset-3">
<h2>Foutmelding</h2>
<h2><%= error_header %></h2>
<div id="alert_box"></div>
<p>Keer terug naar de <a href="index.html">iDIN issue pagina</a>, of naar de <a href="../">algemene uitgifte pagina</a></p>
<p><%= error_text1 %><%= error_text2 %></p>
<hr />
</div>
</div>
......
......@@ -14,7 +14,7 @@
var server = "[IDIN_SERVER_URL]/api/v1/idin";
</script>
<title> IRMA attributen vanuit iDIN </title>
<title><%= index_title %></title>
</head>
<body>
......@@ -28,17 +28,15 @@
</a>
</div>
<div class="col-xs-12 col-md-8 col-lg-6 col-md-offset-2 col-lg-offset-3">
<h2>Uw IRMA attributen vanuit uw bank, via <a href="https://www.idin.nl/" target="_blank">iDIN</a></h2>
<h2><%= index_header %> <a href="https://www.idin.nl/" target="_blank">iDIN</a></h2>
<div id="alert_box"></div>
<p> U kunt hier inloggen via uw bank, op de gebruikelijke wijze.
Uw bank stuurt dan, na uw toestemming, enkele attributen (uw naam, adres, etc.) terug naar deze website.
Vervolgens kunt u deze attributen in uw IRMA app laden.</p>
<p> Selecteer uw bank om door te gaan:</p>
<p><%= index_explanation %></p>
<p><%= index_selectbank %></p>
<form id='form' method="post">
<select form='form' id="bank-select">
<option value="default">Kies uw bank</option>
<option value="default"><%= index_defaultoption %></option>
</select>
<input type="submit" id="continue" value="Ga naar uw bank" disabled="true" form='form' class="btn btn-primary">
</form>
......
{
"index_title": "IRMA attributen vanuit iDIN",
"index_header": "Uw IRMA attributen vanuit uw bank, via",
"index_explanation": "U kunt hier inloggen via uw bank, op de gebruikelijke wijze. Uw bank stuurt dan, na uw toestemming, enkele attributen (uw naam, adres, etc.) terug naar deze website. Vervolgens kunt u deze attributen in uw IRMA app laden.",
"index_selectbank": "Selecteer uw bank om door te gaan: ",
"index_defaultoption": "Kies uw bank",
"error_title": "Fout bij het laden van iDIN attributen",
"error_header": "Foutmelding",
"error_text1": "Keer terug naar de {URL=index.html}iDIN issue pagina{/URL}, ",
"error_text2": "of naar de {URL=..}algemene uitgifte pagina{/URL}.",
"enroll_title": "Basis attributen laden met iDIN",
"enroll_header": "Beschikbare attributen",
"enroll_received_attributes": "De volgende attributen zijn beschikbaar gesteld door uw bank:",
"enroll_derived_attributes": "De volgende attributen zijn daaruit afgeleid:",
"enroll_clicktoload": "Klik de Laad attributen knop om deze attributen in uw IRMA app te laden.",
"enroll_load_button": "Laad attributen in uw IRMA app",
"done_title": "iDIN Attributen uitgegeven",
"done_header": "iDIN attributen zijn geladen",
"done_text1": "Gefeliciteerd! Uw attributen zijn nu in uw IRMA app geladen. Daar zijn ze nu zichtbaar.",
"done_text2": "U kunt ze nu gebruiken op iedere website die deze attributen accepteert.",
"done_text3": "Door op de knop hieronder te klikken kunt u dit testen; u toont dan uw geboortedatum-attribuut.",
"done_show_button": "Toon geboortedatum-attribuut",
"done_return": "Keer terug naar de attribuut-uitgifte pagina"
}
{
"index_title": "IRMA attributen vanuit iDIN",
"index_header": "Uw IRMA attributen vanuit uw bank, via",
"index_explanation": "U kunt hier inloggen via uw bank, op de gebruikelijke wijze. Uw bank stuurt dan, na uw toestemming, enkele attributen (uw naam, adres, etc.) terug naar deze website. Vervolgens kunt u deze attributen in uw IRMA app laden.",
"index_selectbank": "Selecteer uw bank om door te gaan: ",
"index_defaultoption": "Kies uw bank",
"error_title": "Fout bij het laden van iDIN attributen",
"error_header": "Foutmelding",
"error_text1": "Keer terug naar de {URL=index.html}iDIN issue pagina{/URL}, ",
"error_text2": "of naar de {URL=..}algemene uitgifte pagina{/URL}.",
"enroll_title": "Basis attributen laden met iDIN",
"enroll_header": "Beschikbare attributen",
"enroll_received_attributes": "De volgende attributen zijn beschikbaar gesteld door uw bank:",
"enroll_derived_attributes": "De volgende attributen zijn daaruit afgeleid:",
"enroll_clicktoload": "Klik de Laad attributen knop om deze attributen in uw IRMA app te laden.",
"enroll_load_button": "Laad attributen in uw IRMA app",
"done_title": "iDIN Attributen uitgegeven",
"done_header": "iDIN attributen zijn geladen",
"done_text1": "Gefeliciteerd! Uw attributen zijn nu in uw IRMA app geladen. Daar zijn ze nu zichtbaar.",
"done_text2": "U kunt ze nu gebruiken op iedere website die deze attributen accepteert.",
"done_text3": "Door op de knop hieronder te klikken kunt u dit testen; u toont dan uw geboortedatum-attribuut.",
"done_show_button": "Toon geboortedatum-attribuut",
"done_return": "Keer terug naar de attribuut-uitgifte pagina"
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment