I am trying to add localization support for my application, and so far I have been able to make most of the interface and messages localization work as expected, but I'm having trouble getting SmartGWT to use the right ResourceBundle properties file to load in order to show the correct labels and values for my databound controls that use a PropertyResourceBundle approach.
This is my ds.xml file:
I have three properties files located on package co.focuss.bmsimulator.shared.i18n. Their content is:
The problem is that even if the rest of the application elements do show in the correct locale, because the standard GWT Constants and Messages approaches used for that part are detecting the locale correctly, in the form that localizes the DataSource contents there seems to be a problem with detecting the locale correctly, because the mechanism will always use the BMSimulatorResources_es.properties to do the localization.
What am I missing here?
ps. I tried following the steps describe here as closely as possible: https://www.smartclient.com/smartgwt...alization.html
This is my ds.xml file:
Code:
<DataSource ID="preferences" serverType="sql" tableName="preferences" xmlns:fmt="WEB-INF/"> <fmt:bundle basename="co.focuss.bmsimulator.shared.i18n.BMSimulatorResources" encoding="utf-8"/> <fields> <field name="userName" primaryKey="true" canSave="false"> <title><fmt:message key="userName"/></title> </field> <field name="password"> <title><fmt:message key="password"/></title> <validators> <validator type="lengthRange" min="6"> <errorMessage><fmt:message key="passwordMinimumLenghtValidator"/></errorMessage> </validator> <validator type="lengthRange" max="20"> <errorMessage><fmt:message key="passwordMaximumLenghtValidator"/></errorMessage> </validator> </validators> </field> <field name="mode"> <title><fmt:message key="mode"/></title> <valueMap> <value id="basic"><fmt:message key="interfaceModeBasic"/></value> <value id="advanced"><fmt:message key="interfaceModeAdvanced"/></value> </valueMap> </field> <field name="language"> <title><fmt:message key="language"/></title> <valueMap> <value id="en"><fmt:message key="languageEnglish"/></value> <value id="es"><fmt:message key="languageSpanish"/></value> </valueMap> </field> </fields> </DataSource>
Code:
/* BMSimulatorResources.properties */ userName=User password=Password passwordMinimumLenghtValidator=Password length must be 6 or more characters. passwordMaximumLenghtValidator=Password length must be 20 or less characters. mode=Mode interfaceModeBasic=Basic interfaceModeAdvanced=Advanced language=Simulator Language languageEnglish=English languageSpanish=Spanish /* BMSimulatorResources_en.properties */ userName=User password=Password passwordMinimumLenghtValidator=Password length must be 6 or more characters. passwordMaximumLenghtValidator=Password length must be 20 or less characters. mode=Mode interfaceModeBasic=Basic interfaceModeAdvanced=Advanced language=Simulator Language languageEnglish=English languageSpanish=Spanish /* BMSimulatorResources_es.properties */ userName=Usuario password=Clave passwordMinimumLenghtValidator=La longitud de la clave debe ser 6 caracteres o más. passwordMaximumLenghtValidator=La longitud de la clave debe ser 20 caracteres o menos. mode=Modo interfaceModeBasic=Básico interfaceModeAdvanced=Avanzado language=Idioma del Simulador languageEnglish=Inglés languageSpanish=Español
What am I missing here?
ps. I tried following the steps describe here as closely as possible: https://www.smartclient.com/smartgwt...alization.html
Comment