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

Support nativescript-vue/multiple templates #80

Open
brunobg opened this issue Apr 16, 2020 · 4 comments
Open

Support nativescript-vue/multiple templates #80

brunobg opened this issue Apr 16, 2020 · 4 comments

Comments

@brunobg
Copy link
Contributor

brunobg commented Apr 16, 2020

Nativescript vue allow files with multiple templates to target native and web, like this one:

<template web>
  <div class="container">
      <translate>Translate this</translate>
  </div>
</template>
<template native>
  <Page class="page">
      <Label :text="'Translate that' | translate"></Label>
  </Page>
</template>

<script>
export default {
};
</script>

<style>
</style>

gettext-extract does not handle this properly, apparently only dealing with the second section. It'd be nice to support multiple template sections. Is this viable?

@vperron
Copy link
Contributor

vperron commented Apr 17, 2020

I don't know, you would be willing to contribute this feature ? :)

@brunobg
Copy link
Contributor Author

brunobg commented Apr 20, 2020 via email

@vperron
Copy link
Contributor

vperron commented Apr 20, 2020

Sure ! In this function we dissect the Vue file and then analyze separately the template and script parts: https://github.com/Polyconseil/easygettext/blob/master/src/extract.js#L61-L69

My first attempt would be to modify it (maybe by dissecting our vue preprocessor) to handle native templates as well.

@brunobg
Copy link
Contributor Author

brunobg commented Apr 20, 2020

Thanks, I'll send a PR soon.

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

No branches or pull requests

2 participants