Multilingual Translate Data Returned From The Database

Multilingual Translate Data Returned From The Database

In this document we will demonstrate how it is possible to translate text that is held in a specific language within your database into a different language.

We will demonstrate how it is possible to filter or colour charts, tables and categories even when the actual data is in a different language.

In this example we are going to use months of the year as an example.

image-20240719-120656.png

So I’ve created an object which returns the Month (footfall month - when did customers visit my Store).

I can create a chart from this data.

 

image-20240719-121047.png

Now I’d like to colour August in Blue as it’s when my birthday is.

 

image-20240719-121229.png

Now I have Portuguese users so I want the to see the months as

 

January=Janeiro

February=fevereiro

March=Março

April=Abril

May=Maio

June=Junho

July=Julho

August=Agosto

September=Setembro

October=Outubro

November=Novembro

December=Dezembro


So we create a file named messagesUserEntered_pt_PT.properties

Which contains the following

 

image-20240719-122109.png

Then upload it

 

image-20240719-122458.png

Then I am going to log back in, in Portuguese

 

image-20240719-122815.png

My chart will now be in Portuguese

 

image-20240719-122953.png

Note to make it complete I’ll add my object names and chart title to the messagesData_pt_PT.properties file

Footfall By Month=Movimento por mês

Footfall Month=Mês de passos

Customer Visits=Visitas de clientes

 

image-20240719-123449.png

and upload it…

NOTE: you do not need to alter any filters / colours etc. It uses the base language to apply the colours or filters.

For example for colours,

image-20240719-123748.png

 

Or for filters

 

image-20240719-123948.png

The end user can select filters now in their language, but the filters are applied in the base language

 

image-20240719-124056.png

without the need for any additional transformations.

If you have applied your own methods - with DB field translations or index values - these will continue to work. However using the catalog file is a much simpler way of translating.