vue-i18n-extract
vue-i18n-extract copied to clipboard
Add support for Pug templates
Acceptance Criteria
- [ ] Pug component templates must be supported
- [ ] cover new cases with unit test
Info
Consider this solution provided by @gilles-crealp:
function extractComponentMatches(file: SimpleFile): I18NItem[] {
const componentHtmlRegExp = /(?:<i18n)(?:.|\n)*?(?:[^:]path=("|'))(.*?)\1/gi;
const componentPugRegExp = /i18n\((?:.|\n)*?(?<!:)path=("|')(.*?)\1/gi;
return [
...getMatches(file, componentHtmlRegExp, 2),
...getMatches(file, componentPugRegExp, 2)
]
}
@gilles-crealp I would be open to a PR for this.
As I wrote in #101, I'm not sure how to implement the unit test.
No problem, I unfortunately don't code in pug and therefore don't know the syntax I would be looking out for so I'll leave this to someone who perhaps knows how to write pug.
@Spittal @pixari Guys, are you going to maintain this package? I found it a very good tool and we use it in our project. There are a lot of features could be added.
Though I see that there are some ready to merge PRs which are pending for quite a long time and new issues are not tracked/reviewed for months. If you are willing to work on the new version, I could write some feature requests in Issues and try to create PRs to resolve some existing. Just let me know if you can review/approve the code and move it forward. Thank you!
P.S. And I used this issue to ping you coz we're using pug and it's support would be awesome and I could try to implement it.