Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

In order to localize an existing Mondrian Schema deployed on the platform and use it in Analyzer, you must follow these steps.

1. Edit the schema file

Open your schema file and replace the names you would like to localize in different languages by placeholders. Example:

<Measure name="Measure 1" caption="%{myMeasure1}" column="unit_sales" aggregator="sum" />
<Measure name="Measure 2" caption="%{myMeasure2}" column="unit_sales" aggregator="sum" />

Notice the usage of the %{ }

2. Edit [solutions folder]/system/mondrian/mondrian.properties

Open the mondrian.properties file and add at the bottom the following property.

mondrian.rolap.localePropFile=com.pentaho.messages.MondrianMessages

3. Edit [solutions folder]/system/olap/datasources.xml

Open the datasources.xml file and locate your datasource declaration which uses the Mondrian schema you modified at step 1. You need to add some parameters to its DataSourceInfo element, as follows.

<DataSourceInfo>Provider=mondrian;DataSource=SampleData;DynamicSchemaProcessor=mondrian.i18n.LocalizingDynamicSchemaProcessor;UseContentChecksum=true</DataSourceInfo>

4. Create your language files

You now need to create your localization files. First, navigate to [platform folder]/biserver-ee/tomcat/webapps/pentaho/WEB-INF/classes/com/pentaho/messages. If some folders are missing (chances are all those inside the 'classes' folder won't be present), create all missing folders manually. Then you will need to create one text file per language you want to support, using the standard localization files convention. As an example, files to support both English and French would be respectively:

MondrianMessages_en.properties
MondrianMessages_fr.properties

Once those files are created, you will need to create pair of keys and values. The keys are all the tokens that you have inserted into your Mondrian schema file at step 1. The values are the actual translated name you would like to substitute the token by. As an example, the file MondrianMessages_en.properties would contain something similar to this:

myMeasure1=My Measure 1
myMeasure2=My Measure 2

And that should do it. Don't forget to restart your platform webapp, refresh the solution repository and clear the schema cache once you are done. From now on, the placeholders which are present in your Mondrian schema file will be automatically replaced by the translated version in the language requested by the user browsers.

  • No labels