Skip to content

[Looking for help!] Localization of WGDashboard #397

Open
@donaldzou

Description

@donaldzou

Hi all, I finally finished adding the support of localization, and currently WGDashboard support the following languages:

  • Czech
  • Chinese (Simplified)
  • Chinese (Traditional)
  • Dutch
  • English
  • German
  • Italian
  • Polish
  • Spanish
  • Swedish
  • Russian
  • Turkish
  • Ukrainian

If anyone are willing to contribute, you can follow the instructions below:

  1. git clone the main branch
  2. Copy `language_template.json and rename them using the locale code in this list: https://www.science.co.il/language/Locale-codes.php
  3. Start translate! Remember don't edit the key, just the value.

You might notice there are some Regex syntax in the existing locale files. Basically, the dashboard will match the key to the texts in the UI, and replace the value using regex. So you can adjust the position of matching groups to better fit your language.
For example: You can add up to (.*) peers have one matching group which is matching a number between to and peers, and you can use $1 in the value to represent the number.

After you're done translating:

  1. Add your translation to active_languages.json by following this format
[
    {
        "lang_id": "zh-cn",
        "lang_name": "Chinese (Simplified)",
        "lang_name_localized": "中文 (简体)"
    }
]
  1. Run the check script
python3 verify_locale_files.py

It will tell you if your translation have missing translation or deprecated one, and it will insert or remove them directly for you:

python3 verify_locale_files.py
 
========================================================
| WGDashboard Locale File Verification [by @donaldzou] |
========================================================

Active Languages

Czech | cs
German | de-de
English | en
Spanish | es-es
Italian | it-it
Dutch | nl-nl
Russian | ru
Turkish | tr-tr
Ukrainian | uk
Chinese (Simplified) | zh-cn
Chinese (Traditional) | zh-hk
Swedish | sv-se
Polish | pl

Please enter the language ID to verify: zh-cn

	[Missing Translations] 0 translation
	[Deprecated Translations] 0 translation
	[Note] All missing translations are added into zh-cn.json, all deprecated translations are removed from zh-cn.json

Please comment below if you have any questions 😄

Metadata

Metadata

Assignees

No one assigned

    Labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions