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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[WIP] Version 3 / Vue3 Support #118

Closed
wants to merge 11 commits into from

Conversation

lzurbriggen
Copy link

I'm working on Vue3 support.

This is a work in progress and not ready to be merged yet. I'm making relatively drastic changes and I'd appreciate some feedback/discussion. If we disagree on the direction this is taking I could split this into a new package.

changes on the dev side

  • implementation in typescript
  • npm run dev now runs a Vue3 project using vite (no more webpack)
  • replaced karma/chai/sinon with jest tests
  • no more localVue; the plugin instance is passed around as a function argument

changes on user side

  • in composition api contexts the plugin can be injected using the new useGettext() function, e.g. useGettext().current = 'en_US'
  • no more configuration via Vue.config. Vue3 has app.config but I'm not sure if it's best practice to populate that object. For now the config can be accessed via $language.options
  • removed autoAddKeyAttributes, likely unnecessary
  • mixins can now be reactive, e.g:
mixins: {
    currentWithoutRegion: (lang) => computed(() => lang.current.toLowerCase().split("_")[0]),
}

todo

  • figure out how to handle configuration
  • update @vue/test-utils when it has released a new version including my changes to the plugin api (should fix most tests)
  • types for global properties
  • check if the built packages work in esm/commonjs contexts
  • host new live demo
  • update readmes/documentation
  • clean up dependencies
  • make sure extraction still works properly (please also take a look at my pull requests in easygettext)
  • code cleanup
  • more explicit typing

@kemar
Copy link
Contributor

kemar commented Aug 23, 2020

Hi @lzurbriggen,

Sorry for the delay…

Thank you for your PR, but you probably should split this into a new package.

I don't have time anymore to contribute to vue-gettext. In fact I haven't worked with Vue.js in over three years. I'm barely merging PR and keeping deps up to date.

@lzurbriggen
Copy link
Author

@kemar No problem, I'll probably do that soon. Thanks for the response!

@kemar kemar mentioned this pull request Mar 16, 2021
@exalate-issue-sync exalate-issue-sync bot mentioned this pull request Jun 15, 2021
3 tasks
@Knogobert
Copy link

Just to link it here, this is the repo in mention: https://github.com/jshmrtn/vue3-gettext

Thanks for your hard work!

@kemar
Copy link
Contributor

kemar commented Jun 17, 2021

@Knogobert thanx, I'll put a link in the README asap

@kemar
Copy link
Contributor

kemar commented Jun 17, 2021

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants