Messages in native <template> tags do not get extracted
tcitworld opened this issue · 4 comments
tcitworld commented
Versions:
- vue 3.2.31
- vue3-gettext 2.2.0-alpha.1
- gettext-extractor 3.5.4
The messages are not extracted in this configuration
<template>
<router-link>
<template v-if="mode === 'list'">{{ $gettext('Map') }}</template>
<template v-else>{{ $gettext('List') }}</template>
</router-link>
</template>
But this one works
<template>
<router-link>
<span v-if="mode === 'list'">{{ $gettext('Map') }}</span>
<span v-else>{{ $gettext('List') }}</span>
</router-link>
</template>
Possibly a limitation with Gettext Extractor itself, didn't check yet.
lzurbriggen commented
Yes, this seems to be a gettext-extractor
issue that has to be fixed upstream. It's a bit weird that <template>{{ $gettext("TRANSLATETHIS2") }}</template>
works but <template><template>{{ $gettext("TRANSLATETHIS2") }}</template></template>
does not.
fjeddy commented
Same with composition API and setup, can't get anything to extract within it.
<script setup>
import { $gettext } from 'wherever'
$gettext('hello')
</script>
lzurbriggen commented
lzurbriggen commented
@tcitworld I managed to fix this, released in 2.2.2.