Select locale
This commit is contained in:
parent
3acca0b068
commit
4083be409e
2 changed files with 13 additions and 1 deletions
|
@ -22,8 +22,10 @@ window.leqsikoni = {
|
|||
words_xxxxx: function(word_id) {
|
||||
$('#app').html(window.leqsikoni.words_xxxxx_template())
|
||||
|
||||
var locale = String($('#locale').val())
|
||||
|
||||
$.getJSON(
|
||||
'http://localhost:4567/words/' + word_id,
|
||||
'http://localhost:4567/words/' + word_id + '?locale=' + locale,
|
||||
function(data) {
|
||||
document.title = window.leqsikoni.maybe_text(data.primary_form) || ''
|
||||
$('#app').html(window.leqsikoni.words_xxxxx_template(data))
|
||||
|
@ -175,5 +177,7 @@ window.leqsikoni = {
|
|||
|
||||
$(function() {
|
||||
window.addEventListener('hashchange', window.leqsikoni.app, false)
|
||||
$('#locale').change(window.leqsikoni.app)
|
||||
|
||||
window.leqsikoni.app()
|
||||
})
|
||||
|
|
|
@ -6,6 +6,14 @@
|
|||
<link rel="stylesheet" href="bundle.css"/>
|
||||
</head>
|
||||
<body>
|
||||
<select id="locale">
|
||||
<option value="en">English</option>
|
||||
<option value="ru">Русский</option>
|
||||
<option value="pl">Polski</option>
|
||||
<option value="es">Español</option>
|
||||
<option value="ka">ქართული</option>
|
||||
</select>
|
||||
|
||||
<div id="app"></div>
|
||||
|
||||
<script
|
||||
|
|
Loading…
Add table
Reference in a new issue