Skip to content

Feature request: t-helper for vue-intl #3444

@fkm

Description

@fkm

It would be nice to have a t-helper function for code like this:
😍 $t('one') $t('two', { foo: 'bar' }) instead of:
😢 $formatMessage({ id: 'one' }) $formatMessage({ id: 'two' }, { foo: 'bar' })

Something like this seems to be enough:
app.config.globalProperties.$t = (id, values) => intl.formatMessage({ id }, values);

This would be in line with Ember's implementation.
https://ember-intl.github.io/ember-intl/docs/helpers/t

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions