Qlik Community

Qlik Design Blog

All about product and Qlik solutions: scripting, data modeling, visual design, extensions, best practices, etc.

cbo
Contributor

Handling Multiple Languages

Today’s corporate environment is global. QlikView application developers are required to support many regions and many languages. So how does a QlikView application developer handle multiple languages?  Well, that depends on how the data is captured and the overall goal of the application developer. Let’s look at two scenarios.

Scenario 1:  The developer only needs to translate the labels and textboxes within the application and not the actual data.  blog picture 1.png

  1. Create a translation spreadsheet that contains an index column to be used for reference and columns for every language that each label and text entry that needs to be translated.
  2. Fill in the English language column with the text to be translated and have translators fill out their language. 
  3. In the script load the translation spreadsheet and create an inline table that contains all of the language translations. Then create a variable, say vDataLanguage,  that reads the Language field.
  4. Using set analysis, create an expression that references the index number and the language to display

=Only({<Index={12}>} [$(=vDataLanguage)]) 

for all textbox and object captions that need to be translated.   

Scenario 2:  The data from which the QlikView application developer is developing is recorded in English but he/she needs to have some of the actual data translated into other languages.

blog picture 2.png

  1. The first thing that he/she needs to do is determine the fields that need to be translated and create a translation spreadsheet that contains a worksheet for each of the fields to be translated. For example, we need to translate the Industry data. Now we need to load the data translation file into QlikView as a Mapping Load for each language. For this example we need to translate into German and French so we’ll create a mapping file for French_Industry and a mapping file for German_Industry.
  2. Create an inline table that contains all of the language translations.
  3. Create a variable that reads the Language field (vDataLanguage). 
  4. In the script, find the Industry Field that we need to translate.  Using the Applymap function we can translate the English data into the different languages and be sure to name the translated field as Fieldname_Language (e.g. Industry_French) .
  5. We now need to create a variable for each translated field. So for industry we’ll create vIndustry. The expression in vIndustry is  
         =chr(91)&'Industry' &chr(95) & '$(vDataLanguage)' & chr(93) .
  6. Now to get the correct language to display in a list box you need a calculated dimension using this expression,  which is

            =$(vIndustry).

That’s it! Easy, right? Well, it is a bit time consuming if you are trying to translate data in fields but translating text and labels is really not that difficult. I created a technical overview that walks you through the two scenarios mentioned in this blog as well as a third scenario which can be found here. This resource includes a How-To, sample data files and 2 QVWs.

Good luck with the translations!  Lycka till med översättningarna!  翻訳で頑張ってください!

20 Comments
Not applicable

It is really helpful, but what if the data translation has to be made and the table is of large size,

Example: I have a table with details of all the employees along with Gender. I would like to have Gender displayed in different languages based on user's choice. The above example to create a record for each language is really a overhead in my case. Any help on this ?

0 Likes
204 Views
Not applicable

Probably a bit late for this reply, but ideally your data should contain only keys that look towards lookup tables. So in your table, you should have a gender key of 1, 2 and a lookup table that maps these values to 'male' and 'female' for each language.

0 Likes
204 Views
sateeshkumar
Contributor

Hi,

     This example is really good. but, In my database data is in single language and  it contains large amount of data. So how to display it in different languages in qlikview report. Pls provide one example qvw file to solve this problem.

0 Likes
204 Views
Not applicable

Hi,

    Very smart way of doing this. However do you have a suggestion in case I have quite a lot of data so manual translation of english to Spanish,German etc is not possible?

Thanks,

Shoubhik.

0 Likes
204 Views
jcamps
New Contributor III

Hi, just wanted to share some more information...

First, the option with variables is not very useful for large applications with lots of texts (like hundreds in my case). The application is ever growing so having that many variables is complicated. You can create the variables at script time, but that means that whenever a message disappears, you must delete the old variable manually...

