Skip to content

Localization #123

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
wants to merge 46 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
8bb1164
Add localization for questions, with fallback to English
gervasiocaj Apr 23, 2017
fec29eb
Add localization for quiz
gervasiocaj Apr 23, 2017
fea482d
Add localization for index and instructions
gervasiocaj Apr 23, 2017
2fb5dc3
Add localization for results
gervasiocaj Apr 24, 2017
9dfac02
[LOCALIZATION] [PT-BR] Ideologies
Apr 27, 2017
315ec7b
[LOCALIZATION] [PT-BR] Matches
Apr 27, 2017
5bbd29e
[LOCALIZATION] [PT-BR] WIP: Transalation.json
Apr 27, 2017
6200b85
Modularizes the localization binding
gervasiocaj Apr 28, 2017
5ab0e2b
Merge branch 'master' into localization
gervasiocaj May 5, 2017
610560f
Merge branch 'localization' into localization
gervasiocaj May 5, 2017
131ac35
Merge branch 'JoaoGFarias-localization' into localization
gervasiocaj May 5, 2017
13df9a9
Apply suggestions by @dserodio and @renanpvaz on the Portuguese trans…
gervasiocaj May 5, 2017
5a8c8d1
Localization [pt] results page
gervasiocaj May 5, 2017
f7fe42b
Add localization for images
gervasiocaj May 5, 2017
144b16c
Correct the English Questions
Saphareas May 5, 2017
3f52eec
[DE] German localization
Saphareas May 5, 2017
1614f53
Revert "Correct the English Questions"
Saphareas May 5, 2017
ec2f999
Fixed [DE] locales
Saphareas May 6, 2017
78d5a59
Add CSS based image localization
Saphareas May 6, 2017
04d8fcb
Fixed scaling issues on index
Saphareas May 6, 2017
d3a70d8
Fixed [DE] again (some issues with file formatting)
Saphareas May 6, 2017
1e10512
Fixed images on results page
Saphareas May 6, 2017
61bd6d5
[DE] translation for values
Saphareas May 6, 2017
5bbb5a5
Merge branch 'image_localization' into localization
Saphareas May 6, 2017
27ed5d1
Merge branch 'Saphareas-localization' into localization
gervasiocaj May 8, 2017
8a3479a
[PT] Translation for image values, home page complete
gervasiocaj May 8, 2017
9c38340
Revert "Add localization for images"
gervasiocaj May 8, 2017
848b9cc
traduzir questões faltantes
Aug 16, 2017
ac5dfe2
Merge pull request #4 from renanpvaz/localization
gervasiocaj Aug 16, 2017
00c16c8
Spanish translation
locoluis Aug 27, 2017
4fda1af
Minor errors
locoluis Aug 28, 2017
6ed7966
Merge pull request #5 from locoluis/localization
gervasiocaj Aug 29, 2017
d55fb59
Merge branch 'master' into localization
Genora51 Sep 22, 2020
cac3c90
Fix en locale
Genora51 Sep 22, 2020
3565ae6
chore: protected email from some bots
doamatto Mar 10, 2021
129b00d
i18n: added French matches
doamatto Mar 10, 2021
671d451
i18n: added french translations
doamatto Mar 10, 2021
e285fd9
i18n: added french ideologies
doamatto Mar 10, 2021
7bc6e1d
i18n: added french instructions
doamatto Mar 10, 2021
8f3c42b
i18n: added french quiz choices
doamatto Mar 10, 2021
eaebf4e
i18n: added french values
doamatto Mar 10, 2021
88d1001
i18n: added japanese locales (curtosey of @choux-kasa)
doamatto Mar 10, 2021
ba8a7f6
Add Turkish localisation
KebabLord Mar 11, 2021
23c8ebd
Apply suggestions from code review
Genora51 Mar 29, 2021
70deb4b
Merge pull request #136 from doamatto/localization
Genora51 Mar 29, 2021
a5c5a26
Update spanish and german questions
Genora51 Jul 15, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
24 changes: 24 additions & 0 deletions i18n.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
function i18n_load_ns(namespaces, callback) {
var options = {
// "whitelist": ["en", "de"],
// "nonExplicitWhitelist": true,
"fallbackLng": "en"
}

if (namespaces) options.ns = namespaces

window.i18next
.use(window.i18nextBrowserLanguageDetector)
.use(window.i18nextXHRBackend)
.init(options, function() {
i18n_ready()
if (callback) callback()
})
}

function i18n_ready() {
var fields = document.querySelectorAll("[data-i18n]")
for (var i = 0; i < fields.length; i++) {
fields[i].innerHTML=i18next.t(fields[i].dataset.i18n, fields[i].dataset)
}
}
Loading