File tree Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Expand file tree Collapse file tree 2 files changed +42
-0
lines changed Original file line number Diff line number Diff line change 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
Original file line number Diff line number Diff line change 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"
You can’t perform that action at this time.
0 commit comments