-
Notifications
You must be signed in to change notification settings - Fork 390
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: add new package with vue extractor
- Loading branch information
Christoffer Jahren
committed
Apr 3, 2023
1 parent
bdbd6cf
commit 8a8f3d5
Showing
19 changed files
with
2,807 additions
and
14 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -2,6 +2,7 @@ node_modules/ | |
.yalc/ | ||
yalc.lock | ||
dist | ||
build | ||
|
||
npm-debug.log | ||
yarn-error.log | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Vue extractor | ||
|
||
This package contains a set of custom extractors that handles Vue files. It supports extracting messages from script and setup scripts as well as limited support for extracting messages from templates. | ||
|
||
## Installation | ||
|
||
```sh | ||
npm install @lingui/extractor-vue | ||
``` | ||
|
||
## Usage | ||
|
||
This custom extractor requires that you use typescript for your lingui configuration. | ||
|
||
```ts | ||
import { vueExtractors } from "@lingui/extractor-vue" | ||
import babel from "@lingui/cli/api/extractors/babel" | ||
|
||
const linguiConfig = { | ||
locales: ["en", "nb"], | ||
sourceLocale: "en", | ||
catalogs: [ | ||
{ | ||
path: "<rootDir>/src/{locale}", | ||
include: ["<rootDir>/src"], | ||
}, | ||
], | ||
extractors: [babel, ...vueExtractors], | ||
} | ||
export default linguiConfig | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"name": "@lingui/extractor-vue", | ||
"version": "4.0.0-next.5", | ||
"description": "Custom vue extractor to be used with CLI tool", | ||
"main": "./dist/index.cjs", | ||
"module": "./dist/index.mjs", | ||
"types": "./dist/index.d.ts", | ||
"keywords": [ | ||
"cli", | ||
"i18n", | ||
"internationalization", | ||
"i10n", | ||
"localization", | ||
"i9n", | ||
"translation" | ||
], | ||
"repository": "lingui/js-lingui", | ||
"bugs": "https://github.com/lingui/js-lingui/issues", | ||
"license": "MIT", | ||
"author": { | ||
"name": "Christoffer Jahren", | ||
"email": "christoffer@jahren.it" | ||
}, | ||
"scripts": { | ||
"build": "rimraf ./dist && unbuild", | ||
"stub": "unbuild --stub" | ||
}, | ||
"engines": { | ||
"node": ">=16.0.0" | ||
}, | ||
"dependencies": { | ||
"@lingui/cli": "^4.0.0-next.5", | ||
"@lingui/conf": "^4.0.0-next.5", | ||
"@vue/compiler-sfc": "^3.2.47" | ||
}, | ||
"devDependencies": { | ||
"@lingui/babel-plugin-extract-messages": "^4.0.0-next.5", | ||
"@vue/compiler-core": "^3.2.47", | ||
"unbuild": "^1.1.2", | ||
"vue": "^3.2.47" | ||
}, | ||
"gitHead": "f2961fcb319265b08ddeda3aa2549d104fc4c6d4" | ||
} |
Oops, something went wrong.