diff gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java @ 315:63f8b3fb7d9a

Localization of chart axis with locale which fits best to server and browser settings. gnv-artifacts/trunk@373 c6561f87-3c4e-4783-a992-168aeb5c3f6f
author Ingo Weinzierl <ingo.weinzierl@intevation.de>
date Thu, 26 Nov 2009 08:47:44 +0000
parents 45625b5cd6d4
children 5f2820e821e0
line wrap: on
line diff
--- a/gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java	Thu Nov 26 08:45:04 2009 +0000
+++ b/gnv-artifacts/src/main/java/de/intevation/gnv/transition/timeseries/TimeSeriesOutputTransition.java	Thu Nov 26 08:47:44 2009 +0000
@@ -215,7 +215,18 @@
                 ChartLabels chartLables = new ChartLabels(this.getFisName(callMeta.getLanguages())+" "+this
                         .getSelectedFeatureName(uuid), this.domainLable);
 
-                String exportFormat = getExportFormat(mimeType);
+                String exportFormat       = getExportFormat(mimeType);
+
+                PreferredLocale[] locales = callMeta.getLanguages();
+                Locale[] serverLocales    =
+                    RessourceFactory.getInstance().getLocales();
+                Locale locale             =
+                    callMeta.getPreferredLocale(serverLocales);
+
+                log.debug(
+                    "Best locale - regarding intersection of server and " +
+                    "browser locales -  is " + locale.toString()
+                );
 
                 this.createChart(
                     outputStream,
@@ -225,6 +236,7 @@
                     chartLables,
                     uuid,
                     exportFormat,
+                    locale,
                     chartWidth,
                     chartHeight
                 );
@@ -399,6 +411,7 @@
         ChartLabels  chartLables,
         String       uuid,
         String       exportFormat,
+        Locale       locale,
         int          width,
         int          height
     )
@@ -411,7 +424,7 @@
             measurements,
             dates,
             getChartResult(uuid),
-            null, // Locale
+            locale, // Locale
             uuid
         );
 
@@ -461,7 +474,7 @@
             dates,
             result,
             timeGapDefinitions,
-            null
+            locale
         );
         chart.generateChart();
 
@@ -591,3 +604,4 @@
         return null;
     }
 }
+// vim:set ts=4 sw=4 si et sta sts=4 fenc=utf8 :

http://dive4elements.wald.intevation.org