You've already forked Tricky-Addon-Update-Target-List
mirror of
https://github.com/KOWX712/Tricky-Addon-Update-Target-List.git
synced 2025-09-06 06:37:09 +00:00
commit 1562a97de621efe514274962826bc2601f694441 Author: KOWX712 <leecc0503@gmail.com> Date: Sun Dec 1 00:02:36 2024 +0800 update translation guide
38 lines
1.1 KiB
Markdown
38 lines
1.1 KiB
Markdown
# Translation Guide
|
|
## Fix Translation Error
|
|
1. Fork this repository.
|
|
2. Find your language string file in `/module/webroot/locales/`.
|
|
3. Edit the string value with translated incorrectly.
|
|
4. Create a Pull Request.
|
|
|
|
---
|
|
## Add a New Language
|
|
### Simple
|
|
- Contact me in Telegram to add a new translation langauge for you.
|
|
|
|
### Advanced
|
|
1. Fork this repository.
|
|
2. Make a copy of `/module/webroot/locales/A-template.json`
|
|
3. Rename it to `language_code-COUNTRY_CODE.json`, e.g., `en-US.json`.
|
|
4. Translate the string value inside.
|
|
5. Add `langauge-option` into `/module/webroot/index.html`.
|
|
Format:
|
|
```xml
|
|
<button class="language-option" data-lang="language_code-COUNTRY_CODE">languageName</button>
|
|
```
|
|
Example:
|
|
```xml
|
|
<div class="language-menu">
|
|
<button class="language-option" data-lang="en-US">English</button>
|
|
</div>
|
|
```
|
|
|
|
6. Add language_code-COUNTRY_CODE in `/module/webroot/index.js` under `function detectUserLanguage()`
|
|
Format:
|
|
```js
|
|
function detectUserLanguage() {
|
|
const availableLanguages = ['en-US', 'ru-RU', 'tl-PH', 'zh-CN', 'zh-TW'];
|
|
}
|
|
```
|
|
|
|
7. Create a Pull Request |