Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/stefanwimmer128/sprintf-formatter

Sprintf Formatter - use sprintf for formating vue-i18n translations
https://github.com/stefanwimmer128/sprintf-formatter

Last synced: 2 days ago
JSON representation

Sprintf Formatter - use sprintf for formating vue-i18n translations

Awesome Lists containing this project

README

        

# Sprintf Formatter

Use [sprintf](https://github.com/alexei/sprintf.js/) for formating vue-i18n translations

## Install

``` bash
yarn add sprintf-formatter
npm i sprintf-formatter
```

``` html

```

## Usage

``` js
import VueI18n from "vue-i18n";
import SprintfFormatter from "sprintf-formatter";

const i18n = new VueI18n({
formatter: new SprintfFormatter(),
/* ... */
});

new Vue({
i18n,
/* ... */
});
```

or with `nuxt-i18n`:

``` js
/* plugins/vue-i18n.js */

import SprintfFormatter from "sprintf-formatter";

export default function vueI18n() {
return {
formatter: new SprintfFormatter(),
/* ... */
};
}
```

``` js
/* nuxt.config.js */

export default {
modules: [
[
"nuxt-i18n",
{
vueI18n: "@/plugins/vue-i18n.js",
/* ... */
},
],
/* ... */
],
/* ... */
}
```

## License

ISC License