Currently it is difficult to translate data with additional arguments coming from server.
If translation key isn't static but comes dynamic for example from server we need use some workarounds:
It doesn't work because localize() method does not support array value as argument
We can call this.localize() in response handler but sometimes it work only with setTimeout()
Description
Currently it is difficult to translate data with additional arguments coming from server. If translation key isn't static but comes dynamic for example from server we need use some workarounds:
in our
locales.json
we have:logic:
view
It doesn't work because
localize()
method does not support array value as argument We can callthis.localize()
in response handler but sometimes it work only withsetTimeout()
this workaround works, but it is ugly.
render
Expected outcome
view template
should render DOM:
Actual outcome
localize()
method returnundefined
when we passarray
value as argumentPull Request
PR https://github.com/PolymerElements/app-localize-behavior/pull/140