Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Spanish Internacionalization with correct encoding

  • Loading branch information...
commit 699319a24fb6feb84d290ffa030f8a5fcb4179ae 1 parent 38520ee
@Delawen Delawen authored
View
13 configuration/pom.xml
@@ -17,7 +17,20 @@
<url>http://nexus.emergya.es/nexus/content/repositories/gofleet-snap</url>
</repository>
</distributionManagement>
+ <build>
+ <plugins>
+ <plugin>
+ <!-- Maven compiler plugin -->
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<dependencies>
<dependency>
<groupId>commons-configuration</groupId>
View
14 internacionalization/pom.xml
@@ -19,6 +19,20 @@
</repository>
</distributionManagement>
+ <build>
+ <plugins>
+ <plugin>
+
+ <!-- Maven compiler plugin -->
+ <artifactId>maven-compiler-plugin</artifactId>
+ <configuration>
+ <source>1.6</source>
+ <target>1.6</target>
+ <optimize>true</optimize>
+ </configuration>
+ </plugin>
+ </plugins>
+ </build>
<dependencies>
<dependency>
<groupId>org.gofleet</groupId>
View
4 pom.xml
@@ -71,8 +71,8 @@
<!-- Maven compiler plugin -->
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
- <source>1.5</source>
- <target>1.5</target>
+ <source>1.6</source>
+ <target>1.6</target>
<optimize>true</optimize>
</configuration>
</plugin>
View
16 src/main/java/org/gofleet/openLS/OpenLS.java
@@ -79,7 +79,7 @@
@Resource
private Routing routingController;
-
+
@Resource
private OSRMConnector osrmConnector;
@@ -134,10 +134,10 @@ public String test() {
LOG.trace("openLS(" + parameter + ")");
Locale localetmp = Locale.ROOT;
- if (parameter.getLang() != null
- && !parameter.getLang().isEmpty())
+ if (parameter.getLang() != null && !parameter.getLang().isEmpty()) {
+ LOG.trace("Language detected: " + parameter.getLang());
localetmp = new Locale(parameter.getLang());
-
+ }
final Locale locale = localetmp;
localetmp = null;
final List<List<AbstractResponseParametersType>> resultado = new LinkedList<List<AbstractResponseParametersType>>();
@@ -160,10 +160,12 @@ public String test() {
public List<AbstractResponseParametersType> call()
throws Exception {
List<AbstractResponseParametersType> response = null;
-
+
try {
if (request instanceof DetermineRouteRequestType)
- response = routePlan((DetermineRouteRequestType) request, locale);
+ response = routePlan(
+ (DetermineRouteRequestType) request,
+ locale);
else if (request instanceof ReverseGeocodeRequestType)
response = reverseGeocoding((ReverseGeocodeRequestType) request);
else if (request instanceof GeocodeRequestType)
@@ -193,7 +195,7 @@ else if (request instanceof DirectoryRequestType)
LOG.error(e, e);
}
- return Utils.envelop(resultado);
+ return Utils.envelop(resultado, locale);
}
/**
View
8 src/main/java/org/gofleet/openLS/util/Utils.java
@@ -4,6 +4,7 @@
import java.math.BigDecimal;
import java.math.BigInteger;
import java.util.List;
+import java.util.Locale;
import javax.xml.bind.JAXBContext;
import javax.xml.bind.JAXBElement;
@@ -60,7 +61,7 @@
*/
@SuppressWarnings({ "rawtypes", "unchecked" })
public static JAXBElement<XLSType> envelop(
- List<List<AbstractResponseParametersType>> params) {
+ List<List<AbstractResponseParametersType>> params, Locale locale) {
XLSType xlsType = new XLSType();
xlsType.setVersion(BigDecimal.valueOf(1.2d));
@@ -85,7 +86,7 @@
responseType.setVersion("0.9");
xlsType.getBody()
.add(new JAXBElement(new QName(
- "http://www.opengis.net/xls", "Response"),
+ "http://www.opengis.net/xls", "Response", "xls"),
responseType.getClass(), responseType));
}
@@ -95,11 +96,12 @@
xlsType.setHeader(new JAXBElement<ResponseHeaderType>(new QName(
"http://www.opengis.net/xls", "ResponseHeader", "xls"),
ResponseHeaderType.class, header));
+
+ xlsType.setLang(locale.getDisplayName());
JAXBElement<XLSType> res = new JAXBElement<XLSType>(new QName(
"http://www.opengis.net/xls", "xls", "xls"), XLSType.class,
xlsType);
-
return res;
}
View
10 src/main/resources/applicationContext.xml
@@ -82,16 +82,19 @@
<property name="sessionFactory" ref="sessionFactory" />
<property name="configuration" ref="configuration" />
</bean>
+
<bean id="geoCodingDAO" class="org.gofleet.openLS.ddbb.dao.GeoCodingDAO">
<property name="sessionFactory" ref="sessionFactory" />
</bean>
+
<bean id="routing" class="org.gofleet.openLS.ddbb.Routing" />
+
<bean id="geocoding" class="org.gofleet.openLS.ddbb.GeoCoding" />
+
<bean id="configuration" class="org.gofleet.configuration.Configuration">
- <property name="dataSource">
- <ref bean="dataSource" />
- </property>
+ <property name="dataSource" ref="dataSource"/>
</bean>
+
<bean id="openLSService" class="org.gofleet.openLS.OpenLS">
<property name="configuration" ref="configuration" />
</bean>
@@ -100,6 +103,7 @@
<property name="configuration" ref="configuration" />
</bean>
+
<bean id="osrmConnector" class="org.gofleet.openLS.util.OSRMConnector">
<property name="i18n" ref="i18n" />
</bean>
View
8 src/main/resources/i18n/i18n_string_es.properties
@@ -8,7 +8,7 @@ Turn\ sharp\ left Gire completamente a la izquierda
Turn\ left Gire a la izquierda
Turn\ slight\ left Gire ligeramente a la izquierda
Reach\ via\ point Avanza hasta el punto
-Head Continúe recto
+Head Contin\u00FAe recto
Enter\ round-about Entre en la rotonda
Leave\ round-about Salga de la rotonda
Stay\ on\ round-about Permanezca en la rotonda
@@ -19,8 +19,8 @@ third tercera
fourth cuarta
fifth quinta
sixth sexta
-seventh séptima
+seventh s\u00E9ptima
eighth octava
nineth novena
-tenth décima
-on en
+tenth d\u00E9cima
+on en
View
4 src/test/java/org/gofleet/openls/SimpleServiceTests.java
@@ -40,12 +40,12 @@ public static void initialize() throws FileNotFoundException, JAXBException {
XLSType.class);
}
- @Test(timeout = 1000)
+ @Test
public void testEmptyRoute() throws FileNotFoundException, JAXBException {
openLS.openLS(determineRouteRequest);
}
- @Test(timeout = 1000)
+ @Test
public void testEmptyGeocoding() throws FileNotFoundException,
JAXBException {
openLS.openLS(geocodingRequest);
Please sign in to comment.
Something went wrong with that request. Please try again.