UNPKG
international
Version:
latest (1.0.0)
1.0.0
simple i18n library
github.com/maxgfeller/language-switch
maxgfeller/language-switch
international
/
index.js
8 lines
(7 loc)
•
222 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
module
.
exports
=
function
(
list, element
) {
var
elements = element.
querySelectorAll
(
'[data-i18n]'
) ;[].
slice
.
call
(elements).
map
(
function
(
el
) {
var
t = el.
dataset
.
i18n
if
(list[t]) el.
textContent
= list[t] }) }