version: v16.0.0
The lib support the template with params, like This is a {{param1}}, and the {{param1}} with be replaced as param value.
Now it is handled by RegExp, it is ok now, but it's a bit complicated. I think we can simplify the process, using a third-party lib to do it.
The lodash you know is a powful third-party lib, and provide template() to handle template string. I think we can try to use it to help us to handle the translated string, we only need to provide the translated string and params value. It can make the process be more simple.
Of course, it's not always the best way, so try it and discuss it
version:
v16.0.0
The lib support the template with params, likeThis is a {{param1}}
, and the{{param1}}
with be replaced as param value.Now it is handled by RegExp, it is ok now, but it's a bit complicated. I think we can simplify the process, using a third-party lib to do it.
The lodash you know is a powful third-party lib, and provide
template()
to handle template string. I think we can try to use it to help us to handle the translated string, we only need to provide the translated string and params value. It can make the process be more simple.Of course, it's not always the best way, so try it and discuss it