angular-ui / ui-grid

UI Grid: an Angular Data Grid
http://ui-grid.info
MIT License
5.39k stars 2.47k forks source link

i18n set language get error in console #6767

Open wuzhenda opened 6 years ago

wuzhenda commented 6 years ago

I set language to "zh-CN" ,It works ,but I always get error info in console logs which means I have set language to "zh-cn en",but I am not set any English.

angular.js:12520 Error: [$parse:syntax] Syntax Error: Token 'en' is an unexpected token at column 7 of the expression [zh-CN en] starting at [en]. http://errors.angularjs.org/1.4.8/$parse/syntax?p0=en&p1=is%20an%20unexpected%20token&p2=7&p3=zh-CN%20en&p4=en at https://code.angularjs.org/1.4.8/angular.js:68:12

here is the code: http://plnkr.co/edit/Au620ZzTQzHVvasNZHR9?p=preview

mportuga commented 6 years ago

Moving the ui-i18n up one div solves the issue. See my PR bellow: http://plnkr.co/edit/chetTiutSvu88SJwNnI5?p=preview

However, the reason why you are experiencing this problem is because the grid is currently set up in a way that it sets its own ui-i18n usage, which conflict with yours and we need to resolve it. https://github.com/angular-ui/ui-grid/blob/master/src/templates/ui-grid/ui-grid.html#L1