-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Added Translate library documentation
Co-authored-by: ToxesFoxes <[email protected]>
- Loading branch information
1 parent
1fc47cb
commit f97958a
Showing
2 changed files
with
62 additions
and
0 deletions.
There are no files selected for viewing
53 changes: 53 additions & 0 deletions
53
i18n/ru/docusaurus-plugin-content-docs-libraries/current/Translate.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
# Translate | ||
|
||
Translate — библиотека, позволяющая загружать переводы из JSON файла. Последнюю версию библиотеки можно загрузить в [официальном репозитории](https://github.com/SDesya74/Libraries/blob/master/Translate/Translate.js). | ||
|
||
## Использование | ||
|
||
Для начала работы импортируйте библиотеку *Translate.js* или *Translate.min.js*: | ||
|
||
```js | ||
IMPORT("Translate"); | ||
``` | ||
|
||
### Загрузка переводов | ||
|
||
:::note Разделите огромный файл с переводами | ||
|
||
Необязательно использовать 1 файл для всех переводов, можно загружать множество файлов одновременно. | ||
|
||
::: | ||
|
||
```js | ||
Translate("assets/translations.json", true); | ||
``` | ||
|
||
### Перевод отдельных строк | ||
|
||
Только с **английского** на другие языки, с других не тестировалось. | ||
|
||
```js | ||
Translate("Test") | ||
``` | ||
|
||
## Пример из файла (*translations.json*) | ||
|
||
```jsonc | ||
// assets/translations.json | ||
{ | ||
"Item": { // Default | ||
"en": "Item", // English | ||
"ru": "Предмет", // Русский | ||
"nl": "Item", // Nederlands | ||
"de": "Element", // Deutsch | ||
"es": "Elemento", // Espanol | ||
"fr": "Article", // Français | ||
"it": "Elemento", // Italiano | ||
"pt": "Item", // Português | ||
"ja": "アイテム", // Japanese | ||
"ko": "항목", // Korean | ||
"zh": "项目" // Chinese | ||
}, | ||
// . . . | ||
} | ||
``` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
--- | ||
hide_title: true | ||
--- | ||
|
||
```mdx-code-block | ||
import NotImplemented from "@site/src/components/NotImplemented" | ||
<NotImplemented /> | ||
``` |