2021-10-17 18:26:00 +02:00
|
|
|
---
|
2022-10-02 00:27:09 +02:00
|
|
|
title: plugin-i18n
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
Published as [@freesewing/plugin-i18n][1], this plugin faciliates
|
|
|
|
translation of your designs.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
## Installation
|
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
```sh
|
2021-08-25 16:09:31 +02:00
|
|
|
npm install @freesewing/plugin-i18n
|
|
|
|
```
|
|
|
|
|
|
|
|
## Usage
|
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
Either [add it as a part plugins](/reference/api/part/config/plugins) in your
|
|
|
|
design, or [add it to a pattern instance with
|
|
|
|
Pattern.use()](/reference/api/pattern/use).
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
## Notes
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
This plugin provides the mechanism for translation, but does not come with
|
|
|
|
translations itself. For this, you can use our [i18n
|
|
|
|
package](/reference/packages/i18n).
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2022-10-02 00:27:09 +02:00
|
|
|
To add (your own) translations, you should pass data to this plugin.
|
2021-08-25 16:09:31 +02:00
|
|
|
It should be structured as such:
|
|
|
|
|
|
|
|
```js
|
|
|
|
{
|
|
|
|
strings:
|
|
|
|
en: {
|
|
|
|
example: "Example"
|
|
|
|
},
|
|
|
|
nl: {
|
|
|
|
example: "Voorbeeld"
|
|
|
|
},
|
|
|
|
// More languages can follow
|
|
|
|
}
|
|
|
|
}
|
|
|
|
```
|
2022-10-02 00:27:09 +02:00
|
|
|
|
|
|
|
The i18n plugin is part of our [plugin-bundle](/reference/plugins/bundle)
|
|
|
|
|
|
|
|
[1]: https://www.npmjs.com/package/@freesewing/plugin-i18n
|
|
|
|
|