Formbuilder labels multilingual MLE

This is a FORK of the CMS Made Simple project and is not oficially supported in any way by the CMS Made Simple development team.
Locked
User avatar
zbibas
Forum Members
Forum Members
Posts: 10
Joined: Fri Feb 26, 2010 5:30 pm
Location: Geneva

Formbuilder labels multilingual MLE

Post by zbibas »

Issue:
one form, 3 languages.
As I am using Formbrowser to display data from the form and I can't fnd a way to change the labels depending on the language,
I have to use individual formbrowsers for each language.

Please help on finding a solution to :

display labels of forms according to language (one form,many languages)
AND / OR
consolidate different forms (formbuilder forms) in one formbrowser

Thanks,

Zack
User avatar
zbibas
Forum Members
Forum Members
Posts: 10
Joined: Fri Feb 26, 2010 5:30 pm
Location: Geneva

Re: Formbuilder labels multilingual MLE

Post by zbibas »

Tryed this (previous post)

http://forum.cmsmadesimple.org/index.php/topic,22733.0.html

Get errors...
sleiron
Forum Members
Forum Members
Posts: 11
Joined: Tue Feb 26, 2008 1:36 pm
Location: Zurich, Switzerland

Re: Formbuilder labels multilingual MLE

Post by sleiron »

zbibas wrote: Tryed this (previous post)

http://forum.cmsmadesimple.org/index.php/topic,22733.0.html

Get errors...

Hi Zack,

if you post your errors we could try to understand and eventually help you.

cheers
sleiron
Peciura

Re: Formbuilder labels multilingual MLE

Post by Peciura »

I know 2 ways to build multilingual like forms:
1. Create as many forms as languages you have
   a. create and tune a form.
   b. export it to XML document; Import it under different alias than original one
   c. rename labels for different language
   d. name forms like "my_form_en_US", "my_form_lt_LT" and so on.
   e. place form builder tag like

Code: Select all

{cms_module module='FormBuilder' form="my_form_$lang" lang=$lang}


2. To create one form combined to "Translation Manager"   
   a. create and tune a form.
   b. rename all fields to use English letters only, lets call them "keys"; Also it is good idea to use "_" instead spaces.
   c. create translations for each key in "Translation manager"
   d. in Form builder template replace label call "{$entry->name}" with

Code: Select all

{tr_key key=$entry->name lang=$lang}
   e. similar thing has to be done to all text that is not translated by "FormBuilder" module

If you don't want to use "Translation Manager" you can extend language files of "FormBuilder" with the same keys and place lang files to "/module_custom/FormBuilder/lang/"
Call translations of "FormBuilder" like this:

Code: Select all

{* DEFAULT FORM LAYOUT / pure CSS *}
{assign var='temp_translation' value=`$gCms->modules.FormBuilder.object`}

...

{$temp_translation->Lang($entry->name)}
Similar thing can be done to  FormBrowser

Code: Select all

{assign var='temp' value="`$sortingnames[$smarty.section.namelist.index]`"}
{tr_key key=$temp lang=$lang}
or

Code: Select all

{assign var='temp_translation' value=`$gCms->modules.FormBuilder.object`}
...
{section name=namelist start=0 loop=$count}  {*table header*}
{assign var='temp' value="`$sortingnames[$smarty.section.namelist.index]`"}
   <th>{$temp_translation->Lang($temp)}</th>
{/section}
Locked

Return to “[locked] CMSMS MLE fork”