We have some missing strings and I found out that some vue structure leads to stop parsing after that.
We have this issue with a <select/> which has no closed </select>, but is closed in the open tag, but this seems to depend on the structure, because broke down to a simple test, this works.
Otherwise we have the same problem with an Textarea without a closing tag.
test.vue
<input :legend="_i('TRANSLATED')" />
<Textarea id="comment" name="comment" />
<input :legend="_i('NOT WORKING 2')" />
test-extract.mjs
import {GettextExtractor, HtmlExtractors, JsExtractors} from 'gettext-extractor'
const extractor = new GettextExtractor()
const jsParser = extractor.createJsParser([
JsExtractors.callExpression('_i', {
arguments: {
text: 0,
},
}),
]);
extractor.createHtmlParser([
HtmlExtractors.embeddedJs('*', jsParser),
HtmlExtractors.embeddedAttributeJs(/:[a-z]+/, jsParser),
])
jsParser.parseFile('./test.vue');
extractor.savePotFile('./test.pot')
extracting output
.pot file
msgid ""
msgstr ""
"Content-Type: text/plain; charset=UTF-8\n"
#: test.vue:1
msgid "TRANSLATED"
msgstr ""
We had such an issue two times, and everytime this is a big examination why there are single words are not translatable (which were sometimtes before) :(.
Any suggestions or idea for fixing this?
... or at least an error output that there is an syntax error and we have to look for missing strings.
best, Thorsten
We have some missing strings and I found out that some vue structure leads to stop parsing after that.
We have this issue with a
<select/>which has no closed</select>, but is closed in the open tag, but this seems to depend on the structure, because broke down to a simple test, this works.Otherwise we have the same problem with an Textarea without a closing tag.
test.vue
test-extract.mjs
extracting output
.pot file
We had such an issue two times, and everytime this is a big examination why there are single words are not translatable (which were sometimtes before) :(.
Any suggestions or idea for fixing this?
... or at least an error output that there is an syntax error and we have to look for missing strings.
best, Thorsten