Awesome Open Source
Awesome Open Source

unplugin-fluent-vue

GitHub Workflow Status codecov Standard - JavaScript Style Guide GitHub license

fluent-vue plugin for Vite, Webpack and Rollup (thanks to unplugin).

It adds support for defining Fluent messages in Vue SFCs and external ftl files.

Installation

npm install unplugin-fluent-vue --save-dev

Usage

Vite

// vite.config.js
import { defineConfig } from 'vite'
import {
  ExternalFluentPlugin,
  SFCFluentPlugin,
} from 'unplugin-fluent-vue/vite'

export default defineConfig({
  plugins: [
    vue(),
    // Choose one of the following:
    SFCFluentPlugin({ // define messages in SFCs
      blockType: 'fluent', // default 'fluent' - name of the block in SFCs
      checkSyntax: true, // default true - whether to check syntax of the messages
    }),
    ExternalFluentPlugin({ // define messages in external ftl files
      baseDir: path.resolve('src'), // required - base directory for Vue files
      ftlDir: path.resolve('src/locales'), // required - directory with ftl files
      locales: ['en', 'da'], // required - list of locales
      checkSyntax: true, // default true - whether to check syntax of the messages
    }),
  ],
})

Docs: https://fluent-vue.demivan.me/integrations/unplugin.html



Alternative Project Comparisons
Related Awesome Lists
Top Programming Languages

Get A Weekly Email With Trending Projects For These Topics
No Spam. Unsubscribe easily at any time.
Javascript (1,119,969
Typescript (284,271
Vue (70,430
Webpack (23,852
I18n (4,892
Vite (2,271
Unplugin (31