This is a migrated thread and some comments may be shown as answers.
globalization with AngularJS
2 Answers 139 Views
This is a migrated thread and some comments may be shown as answers.
Konrad
Top achievements
Rank 1
Konrad asked on 15 Sep 2014, 04:01 PM
1. I configured filters for grid but after changing language there are not translated. How to use messages from kendo.messages.xx-XX.min.js files in such setup:
filterable :{
            extra: false,
            operators: {
                string: {
                    contains: 'Contains',
                    eq: 'Is equal',
                    neq: 'Is not equal'
                },
                date: {
                    lte: 'To',
                    gte: 'From'
                },
                number: {
                    eq: 'Is equal',
                    neq: 'Is not equal',
                    gt: 'Greater then',
                    gte: 'Greater then or equal',
                    lt: 'Less then',
                    lte: 'Less then or equal'
                }
            }
        },

2. I use $translateProvider in AngularJS for translations and tried to setup in config also kendo.culture("en-GB"); but it doesn't work. How to setup translations for AngularJS with ability to change dynamically to be consistent with $translate service if needed 

2 Answers, 1 is accepted

Sort by
0
Konrad
Top achievements
Rank 1
answered on 15 Sep 2014, 04:27 PM
Mentioned in 1 setup is done in factory method of the service
return {
filterable :{
0
Alexander Valchev
Telerik team
answered on 17 Sep 2014, 02:28 PM
Hello Konrad,

Regarding your questions:

1. Whatever is put in the filterable configuration object will override the kendo.messages.xx-XX.js configuration. In other words if you would like to customize the operators through the filterable configuration object you will have to also handle the translations.

2. Kendo culture can be changed at runtime through the culture method. It is important to note that the corresponding culture files should be loaded before kendo.culture is executed. The messages files work in a different way - they modify the default values of the messages in the widget's prototype object. This is why in order to change the widget messages you should at first load the file and then re-create the widget. We prepared a code library project which demonstrates how this can be done.

Regards,
Alexander Valchev
Telerik
 
Join us on our journey to create the world's most complete HTML 5 UI Framework - download Kendo UI now!
 
Asked by
Konrad
Top achievements
Rank 1
Answers by
Konrad
Top achievements
Rank 1
Alexander Valchev
Telerik team
Share this question
or