-
Is it possible to use formatter functions provided by FormatJS in v-bind directives? I'm trying to do something like this: <button
:title="$formatMessage({ defaultMessage: 'Do something. This will imply foo and bar.' })"
>
{{ $formatMessage({ defaultMessage: 'Something' }) }}
</button> The second message gets formatted as expected and is picked up by the CLI when extracting messages. For the first one, formatting works fine but the extracting process doesn't (the message just isn't found). I am calling import { extract } from '@formatjs/cli';
import glob from 'fast-glob';
const extractionResults = await extract(
[...glob.sync(path.join(baseDirectory, 'src', '**', '*.vue'))],
{
idInterpolationPattern: '[sha512:contenthash:base64:6]',
}
); Am I missing something here or does the CLI simply not support finding these calls? I have tried both the dollar-prefixed |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 4 replies
-
If it helps: the babel plugin does seem to see these (The debugger is halted at the error |
Beta Was this translation helpful? Give feedback.
If it helps: the babel plugin does seem to see these
$formatMessage
calls, because an ID gets set and the message AST is compiled:(The debugger is halted at the error
formatMessage
throws when the message is missing)