You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I want to use the square brackets for parameters in translation strings, for example, 'This is my [project]'.
And for that aim I add the {identifier: ['[',']']} as the config parameter for initialize vuex-i18n. But unfortunately when I try to get a translation by this.$i18n.translate('mykey', {'project': 'test' }) , I get 'This is my [project]' instead 'This is my test'.
But when I replace the square brackets to braces (e.g. 'This is my {project}') then all works as expected.
P.S. When I use the square brackets(!) then the this.$i18n.translate('mykey', {'project': 'test' }) stops to work for strings used the braces 'This is my {project}', i.e. the identifier was changed for another symbol.
The text was updated successfully, but these errors were encountered:
As I understood, for using the the square brackets in regular expressions, it's needed to use follow identifier: ["\\[","\\]"].
But then this line works wrong: var key = placeholder.replace(identifiers[0], '').replace(identifiers[1], '');
because translate string contains the single brackets, but identifier[0] is '[' and identifier[1] is ']'.
I want to use the square brackets for parameters in translation strings, for example, 'This is my [project]'.
And for that aim I add the
{identifier: ['[',']']}
as the config parameter for initialize vuex-i18n. But unfortunately when I try to get a translation bythis.$i18n.translate('mykey', {'project': 'test' })
, I get 'This is my [project]' instead 'This is my test'.But when I replace the square brackets to braces (e.g. 'This is my {project}') then all works as expected.
P.S. When I use the square brackets(!) then the
this.$i18n.translate('mykey', {'project': 'test' })
stops to work for strings used the braces 'This is my {project}', i.e. the identifier was changed for another symbol.The text was updated successfully, but these errors were encountered: