# HG changeset patch # User Jaroslav Tulach # Date 1252739473 -7200 # Node ID e03f660f0e0a06e223121a2f2c56bab13827bae0 # Parent 89bca098e14e375937b7f61a626fb756f2ffd657 Moving all localized strings into one Bundle diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java --- a/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Sat Sep 12 05:00:28 2009 +0200 +++ b/freemarkerdor/src/main/java/cz/xelfi/quoridor/freemarkerdor/UI.java Sat Sep 12 09:11:13 2009 +0200 @@ -248,18 +248,16 @@ } private Viewable viewable(String page, Document doc, Object... more) { - String bundle = page.split("\\.")[0]; - ResourceBundle rb = null; for (Locale l : headers.getAcceptableLanguages()) { try { - rb = ResourceBundle.getBundle("cz.xelfi.quoridor.freemarkerdor.UI." + bundle, l); + rb = ResourceBundle.getBundle("cz.xelfi.quoridor.freemarkerdor.UI.Bundle", l); } catch (MissingResourceException e) { // OK } } if (rb == null) { - rb = ResourceBundle.getBundle("cz.xelfi.quoridor.freemarkerdor.UI." + bundle, Locale.ENGLISH); + rb = ResourceBundle.getBundle("cz.xelfi.quoridor.freemarkerdor.UI.Bundle", Locale.ENGLISH); } Map map = new HashMap(); diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle.properties Sat Sep 12 09:11:13 2009 +0200 @@ -0,0 +1,43 @@ +TITLE=Quoridor Community Server + + +gameWhiteBlack={0} vs. {1} +LastMove=Last move {1,choice,\ + 0#second|\ + 2#{1} seconds|\ + 60#a minute|\ + 120#{2} minutes|\ + 3600#an hour|\ + 7200#{3} hours|\ + 86400#a day|\ + 172800#{4} days\ +} ago +GAME_MOVE=Your move +GAME_WAIT=Opponent's move +GAME_WON=Won games +GAME_LOST=Lost games +CREATE=Create! +GAME_ALL=All games +WHITE=White +BLACK=Black + +players={0} vs. {1} +PLACE=Place! +MOVE=Move! +RESIGN=Resign! +H=Horizontal +V=Vertical +RELOAD=Reload +GAME=Game +MOVENUMBER=# +MOVES=Moves +ROOT=Home +MOVE_WHO=It is {0}\'s turn. +WON={0} won + + +NAME=Name +PASSWORD=Password +LOGIN=Login! +logged=You are logged in as {0}. +home=Start! diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/Bundle_cs.properties Sat Sep 12 09:11:13 2009 +0200 @@ -0,0 +1,49 @@ +TITLE=Komunitn\u00ED server Quoridor +gameWhiteBlack={0} proti {1} +GAME_MOVE=Na tahu +GAME_WAIT=\u010Cek\u00E1 se na tah +GAME_WON=Vyhran\u00E9 +GAME_LOST=Prohran\u00E9 +CREATE=Vytvo\u0159 novou +GAME_ALL=V\u0161echny hry +WHITE=B\u00EDl\u00FD +BLACK=\u010Cern\u00FD +LastMove=T\u00E1hnuto p\u0159ed {1,choice,\ + 0#chv\u00EDl\u00ED|\ + 10#{1}-ti sekundami|\ + 60#minutou|\ + 120#dv\u011Bma minutami|\ + 180#t\u0159emi minutami|\ + 240#\u010Dty\u0159mi minutami|\ + 300#{2}-ti minutami|\ + 3600#hodinou|\ + 7200#dv\u011Bma hodinami|\ + 10800#t\u0159emi hodinami|\ + 14400#\u010Dty\u0159mi hodinami|\ + 18000#{3}-ti hodinami|\ + 86400#jedn\u00EDm dnem|\ + 172800#dv\u011Bma dny|\ + 259200#t\u0159emi dny|\ + 345600#\u010Dty\u0159mi dny|\ + 432000#{4}-ti dny\ +} + +players={0} proti {1} +PLACE=Um\u00EDstit +MOVE=T\u00E1hnout +RESIGN=Vzd\u00E1t +H=Horizont\u00E1ln\u011B +V=Vertik\u00E1ln\u011B +RELOAD=Obnovit +GAME=Hra +MOVENUMBER=Tah +MOVES=Z\u00E1pis +ROOT=Dom\u016F +MOVE_WHO=Na tahu je {0} +WON=Vyhr\u00E1l {0} +TITLE=Komunitn\u00ED server Quoridor +NAME=Jm\u00E9no +PASSWORD=Heslo +LOGIN=P\u0159ihl\u00E1sit se +logged=Jste p\u0159ihl\u00E1\u0161en jako {0} +home=Za\u010D\u00EDt hr\u00E1t diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/game.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/game.properties Sat Sep 12 05:00:28 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -players={0} vs. {1} -PLACE=Place! -MOVE=Move! -RESIGN=Resign! -H=Horizontal -V=Vertical -RELOAD=Reload -GAME=Game -MOVENUMBER=# -MOVES=Moves -ROOT=Home -MOVE_WHO=It is {0}'s turn. -WON={0} won diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/game_cs.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/game_cs.properties Sat Sep 12 05:00:28 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -players={0} proti {1} -PLACE=Um\u00EDstit -MOVE=T\u00E1hnout -RESIGN=Vzd\u00E1t -H=Horizont\u00E1ln\u011B -V=Vertik\u00E1ln\u011B -RELOAD=Obnovit -GAME=Hra -MOVENUMBER=Tah -MOVES=Z\u00E1pis -ROOT=Dom\u016F -MOVE_WHO=Na tahu je {0} -WON=Vyhr\u00E1l {0} diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt Sat Sep 12 05:00:28 2009 +0200 +++ b/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.fmt Sat Sep 12 09:11:13 2009 +0200 @@ -7,26 +7,18 @@

