Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
IRMA
Github mirrors
irma_idin_webclient
Commits
1525c6d1
Commit
1525c6d1
authored
Dec 02, 2017
by
Sietse Ringers
Browse files
Translating javascript strings
parent
09713025
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/js/common.js
View file @
1525c6d1
var
conf
,
strings
,
server
;
function
getSetupFromJson
()
{
console
.
log
(
"
Running getSetupFromJson
"
);
$
.
getJSON
(
"
conf.json
"
,
function
(
json
)
{
conf
=
json
;
console
.
log
(
"
Configuration:
"
,
conf
);
$
.
getJSON
(
"
languages/
"
+
conf
.
language
+
"
.json
"
,
function
(
text
)
{
strings
=
text
;
console
.
log
(
"
Loaded language strings
"
);
});
});
}
function
showError
(
message
)
{
$
(
"
#alert_box
"
).
html
(
"
<div class=
\"
alert alert-danger
\"
role=
\"
alert
\"
>
"
...
...
@@ -14,4 +29,6 @@ var showSuccess = function(msg) {
+
msg
+
"
</div>
"
);
};
$
(
function
()
{
getSetupFromJson
();
})
src/js/iDIN-enroll.js
View file @
1525c6d1
$
(
function
()
{
var
translTable
=
{
"
zipcode
"
:
"
Postcode
"
,
"
address
"
:
"
Adres
"
,
"
city
"
:
"
Stad
"
,
"
initials
"
:
"
Initialen
"
,
"
familyname
"
:
"
Achternaam
"
,
"
gender
"
:
"
Geslacht
"
,
"
dateofbirth
"
:
"
Geboortedatum
"
,
"
country
"
:
"
Land
"
,
"
telephone
"
:
"
Telefoonnummer
"
,
"
email
"
:
"
E-mailadres
"
,
"
over12
"
:
"
Over 12
"
,
"
over16
"
:
"
Over 16
"
,
"
over18
"
:
"
Over 18
"
,
"
over21
"
:
"
Over 21
"
,
"
over65
"
:
"
Over 65
"
};
var
doneURL
=
"
done.html
"
;
function
addTableLine
(
table
,
head
,
data
){
...
...
@@ -31,15 +13,15 @@ $(function() {
}
function
displayAttributes
(
creds
,
translator
)
{
function
displayAttributes
(
creds
)
{
$
.
each
(
creds
,
function
(
i
,
cred
)
{
if
(
cred
.
credential
===
"
pbdf.pbdf.idin
"
){
$
.
each
(
cred
.
attributes
,
function
(
key
,
value
)
{
addTableLine
(
$
(
'
#idinTable
'
),
translator
.
hasOwnProperty
(
key
)
?
tr
anslator
[
key
]
:
key
,
value
);
addTableLine
(
$
(
'
#idinTable
'
),
strings
.
hasOwnProperty
(
"
attribute_
"
+
key
)
?
s
tr
ings
[
"
attribute_
"
+
key
]
:
key
,
value
);
});
}
else
{
$
.
each
(
cred
.
attributes
,
function
(
key
,
value
)
{
addTableLine
(
$
(
'
#ageTable
'
),
translator
.
hasOwnProperty
(
key
)
?
tr
anslator
[
key
]
:
key
,
value
);
addTableLine
(
$
(
'
#ageTable
'
),
strings
.
hasOwnProperty
(
"
attribute_
"
+
key
)
?
s
tr
ings
[
"
attribute_
"
+
key
]
:
key
,
value
);
});
}
});
...
...
@@ -68,6 +50,6 @@ $(function() {
//decode the issuing JWT and show the values in a table
var
decoded
=
jwt_decode
(
Cookies
.
get
(
"
jwt
"
));
displayAttributes
(
decoded
.
iprequest
.
request
.
credentials
,
translTable
)
displayAttributes
(
decoded
.
iprequest
.
request
.
credentials
)
});
src/js/iDIN-verify.js
View file @
1525c6d1
$
(
function
()
{
var
success_fun
=
function
(
data
)
{
$
(
"
#result_status
"
).
html
(
"
S
ucces
!
"
);
$
(
"
#result_header
"
).
html
(
"
R
esult
aat
"
);
$
(
"
#result_status
"
).
html
(
strings
.
verify_s
ucces
s
);
$
(
"
#result_header
"
).
html
(
strings
.
verify_r
esult
);
var
bd
=
jwt_decode
(
data
).
attributes
[
"
pbdf.pbdf.idin.dateofbirth
"
];
$
(
"
#token-content
"
).
html
(
"
<b>
Uw geboo
rt
e
dat
um is:
</b>
"
+
bd
);
//TODO: check
vo
or
verjaardag
$
(
"
#token-content
"
).
html
(
"
<b>
"
+
strings
.
verify_bi
rt
h
dat
e
+
"
</b>
"
+
bd
);
//TODO: check
f
or
birthdate
}
var
cancel_fun
=
function
(
data
)
{
$
(
"
#result_header
"
).
html
(
"
R
esult
aat
"
);
$
(
"
#result_status
"
).
html
(
"
Geannuleerd!
"
);
$
(
"
#result_header
"
).
html
(
strings
.
verify_r
esult
);
$
(
"
#result_status
"
).
html
(
strings
.
verify_cancelled
);
}
var
error_fun
=
function
(
data
)
{
console
.
log
(
"
De v
erificati
e is niet gelukt
!
"
);
console
.
log
(
"
V
erificati
on failed
!
"
);
console
.
log
(
"
Error data:
"
,
data
);
$
(
"
#result_header
"
).
html
(
"
R
esult
aat
"
);
$
(
"
#result_status
"
).
html
(
"
Mislukt!
"
);
$
(
"
#result_header
"
).
html
(
strings
.
verify_r
esult
);
$
(
"
#result_status
"
).
html
(
strings
.
verify_failed
);
}
$
(
"
#verify_idin_bd_btn
"
).
on
(
"
click
"
,
function
()
{
...
...
@@ -35,4 +35,4 @@ $(function() {
IRMA
.
verify
(
jwt
,
success_fun
,
error_fun
);
});
});
\ No newline at end of file
});
src/languages/en.json
View file @
1525c6d1
...
...
@@ -20,5 +20,27 @@
"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"
"done_return"
:
"Keer terug naar de attribuut-uitgifte pagina"
,
"attribute_zipcode"
:
"Postcode"
,
"attribute_address"
:
"Adres"
,
"attribute_city"
:
"Stad"
,
"attribute_initials"
:
"Initialen"
,
"attribute_familyname"
:
"Achternaam"
,
"attribute_gender"
:
"Geslacht"
,
"attribute_dateofbirth"
:
"Geboortedatum"
,
"attribute_country"
:
"Land"
,
"attribute_telephone"
:
"Telefoonnummer"
,
"attribute_email"
:
"E-mailadres"
,
"attribute_over12"
:
"Over 12"
,
"attribute_over16"
:
"Over 16"
,
"attribute_over18"
:
"Over 18"
,
"attribute_over21"
:
"Over 21"
,
"attribute_over65"
:
"Over 65"
,
"verify_success"
:
"Succes!"
,
"verify_result"
:
"Resultaat"
,
"verify_birthdate"
:
"Uw geboortedatum is:"
,
"verify_cancelled"
:
"Geannuleerd!"
,
"verify_failed"
:
"Mislukt!"
}
src/languages/nl.json
View file @
1525c6d1
...
...
@@ -20,5 +20,27 @@
"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"
"done_return"
:
"Keer terug naar de attribuut-uitgifte pagina"
,
"attribute_zipcode"
:
"Postcode"
,
"attribute_address"
:
"Adres"
,
"attribute_city"
:
"Stad"
,
"attribute_initials"
:
"Initialen"
,
"attribute_familyname"
:
"Achternaam"
,
"attribute_gender"
:
"Geslacht"
,
"attribute_dateofbirth"
:
"Geboortedatum"
,
"attribute_country"
:
"Land"
,
"attribute_telephone"
:
"Telefoonnummer"
,
"attribute_email"
:
"E-mailadres"
,
"attribute_over12"
:
"Over 12"
,
"attribute_over16"
:
"Over 16"
,
"attribute_over18"
:
"Over 18"
,
"attribute_over21"
:
"Over 21"
,
"attribute_over65"
:
"Over 65"
,
"verify_success"
:
"Succes!"
,
"verify_result"
:
"Resultaat"
,
"verify_birthdate"
:
"Uw geboortedatum is:"
,
"verify_cancelled"
:
"Geannuleerd!"
,
"verify_failed"
:
"Mislukt!"
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment