EasyUI Forum

General Category => EasyUI for jQuery => Topic started by: Daretzki on December 27, 2013, 05:57:04 AM



Title: Locale and translation for EasyUI
Post by: Daretzki on December 27, 2013, 05:57:04 AM
Hello Colleagues,

What is the easy way to translate EasyUI message, column names etc in wjole project? I would like to create simple combo like for theme changing, with languages and set default lang.

Thank you for the answers.


Title: Re: Locale and translation for EasyUI
Post by: stworthy on December 27, 2013, 06:26:46 PM
Please refer to the usage of easyui locale files.


Title: Re: Locale and translation for EasyUI
Post by: Daretzki on December 28, 2013, 07:03:44 AM
Hi,

Thanks for answer.
Short FAQ how i used it:


1. Set locales in <head> with additional id="script-lang"

Code:
<head>
...
  <script id="script-lang" type="text/javascript" src="lib/jqueryui/lang/easyui-lang-pl.js"></script>
...
</head>


2. Created <select> with lang like this:

Code:
 
         Lang: <select id="combo-lang" class="easyui-combobox"
            data-options="
                onSelect: function(id) {
                    lang = id.value;
                    var link = $('head').find('#script-lang');
                    link.attr('src', 'lib/jqueryui/locale/easyui-lang-'+lang+'.js');
                    /* just for debug */
                    $.messager.show({
                        title:'Locale',
                        msg:'link to locale: '+link.attr('src'),
                        showType:'slide'
                    });
                },
                ediable: false
            ">
            <option value="pl" selected>Polski</option>
            <option value="de">Deutch</option>
            <option value="en">English</option>
            <option value="es">Espaniole</option>
            <option value="fr">Francais</option>
         </select>



3. cp all locale files to path lib/jqueryui/locale/

I hope that example will be useful.

Darek


Title: Re: Locale and translation for EasyUI
Post by: ftmh on January 31, 2014, 10:28:00 PM
hi i have this problem like that, i can't change languages,there is any API that control and services this problem? thanks  :(