8000 Feature request: t-helper for vue-intl · Issue #3444 · formatjs/formatjs · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Feature request: t-helper for vue-intl #3444
Open
@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

      0