EasyUI Forum
May 17, 2024, 07:30:30 AM *
Welcome, Guest. Please login or register.

Login with username, password and session length
News:
 
   Home   Help Search Login Register  
Pages: [1]
  Print  
Author Topic: Locale and translation for EasyUI  (Read 9944 times)
Daretzki
Newbie
*
Posts: 4


View Profile
« 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.
Logged
stworthy
Administrator
Hero Member
*****
Posts: 3581


View Profile Email
« Reply #1 on: December 27, 2013, 06:26:46 PM »

Please refer to the usage of easyui locale files.
Logged
Daretzki
Newbie
*
Posts: 4


View Profile
« Reply #2 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
Logged
ftmh
Newbie
*
Posts: 19


View Profile
« Reply #3 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  Sad
Logged
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.18 | SMF © 2013, Simple Machines Valid XHTML 1.0! Valid CSS!