ui-grid icon indicating copy to clipboard operation
ui-grid copied to clipboard

using i18n in ES with pagination.

Open facuxt opened this issue 11 years ago • 1 comments

Hello everyone.. im using ui.grid with i18n, im currently using 3.0.5 (recently updated). Im using language in 'es' this is the html code

<div ui-i18n="{{lang}}">
      <div ui-grid="gridOptionsSimple" ui-grid-pagination></div>
 </div>

in the controller i set...

$scope.lang = 'es';

then... in ui-grid.js i added this code in line 21210

console.log(i18nService.getCurrentLang());

then in console i see...

"en"

what is happening here?

I was inspecting the code and all seems to be ok... the translations are in the file as follows...

...
        pagination: {
          sizes: 'registros por página',
          totalItems: 'registros',
          of: 'de'
        },
...

then the template is set like this

    <div class="ui-grid-pager-count-container">
        <div class="ui-grid-pager-count"><span ng-show="grid.options.totalItems > 0">{{showingLow}} <abbr ui-grid-one-bind-title="paginationThrough">-</abbr> {{showingHigh}} {{paginationOf}} {{grid.options.totalItems}} {{totalItemsLabel}}</span>
        </div>
    </div>

Those vars (paginationOf, totalItemsLabel, etc.. are being setted like this), you will see where i placed the console.log...

...
          $scope.paginationApi = uiGridCtrl.grid.api.pagination;
          $scope.sizesLabel = i18nService.getSafeText('pagination.sizes');
          $scope.totalItemsLabel = i18nService.getSafeText('pagination.totalItems');
          console.log(i18nService.getCurrentLang());
          $scope.paginationOf = i18nService.getSafeText('pagination.of');
          $scope.paginationThrough = i18nService.getSafeText('pagination.through');
...

p.s: i attack a screenshot to prove that the i18n is working at least partially. uigrid

p.s2: I can avoid this issue just putting this in my controller i18nService.setCurrentLang('es');

but i dont know if that is the expected behavior... Feel free to ignore this issue if that's the case

facuxt avatar Aug 31 '15 18:08 facuxt

I faced a such behavior too, also after minification all translated text has gone and I can watch only [MISSING] text instead of orinal

pavlalexandr avatar Sep 04 '15 21:09 pavlalexandr