globalizejs / globalizejs/globalize

Does Globalize.formatMessage() support passing a variable as path parameter?

Open
#707 2 comments 3 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
4.8k
Forks
585
PR merge metrics
No merged PRs in 30d

Description

The following code works well.
`const Globalize = require('globalize');
Globalize.formatMessage('my.path');`

But the following code did not work. That is to say Globalize.formatMessage() only access a string as parameter,if passing a variable as parameter, it doesn't work. I got error "ReferenceError: path is not defined"
Is it the design? if yes, how can I pass a variable to Globalize.formatMessage()?
`const Globalize = require('globalize');
const path = 'my.path';
Globalize.formatMessage(path);`

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.