Telerik Product and Version
|
Kendo 2014.2.903 |
Supported Browsers and Platforms
|
All |
Components/Widgets used (JS frameworks, etc.)
|
AngularJS, angular-translate.
Kendo UI Grid, Calendar, DropDownList. |
PROJECT DESCRIPTION
The project demonstrates how change the kendo.culture and widget messages using angular-translate $languageProvider
change:
function
() {
/* The kendo.culture.xx-XX.js files can be pre-loaded in the <head> section of the document, but the kendo.messages.xx-XX.js file should be loaded on demand when the language is about to change */
/* We are using the jQuery.getScript method to load the messages file and use the callback function to change the kendo culture, kendo messages and angular-translate language */
/* $scope.$apply should be used in order to notify the $scope for language change */
$scope.$apply(
function
() {
$translate.use($scope.lang);
/* change angular-translate language */
kendo.culture($scope.lang);
/* change kendo culture */
/* we use dummy language option in order to force the Grid to rebind */
$scope.mainGridOptions.language = $scope.lang;
/* we change the calendar widget culture option in order to force the Calendar to rebind */
$scope.calendarOptions.culture = $scope.lang;
})
});