i18n config has no effect
In ui-grid adding i18n: 'fa' has no effect and all strings remain in english. Also all languages configuration are merged in ui-grid.js file. Do you plan to separate them in future?
We have plans to separate the ui-grid.js file in future into sub files. No doubt this would be one of the candidates for splitting out.
The i18n appears to work on the tutorial: http://ui-grid.info/docs/#/tutorial/104_i18n. It does not, however, work dynamically. Are you trying to change the language dynamically?
@PaulL1 Thanks for the response. No, I set the language on gridOptions by adding i18n: 'fa'. also I added ui-i18n="fa" attribute to grid container without success. What is the minimum config to change the grid language?
Is there any reason that you merged all code in a single file? Separating them does not seem require much effort.
I didn't create the build structure. It's probably one of many things that doesn't require much effort but still doesn't get done when we have only 3 part-time devs.
The tutorial appears to set language by setting a variable on $scope, and then setting that using ui-i18n={{lang}} on a parent div of the grid. I presume that's the minimum. You could try starting with the tutorial and removing things until it stops working.
Thanks again for all of your efforts. Your widget is luxurious. I hope I can contribute to the project as soon as I get familiar with the source code.
In the configure options, i thought we are suppose to set the optoin under gridOptions? I had them set to something like this, but it has no effect.
This is a dump from chrome's developer tool of what I pass to ui-grid as options: enableColumnMenus: false enableFiltering: true enablePagination: true enablePaginationControls: true enableSorting: false i18n: "fr" minWidth: 0 paginationCurrentPage: 1 paginationPageSize: 15 paginationPageSizes: Array[3] rowHeight: 30
It seems the i18n (according to the wiki: https://github.com/angular-ui/ng-grid/wiki/Configuration-Options) has no effect on the languages on the Pagination?
Are you reading the 2.x wiki but using 3.x ui-grid?
I think you need to set i18n in accordance with the tutorial: http://ui-grid.info/docs/#/tutorial/104_i18n
I think the original issue here is resolved, closing.
No it doesn't. http://plnkr.co/edit/KlK3JcxiQBUmtX3VaHnW?p=preview
Pagination never get translated. "items per page" "1 - 25 of 100 items"
I believe those captions are hardcoded?
The original issue was from @salarmehr, and I believe that is resolved. There is already an issue open for the fact that pagination is not fully translated #3430.
You can see in the source code the line where the translation is done: https://github.com/angular-ui/ng-grid/blob/master/src/features/pagination/js/pagination.js, lines 344 and 345. You're welcome to submit a pull request to add the extra translations if you wish.
any update?
It seems the ui-i18n is extra and it doesn't need to be there at ui-grid/ui-grid template(Version 4.0.2). Removing ui-i18n="en" worked.
My specific problem is date formatting - if I use a cellFilter: 'date' it is hard-coding the format to en-US.
The github source example at http://ui-grid.info/docs/#/tutorial/104_i18n (I'm using 4.06 of ui-grid) doesn't work for me - nothing gets translated in the grid (the only thing that does is the text under 'Using attribute'.
It does seem to hard-code 'ui-i18n="en"' as above and alireza-mokhtari's solution of removing it from ui-grid.js didn't help unfortunately. I've also tried adding in 'ui-i18n=fr' into the ui-grid div itself and no dice.