K2 Smartforms in multi languages

  • 26 March 2014
  • 5 replies
  • 48 views

Badge +3

Hi,


 


I am working on K2 smartforms and my requirement is design smartform in multilanguages. Spanish, French and English.


 


Do I need to install anything special to design smartform in multi languages?


 


Please watch this video for reference:


 


http://www.youtube.com/watch?v=hBEcuKhTOMc


 


ANy help would be appreciated.


 


Thanks.


5 replies

Badge +5

Hi


 


You can install smartforms server on international system (some languages are tested but not all of them, I know that French and German at least are tested). And I think you can see that on the compatibility matrix. Then your forms can be in any languages you want (be careful for languages where you need to write from top to botton or right to left, I have no experience for that).


 


Please go to the site below to see the K2 smartforms Compatibility Matrix. 


 


 


http://help.k2.com/smartforms/support-matrix 


 


Kind Regards


Julia


 

Userlevel 4
Badge +13

Hi AA7584


 


I have done a bit of research on this in regards with your question. (Refering to the Video you attached) I found that in order to create a custom control that would allow you to change the language as explained in the video, the probability of having to use code is very big.


 


Please have a look at these links regarding how to create a custom control:


Create Custom Control Project


Add Custom Control Field


 


As for the resource file please have a look at this link regarding how to add and use resource files:


Adding/Using Resource File


 


You can also have a look at this Community Post where you can download Miltilingual Control.


Multilingual Contol Download


(Please Note: K2 does not support Miltilingual Contol)

Userlevel 4
Badge +13

Hi AA7584


 


Please confirm if the documents/links i attached to my last post was able to answer the question you had in regards with "Multilanguage Custom Control"


 


Thank You in advances.

Badge +3

I did not test yet the multilanguage support that I think is new in 4.6.9.

Until now, I am using the localization control (aka set language).

 

It mostly does the trick but unfortunately does not translate 100%.

It works based on a resource file (XML) and replace the strings on screen by their equivalent in the resource file.

In the resource file, you can put all the languages you need.

Once entry looks like:

<?xml version="1.0" encoding="UTF-8"?>
<DocumentElement>
<Languages>
<Label>Invoice</Label>

<en>Invoice</en>

<de>Rechnung</de>

<fr>Facture</fr>

</Languages>

</DocumentElement>

 

I just tested, you can also use several instances of the set language control.

That means you can have one for your main localization. Then if you bring a view specific to a customer, instead of changing your main resource file, you can add a set language control just for that view. It will have its own resource file. Even if in a view, the setlanguage control can localize controls outside this view.

 

I am not 100% what happens in case of conflicts (ie you say that ABC translates into XXX in one resource file and YYY in another).

 

Unfortunately, things like 'Page' if you use a listview and enable paging, do not get localized.

 

You can of course go further and do more localization using pure javascript. In that case, I recommend using a literal control that contains a very little piece of JS code to inject your real script.

I usually do that using an expression that contains: ({Browser Culture} being a K2 field):

<script>window.locale='{Browser Culture}';$.getScript("../../script.js").done(function( script, textStatus ) { console.log( 'script loaded successfully' ); }).fail(function( jqxhr, settings, exception ) { console.log( 'issue loading script' ); console.log(exception); });</script>

 

Then inside script.js, you can use jquery to grab your elements and change the text. I recommend l10ns if you search for proper localization where 1 bottle translates  into "1 bouteille" for exampel but 10 bottleS into "10 bouteilleS" (notice the change in localization due to the purial).

Badge +3

After testing the new language pack, I can say this is definitely cool and pushes the amount of localized strings forward but it will still not cover everything.

Some strings will remain untranslated such as the list of the fields of a smo displayed in the filters of a listview as well as the content of list views.

 

I think you can summarize localization as such, in order or difficulty/coverage:

1- language pack (super easy to install, good way to start)

2- localization control (see video above)

3- Javascript localization using l10ns or other 'manual' solutions such as jquery

 

Reply