globalize
globalize copied to clipboard
Custom separator for `formatMessage`
Globalize.loadMessages({
pt: {
greetings: {
hello: "Olá",
bye: "Tchau"
}
}
});
Globalize( "pt" ).formatMessage( "greetings/hello" );
This works great, but I want to use dot (.
) instead if /
as path navigation separator. How can I set custom separator symbol?
I know, that I can do something like
Globalize.loadMessages({
pt: {
"greetings.hello": "Olá",
"greetings.bye": "Tchau"
}
});
But it's not good solution.
How can I set custom separator symbol?
Existing API provides no support for customizing the path separator. I encourage you to elaborate a suggestion (in terms of API first)... Technically, cldrjs would need to be updated as well, specifically https://github.com/rxaviers/cldrjs/blob/master/src/path/normalize.js#L24