The option with the ID is nicer but hard to program for me, you need to work with numbers instead of texts... Also, I noticed performance issues since every translated text needs a differents set, meaning the QV engine needs to do all the overhead of a selection (that is, find out possible and excluded values thoughout the model) for every translated text. It's probably optimitzed but even so... Also, I believe that QV cannot use the cache of set's since there are so many of them.

I'm trying a new approach where I have a data island with a single table. It will have a Language Field, followed by many fields (one per each message). Like so:

  Language, [Hello world], [Translated text]

  ENG, Hello world, Translated text

  SPA, Hola mundo, Texto traducido

  ...

This table should be Qualified for example with TRANSLATE.

That way, using a translated text should be as simple as

= TRANSLATE.[Hello world]

Also, It cannot get much easier than that for QlikView to get the value. No IF's, no set analysis... just selecting the language in the Language field will switch all the texts.

I'll try to tell you my results as long as I have them

Jordi

0 Likes
204 Views
jcamps
New Contributor III

So, after some tests... results were not exactly as expected.

The one-column-per-message approach did work as expected, a little faster and easier to use than other methods... until I reached a certain number of fields. In my case, when I reached 200 messages performance was equal, and with my full translation file (550 fields) it performed noticeably worse than standard approaches.

I don't really understand why, but it seems that QV does not like a table with +500 fields, even if it just has a coiuple of rows and is in a data island...

0 Likes
204 Views
gonzalo_figuero
New Contributor

Hi Charles,

Thanks for the information! Just one question. Is it possible to have a list box in multiple languages WITHOUT modifying the current file.

I have a data base, that is generated automatically, and I can't modify it! So I have to create a new file, with the dictionary, but I don't know how to co the list box in multiple languages.

Thanks!

0 Likes
204 Views
tanvi_madan1
New Contributor III

Hi Charles,


I had tired this in qlik sense , but i am not able to change the text of object with language filter. as in qlik sense it is not taking the value of the field name properly.


counld you please suggest on this .


Thanks ,

Tanvi

0 Likes
204 Views
Not applicable

How does browser based localization work? I want to localize to different languages not based on selection from Qlikview document but from browser. 

0 Likes
204 Views
ecolomer
Honored Contributor II

Thank's for sharing.

BR

Enrique

0 Likes
204 Views
beck110979
Valued Contributor III

Thanks for sharing

very helpful

0 Likes
204 Views
mehow1989
New Contributor II

Awesome, great job! These stupid [...] couldn't let me sleep.

0 Likes
204 Views
Not applicable

Thanks! Very helpful!

Is there a way to do this in QlikSense? It seems like QlikSense is not recognizing the variable in the filter as a field name.

Would be happy to see your thoughts about this!

0 Likes
204 Views
Not applicable

In Qliksense 3.2 




=Only({<Id={2}>} [$(=vLanguage)])  returns "-" ,

=Only( {< [Id] = {2} >} $(=vLanguage))  returns word "Japanese"


=Only( {< Id = {2} >} [Japanese])  returns the  correctly translated word


Any suggestion on where I am wrong?



0 Likes
204 Views
anderseriksson
Contributor III

We need to see your definition of vLanguage also.
Probably your problem is with the variable.

And why do you have the '=' in your dollar expansion?

That indicates your variable holds an expression that should be evaluated before being copied into context.

0 Likes
204 Views
Not applicable

Hello

Set vLanguage= if(isNull(Language  ),'English',Language);

=Only({<Id={2}>} [$(vLanguage)]) Also Returns "-"

0 Likes
204 Views
anderseriksson
Contributor III

Can't spot the problem, run in as an expression in a table without a label and you will see the expanded expression in the column header. That might tell you the problem.

0 Likes
204 Views
rohitk1609
Valued Contributor II

Hi Charles,

Dynamic labeling is not present in Qlik Sense, How to create same solution in Qlik Sense then ?

204 Views
santiago_respane
Valued Contributor

Thanks for sharing!

Will try!

Regards,

0 Likes
204 Views
professionalser
New Contributor

Hi

Please, someone, find the solution or an example of how to create the same solution in Qlik Sense?

Thanks

Best regards

0 Likes
58 Views