Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
fkm opened this issue Feb 27, 2022 · 4 comments
Open

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

fkm opened this issue Feb 27, 2022 · 4 comments
Labels

Comments

@fkm
Copy link

fkm commented Feb 27, 2022

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

@glen-84
Copy link
Contributor

glen-84 commented Mar 13, 2022

See also #2476.

@longlho
Copy link
Member

longlho commented Mar 14, 2022

I'm kinda coming around to this but will have to find time to implement it

@github-actions
Copy link

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@github-actions github-actions bot added the Stale label Mar 29, 2022
@glen-84
Copy link
Contributor

glen-84 commented Mar 29, 2022

Not stale.

@longlho longlho added pinned and removed Stale labels Mar 29, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants