Vue.js Extractor
The @lingui/extractor-vue
package provides a custom extractor that handles Vue.js files.
Installation
- npm
- Yarn
- pnpm
npm install --save-dev @lingui/extractor-vue
yarn add --dev @lingui/extractor-vue
pnpm add --save-dev @lingui/extractor-vue
Usage
It is required that you use JavaScript or TypeScript for your Lingui configuration.
lingui.config.{js,ts}
import { defineConfig } from "@lingui/cli";
import { vueExtractor } from "@lingui/extractor-vue";
import babel from "@lingui/cli/api/extractors/babel";
export default defineConfig({
locales: ["en", "nb"],
sourceLocale: "en",
catalogs: [
{
path: "<rootDir>/src/{locale}",
include: ["<rootDir>/src"],
},
],
extractors: [babel, vueExtractor],
});