Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Array is not supported. #59

Closed
Wanderxx opened this issue Sep 27, 2016 · 1 comment
Closed

Array is not supported. #59

Wanderxx opened this issue Sep 27, 2016 · 1 comment

Comments

@Wanderxx
Copy link

When I work on a select component I want to $t return different array depends on the lang I set.
Like,

locales : {
  zh : {
    userTypes : ['普通用户', '管理员', '访客']
  },
  en : {
    userTypes : ['user', 'admin', 'visitor']
  }
}

Right now, it only returns string.

My work around is directly return the val when args is []
In translate function(),

return ( args && args != 0 )? format(val, args) : val
@callumacrae
Copy link

Please make sure that when this is implemented, you don't break new String('My string'): Check Array.isArray(), not typeof :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants