Preselecting the active language
authorJaroslav Tulach <jaroslav.tulach@apidesign.org>
Sun, 08 Nov 2009 10:06:12 +0100
changeset 14737e67c923018
parent 146 0b889d9e4ee1
child 148 8e72d8596e92
Preselecting the active language
freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties
freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties
freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt
     1.1 --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties	Sun Nov 08 09:54:32 2009 +0100
     1.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties	Sun Nov 08 10:06:12 2009 +0100
     1.3 @@ -72,7 +72,7 @@
     1.4  EMAIL=Email:
     1.5  CHANGE_EMAIL=Update!
     1.6  LANGUAGE=Language:
     1.7 -ENGLISH=English
     1.8 -CZECH=\u010Cesky
     1.9 +en=English
    1.10 +cs=\u010Cesky
    1.11 +LOCALE=en
    1.12  CHANGE_LANGUAGE=Change!
    1.13 -
     2.1 --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties	Sun Nov 08 09:54:32 2009 +0100
     2.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties	Sun Nov 08 10:06:12 2009 +0100
     2.3 @@ -87,4 +87,4 @@
     2.4  CHANGE_EMAIL=Zm\u011Bnit!
     2.5  LANGUAGE=Jazyk:
     2.6  CHANGE_LANGUAGE=Zm\u011Bnit!
     2.7 -
     2.8 +LOCALE=cs
     3.1 --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Sun Nov 08 09:54:32 2009 +0100
     3.2 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt	Sun Nov 08 10:06:12 2009 +0100
     3.3 @@ -172,9 +172,14 @@
     3.4        </form>
     3.5        <form action="/options">
     3.6              ${bundle.LANGUAGE}
     3.7 -              <select name="language" id="column">
     3.8 -                  <option value="en">${bundle.ENGLISH}</option>
     3.9 -                  <option value="cs">${bundle.CZECH}</option>
    3.10 +            <#macro lang locale>
    3.11 +            <option
    3.12 +                value="${locale}" <#if bundle("LOCALE") = locale>selected</#if>
    3.13 +            >${bundle(locale)}</option>
    3.14 +            </#macro>
    3.15 +            <select name="language" id="column">
    3.16 +                <@lang "en"/>
    3.17 +                <@lang "cs"/>
    3.18                </select>
    3.19              <input type="submit" value="${bundle.CHANGE_LANGUAGE}" />
    3.20        </form>