Skip to content

Commit 3565747

Browse files
committed
Update README.md
1 parent 0661a3c commit 3565747

File tree

2 files changed

+42
-0
lines changed

2 files changed

+42
-0
lines changed

README.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,44 @@
1414
<img src="https://img.shields.io/github/license/fluent-vue/unplugin-fluent-vue" alt="GitHub license">
1515
</a>
1616
</p>
17+
18+
[fluent-vue](https://github.com/fluent-vue/fluent-vue) plugin for Vite, Webpack and Rollup (thanks to [unplugin](https://github.com/unjs/unplugin)).
19+
20+
It adds support for defining Fluent messages in Vue SFCs and external files.
21+
22+
## Installation
23+
24+
```bash
25+
npm install unplugin-fluent-vue --save-dev
26+
```
27+
28+
## Usage
29+
30+
### Vite
31+
32+
```ts
33+
// vite.config.js
34+
import { defineConfig } from 'vite'
35+
import {
36+
SFCFluentPlugin,
37+
ExternalFluentPlugin,
38+
} from 'unplugin-fluent-vue/vite'
39+
40+
export default defineConfig({
41+
plugins: [
42+
// Choose one of the following:
43+
SFCFluentPlugin({ // define messages in SFCs
44+
blockType: 'fluent', // default 'fluent' - name of the block in SFCs
45+
checkSyntax: true, // default true - whether to check syntax of the messages
46+
}),
47+
ExternalFluentPlugin({ // define messages in external ftl files
48+
baseDir: path.resolve('src'), // required - base directory for Vue files
49+
ftlDir: path.resolve('src/locales'), // required - directory with ftl files
50+
locales: ['en', 'da'], // required - list of locales
51+
checkSyntax: true, // default true - whether to check syntax of the messages
52+
}),
53+
],
54+
})
55+
```
56+
57+
Docs: https://fluent-vue.demivan.me/integrations/unplugin.html

package.json

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
"url": "https://demivan.me"
99
},
1010
"license": "MIT",
11+
"homepage": "https://fluent-vue.demivan.me/integrations/unplugin.html",
1112
"repository": {
1213
"type": "git",
1314
"url": "git+https://github.com/fluent-vue/unplugin-fluent-vue.git"

0 commit comments

Comments
 (0)