# HG changeset patch # User Sascha L. Teichmann # Date 1342876401 0 # Node ID 653dd9d7f5d5a8b7676ac955c355fef97d60aa4d # Parent 87c0a06743b8e041b91c54442425660a1f1d5f48 FixA: Introduce i18n to overview transformation. flys-client/trunk@5093 c6561f87-3c4e-4783-a992-168aeb5c3f6f diff -r 87c0a06743b8 -r 653dd9d7f5d5 flys-client/ChangeLog --- a/flys-client/ChangeLog Fri Jul 20 14:09:53 2012 +0000 +++ b/flys-client/ChangeLog Sat Jul 21 13:13:21 2012 +0000 @@ -1,3 +1,13 @@ +2012-07-21 Sascha L. Teichmann + + * src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl: + Bring in sync with transformation in flys-client. Current weakness: + Only english and german locales are supported. + + * src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java: + Depending on client given locale call transformation with + locale "de" or "en". + 2012-07-20 Sascha L. Teichmann * src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl: Merged diff -r 87c0a06743b8 -r 653dd9d7f5d5 flys-client/src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java --- a/flys-client/src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java Fri Jul 20 14:09:53 2012 +0000 +++ b/flys-client/src/main/java/de/intevation/flys/client/server/FixingsOverviewServiceImpl.java Sat Jul 21 13:13:21 2012 +0000 @@ -58,8 +58,8 @@ String locale, String uuid, String filter, - boolean checkboxes, - String callback + boolean checkboxes, + String callback ) throws ServerException { @@ -100,8 +100,8 @@ log.debug(XMLUtils.toString(resultDoc)); } - FixingsOverviewInfo i = - getInfo(resultDoc, uuid, checkboxes, callback); + FixingsOverviewInfo i = getInfo( + locale, resultDoc, uuid, checkboxes, callback); return i; } catch (ConnectionException ce) { @@ -112,11 +112,17 @@ protected FixingsOverviewInfo getInfo( + String locale, Document doc, String uuid, boolean checkboxes, String callback ) { + // TODO: Find a more general solution. + locale = locale == null || locale.toLowerCase().startsWith("de") + ? "de" + : "en"; + InputStream transform = getServletContext() .getResourceAsStream(XSL_TRANSFORM); @@ -128,6 +134,7 @@ String result = null; try { XSLTransformer xformer = new XSLTransformer(); + xformer.addParameter("locale", locale); xformer.addParameter("project-uuid", uuid); xformer.addParameter( "render-checkboxes", @@ -166,12 +173,12 @@ List fixEvents = getFixEvents(doc); return new FixingsOverviewInfo( - rid, - river, - from, - to, - fixEvents, - result); + rid, + river, + from, + to, + fixEvents, + result); } diff -r 87c0a06743b8 -r 653dd9d7f5d5 flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl --- a/flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl Fri Jul 20 14:09:53 2012 +0000 +++ b/flys-client/src/main/webapp/WEB-INF/stylesheets/fixoverview2html.xsl Sat Jul 21 13:13:21 2012 +0000 @@ -9,6 +9,79 @@ + de + + + + + + + + + 0,## + 0.## + + + + + + Ereignis + Event + + + + + + Legende + Caption + + + + + + Farbe + Color + + + + + + Bedeutung + Meaning + + + + + + um MNQ + around MNQ + + + + + + um MQ + around MQ + + + + + + um MHQ + around MHQ + + + + + + über HQ5 + above HQ5 + + + + + @@ -23,7 +96,7 @@ - + @@ -36,7 +109,7 @@ - + @@ -165,14 +238,14 @@ km - + - - + - / Q um MNQ - / Q um MQ - / Q um MHQ - / Q über HQ5 + / Q + / Q + / Q + / Q @@ -205,7 +278,7 @@ overflow:hidden;background: #ada96e - gray + silver ;width: @@ -217,9 +290,9 @@ : km - + - - + @@ -240,7 +313,7 @@   - Ereignis + @@ -250,36 +323,36 @@
- + - - + + - + - + - + - +
Legende
FarbeBedeutung
 um MNQ Q ∈ [0, (MNQ+MQ)/2)
 um MQ Q ∈ [(MNQ+MQ)/2, (MQ+MHQ)/2)
 um MHQ Q ∈ [(MQ+MHQ)/2, HQ5)
 über HQ5 Q ∈ [HQ5, ∞)