2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
title: Use translation keys, not text
|
|
|
|
order: 60
|
2021-10-17 18:26:00 +02:00
|
|
|
---
|
2021-08-25 16:09:31 +02:00
|
|
|
|
|
|
|
Don't insert literal text in your patterns. Instead, insert a key that can then be translated.
|
|
|
|
|
2022-12-25 21:13:48 -08:00
|
|
|
For example, if you want to put "_Finish with bias tape_" on your pattern, don't be
|
2021-08-25 16:09:31 +02:00
|
|
|
tempted to do this:
|
|
|
|
|
|
|
|
```js
|
|
|
|
path.seam.attr("data-text", "Finish with bias tape");
|
|
|
|
```
|
|
|
|
|
2022-12-25 21:13:48 -08:00
|
|
|
That (English) string is now hard-coded in your pattern. As FreeSewing supports
|
2021-08-25 16:09:31 +02:00
|
|
|
translation out of the box, it would be a real shame not to make use of it.
|
|
|
|
|
|
|
|
Instead, insert a key to identify the string:
|
|
|
|
|
|
|
|
```js
|
|
|
|
path.seam.attr("data-text", "finishWithBiasTape");
|
|
|
|
```
|
|
|
|
|
2022-12-25 21:13:48 -08:00
|
|
|
This way, different strings for different languages can be associated with
|
|
|
|
the key, allowing translated text to be used.
|
2021-08-25 16:09:31 +02:00
|
|
|
|
2024-07-08 19:07:59 +03:00
|
|
|
You can find and browse the translations and available translation keys for each design in the design's
|
|
|
|
[i18n folder on GitHub][1].
|
2022-12-25 21:13:48 -08:00
|
|
|
|
2024-07-08 19:07:59 +03:00
|
|
|
[1]: https://github.com/freesewing/freesewing/tree/develop/designs/aaron/i18n
|