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

Add Vue2 Support #105

Merged
merged 3 commits into from
Jan 12, 2022
Merged

Add Vue2 Support #105

merged 3 commits into from
Jan 12, 2022

Conversation

codegaze
Copy link
Member

  • Adds Vue 2 support as a plugin and in CLI (*.vue files) extraction.
    Supports <T>, <UT> components, $t template function and t for script functions. (check more on Readme please) and has a LanguageDropdown component like we do with other frameworks.
  • Refactors a bit the extract.js function.

@codegaze codegaze force-pushed the add-vuejs2 branch 2 times, most recently from aa4ec0c to e51d9e3 Compare January 11, 2022 13:02
n1k0sv
n1k0sv previously approved these changes Jan 11, 2022
Copy link

@n1k0sv n1k0sv left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work! 👏

In order to parse for phrases the Vue SFC we needed to create a new
extract function. This means that cli will also be parsing all the
`*.vue` files that will find.

`vue-template-compiler` was used to do this so we can extract the
different types of content from the Vue template `script` and
`template`.

For the `template` part we use `compile` to get the AST and we traverse
with a custom function and for the `script` we just send to babel.

During this implementation it seemed that a lot of code could be
extracted from `extract.js` and so a new `parsers` folder was created
with `angularHTML`, `vue` and `babel` files with all the functionality
that can be reused accross parsers if needed.
},
"peerDependencies": {
"@transifex/native": "^2.1.2",
"vue": "^2.6.11"
Copy link

@n1k0sv n1k0sv Jan 12, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe we should put ^2.0.0 for both native and vue?

@codegaze codegaze merged commit 437341e into master Jan 12, 2022
@codegaze codegaze deleted the add-vuejs2 branch January 12, 2022 07:46
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.

2 participants