Thanks to visit codestin.com
Credit goes to github.com

Skip to content
Elias Chaaya edited this page May 27, 2016 · 1 revision

These languages are supported out of the box in angular-dashboard-framework.

Language ISO Code Default
English en-GB Yes
Swedish sv-SE No

You can change the locale via the dashboardProvider in the config phase.

angular
    .module('adfWidgetSample', ['adf'])
    .config(function(dashboardProvider){
       dashboardProvider.setLocale('sv-SE');
    }

... or in your controller like this.

angular
      .module('adfWidgetSample')
      .controller('SampleController', SampleController);

  SampleController.$inject = [
      '$rootScope',
      'dashboard'
  ];
  /* @ngInject */
  function SampleController($rootScope, dashboard) {
    $rootScope.$on('languageChange', function(cultureCode)) {
      dashboard.setLocale(cultureCode);  
    });
  }

Add non existent language

Need support for another language? No problems! You can also add your own locale to the framework.

angular
    .module('adfWidgetSample', ['adf'])
    .config(function(dashboardProvider){
       dashboardProvider.addLocale('de-DE',
         {
           ADF_COMMON_CLOSE: 'Schließen',
           ADF_COMMON_DELETE: 'Löschen'
           ...
         }
       );
    }

Translation table

{
  ADF_COMMON_CLOSE: 'Close',
  ADF_COMMON_DELETE: 'Delete',
  ADF_COMMON_TITLE: 'Title',
  ADF_COMMON_CANCEL: 'Cancel',
  ADF_COMMON_APPLY: 'Apply',
  ADF_COMMON_EDIT_DASHBOARD: 'Edit dashboard',
  ADF_EDIT_DASHBOARD_STRUCTURE_LABEL: 'Structure',
  ADF_DASHBOARD_TITLE_TOOLTIP_ADD: 'Add new widget',
  ADF_DASHBOARD_TITLE_TOOLTIP_SAVE: 'Save changes',
  ADF_DASHBOARD_TITLE_TOOLTIP_EDIT_MODE: 'Enable edit mode',
  ADF_DASHBOARD_TITLE_TOOLTIP_UNDO: 'Undo changes',
  ADF_WIDGET_ADD_HEADER: 'Add new widget',
  ADF_WIDGET_DELETE_CONFIRM_MESSAGE: 'Are you sure you want to delete this widget ?',
  ADF_WIDGET_TOOLTIP_REFRESH: 'Reload Widget Content',
  ADF_WIDGET_TOOLTIP_MOVE: 'Change widget location',
  ADF_WIDGET_TOOLTIP_COLLAPSE: 'Collapse widget',
  ADF_WIDGET_TOOLTIP_EXPAND: 'Expand widget',
  ADF_WIDGET_TOOLTIP_EDIT: 'Edit widget configuration',
  ADF_WIDGET_TOOLTIP_FULLSCREEN: 'Fullscreen widget',
  ADF_WIDGET_TOOLTIP_REMOVE: 'Remove widget'
}
Clone this wiki locally