Skip to content

Commit 098bf18

Browse files
author
Sebastian Kippe
committed
Show current language on switcher button (refs #2)
1 parent d5199c3 commit 098bf18

File tree

2 files changed

+6
-3
lines changed

2 files changed

+6
-3
lines changed

index.html

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
<div data-theme="a" data-role="header">
1616
<h3><img src="img/logo.svg" alt="Doze Poa"></h3>
1717
<a id="language-switcher-button" href="#language-switcher" aria-haspopup="true" aria-owns="#language-menu" data-transition="pop" data-rel="popup" data-inline="true">
18-
Language
18+
{{currentLanguage}}
1919
</a>
2020
</div>
2121
<div data-role="content">
@@ -27,7 +27,7 @@ <h3><img src="img/logo.svg" alt="Doze Poa"></h3>
2727
</ul>
2828
</div>
2929
<div class="ui-grid-a">
30-
{{#each this}}
30+
{{#each categories}}
3131
<div class="ui-block-{{gridPosition}}">
3232
<a href="#phrases" data-transition="slide" data-category="{{name}}">
3333
<img src="img/{{name}}.svg"/>

js/app.js

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,10 @@ var categoriesTemplate = Handlebars.compile($('#nav-template').html());
22
var phrasesTemplate = Handlebars.compile($('#phrases-template').html());
33
var phraseTemplate = Handlebars.compile($('#phrase-template').html());
44

5-
var navHtml = categoriesTemplate(Dozepoa.categories(Dozepoa.currentLanguage));
5+
var navHtml = categoriesTemplate({
6+
categories: Dozepoa.categories(Dozepoa.currentLanguage),
7+
currentLanguage: Dozepoa.languages[Dozepoa.currentLanguage]
8+
});
69

710
var phrasesHtml = phrasesTemplate({
811
phrases: Dozepoa.content.categories[0]["phrases"]

0 commit comments

Comments
 (0)