${bundle.TITLE}

- <#macro past t> - <#if t < 60000> - <#assign unit="s"/> - <#assign value= t?float / 1000.0/> - <#elseif t < 3600000> - <#assign unit="min"/> - <#assign value=t?float / 60000.0/> - <#elseif t < 24 * 3600 * 1000> - <#assign unit="h"/> - <#assign value=t?float / 3600000.0/> - <#else> - <#assign unit="day"/> - <#assign value=t?float / (24.0 * 3600000.0)/> - - ${value?float?string("0")} ${unit} + <#macro before t> + <#assign seconds = (t / 1000)?int/> + <#assign minutes= (seconds / 60)?int/> + <#assign hours= (minutes / 60)?int/> + <#assign days= (hours / 24)?int/> + + ${bundle("LastMove", t?int, seconds?int, minutes?int, hours?int, days?int)} <#macro game game> ${bundle("gameWhiteBlack", game.@white?string, game.@black?string)} - ${bundle.before} <@past (now - game.@modified?number)/> + <@before (now - game.@modified?number)?int/> <#if message?? > diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index.properties Sat Sep 12 05:00:28 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -TITLE=Quoridor Community Server -gameWhiteBlack={0} vs. {1} -BOARD=QuoBoard -GAME_MOVE=Your move -GAME_WAIT=Opponent's move -GAME_WON=Won games -GAME_LOST=Lost games -CREATE=Create! -GAME_ALL=All games -WHITE=White -BLACK=Black -before=Before - diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index_cs.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/index_cs.properties Sat Sep 12 05:00:28 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,13 +0,0 @@ -TITLE=Komunitn\u00ED server Quoridor -gameWhiteBlack={0} proti {1} -BOARD=Hrac\u00ED deska -GAME_MOVE=Na tahu -GAME_WAIT=\u010Cek\u00E1 se na tah -GAME_WON=Vyhran\u00E9 -GAME_LOST=Prohran\u00E9 -CREATE=Vytvo\u0159 novou -GAME_ALL=V\u0161echny hry -WHITE=B\u00EDl\u00FD -BLACK=\u010Cern\u00FD -before=P\u0159ed - diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/login.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/login.properties Sat Sep 12 05:00:28 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -TITLE=Quoridor Community Server -NAME=Name -PASSWORD=Password -LOGIN=Login! -logged=You are logged as {0}. -home=Start! diff -r 89bca098e14e -r e03f660f0e0a freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/login_cs.properties --- a/freemarkerdor/src/main/resources/cz/xelfi/quoridor/freemarkerdor/UI/login_cs.properties Sat Sep 12 05:00:28 2009 +0200 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -TITLE=Komunitn\u00ED server Quoridor -NAME=Jm\u00E9no -PASSWORD=Heslo -LOGIN=P\u0159ihl\u00E1sit se -logged=Jste p\u0159ihl\u00E1\u0161en jako {0} -home=Za\u010D\u00EDt hr\u00E1t