2022-02-19 08:04:25 +01:00
|
|
|
---
|
2021-10-17 18:26:00 +02:00
|
|
|
title: locale
|
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-12-28 21:07:45 +01:00
|
|
|
The `locale` setting allows you to specify the language of the pattern.
|
|
|
|
It should contain a 2-letter language code that indicates what language the user wants.
|
|
|
|
The default is `en`.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
This will be used to set the `xml:lang` attribute in the `svg` tag when rendering to SVG,
|
|
|
|
and by [the i18n plugin](/reference/plugins/i18n/) to translate the pattern.
|
|
|
|
|
|
|
|
```js
|
2021-12-28 21:07:45 +01:00
|
|
|
import Brian from "@freesewing/brian";
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2021-12-28 21:07:45 +01:00
|
|
|
const pattern = new Brian({
|
2021-08-25 16:09:31 +02:00
|
|
|
locale: "es"
|
|
|
|
})
|
|
|
|
```
|