Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Looking for help!] Localization of WGDashboard #397

Open
donaldzou opened this issue Sep 22, 2024 · 24 comments
Open

[Looking for help!] Localization of WGDashboard #397

donaldzou opened this issue Sep 22, 2024 · 24 comments
Labels
good first issue Good for newcomers help wanted Extra attention is needed

Comments

@donaldzou
Copy link
Owner

donaldzou commented Sep 22, 2024

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 😄

@donaldzou donaldzou added the help wanted Extra attention is needed label Sep 22, 2024
@donaldzou donaldzou pinned this issue Sep 22, 2024
This was referenced Sep 22, 2024
@donaldzou donaldzou changed the title Localization of WGDashboard [Looking for help!] Localization of WGDashboard Sep 22, 2024
@DaanSelen
Copy link
Collaborator

I can provide Dutch if you'd like, but how would I do that?

@donaldzou
Copy link
Owner Author

I can provide Dutch if you'd like, but how would I do that?

Hi @DaanSelen, I provided an instruction above :) Is fairly easy as I already have an example in the v4.1-dev branch. Basically the file looks like this:

{
	"Welcome to": "歡迎來到",
	"Username": "用戶名",
	"Password": "密碼",
	"OTP from your authenticator": "您多重身份驗證器的一次性驗證碼",
	"Sign In": "登錄"
...
}

Where the key is what you translating from, and the value is what you are translating to. The example provided is Chinese (Traditional)

@NOXCIS
Copy link
Contributor

NOXCIS commented Sep 22, 2024

@donaldzou I can do the Spanish & Portuguese bit.

@orangeferdi
Copy link
Contributor

@donaldzou I will support with German! :)

3vis97 added a commit to 3vis97/WGDashboard that referenced this issue Sep 23, 2024
@donaldzou
Copy link
Owner Author

Hi @3vis97 ! Thank you for providing the Italian translation. Do you mind creating a PR to my v4.1-dev branch so I can merge your work to mine?

@3vis97
Copy link
Contributor

3vis97 commented Sep 25, 2024

Hi @3vis97 ! Thank you for providing the Italian translation. Do you mind creating a PR to my v4.1-dev branch so I can merge your work to mine?

Hi @donaldzou!
Yes i will do, but before I create the PR, I'd like to test the translation in a live instance to ensure the female, male and plural forms are correct and the translation sounds natural in the web interface.

I only need to find the time to do it. I hope to do it in the next few days 👍🏻

@donaldzou
Copy link
Owner Author

Hi @3vis97 ! Thank you for providing the Italian translation. Do you mind creating a PR to my v4.1-dev branch so I can merge your work to mine?

Hi @donaldzou! Yes i will do, but before I create the PR, I'd like to test the translation in a live instance to ensure the female, male and plural forms are correct and the translation sounds natural in the web interface.

I only need to find the time to do it. I hope to do it in the next few days 👍🏻

For sure! Please take your time and can't thank you enough for providing this ;)

3vis97 added a commit to 3vis97/WGDashboard that referenced this issue Sep 26, 2024
@3vis97
Copy link
Contributor

3vis97 commented Sep 26, 2024

Hi @3vis97 ! Thank you for providing the Italian translation. Do you mind creating a PR to my v4.1-dev branch so I can merge your work to mine?

Hi @donaldzou! Yes i will do, but before I create the PR, I'd like to test the translation in a live instance to ensure the female, male and plural forms are correct and the translation sounds natural in the web interface.
I only need to find the time to do it. I hope to do it in the next few days 👍🏻

For sure! Please take your time and can't thank you enough for providing this ;)

Hi @donaldzou, Here's the the PR #406 !

donaldzou added a commit that referenced this issue Oct 3, 2024
@velrino
Copy link

velrino commented Oct 15, 2024

@donaldzou I can do the Spanish & Portuguese bit.

I can do Brazilian Portuguese

@donaldzou
Copy link
Owner Author

@donaldzou I can do the Spanish & Portuguese bit.

I can do Brazilian Portuguese

@velrino For sure! Thanks is advanced.

@jursed
Copy link
Contributor

jursed commented Nov 3, 2024

I added a Czech translation, see PR #452. 🙂

@DaanSelen
Copy link
Collaborator

How can I verify the made translations? Can I already toggle it somehow - somewhere in a configuration file.

@donaldzou
Copy link
Owner Author

donaldzou commented Nov 7, 2024 via email

@DaanSelen DaanSelen added the good first issue Good for newcomers label Nov 12, 2024
@oskarax
Copy link
Contributor

oskarax commented Nov 17, 2024

I can do Swedish if its needed?

@DaanSelen
Copy link
Collaborator

Yes! Of course, do you know how to contribute?

@oskarax
Copy link
Contributor

oskarax commented Nov 17, 2024

Yes! Of course, do you know how to contribute?

Not really. There is some instruction at the top and I can try and see if I get it.

@DaanSelen
Copy link
Collaborator

Sure, let me know if you run into problems. Fastest way is Discord or matrix

@oskarax
Copy link
Contributor

oskarax commented Nov 18, 2024

Sure, let me know if you run into problems. Fastest way is Discord or matrix

So its done now. My first so please be gentle. I am learning :)

@DaanSelen
Copy link
Collaborator

Of course!

@oskarax
Copy link
Contributor

oskarax commented Nov 18, 2024

Of course!

i have uploaded the new json file to my test system and it seems to work as it should.

@XigmaDev
Copy link

I can do Persian
do you need it ?

@DaanSelen
Copy link
Collaborator

Yeah! Make a PR

@sobhydo
Copy link

sobhydo commented Dec 28, 2024

I'm doing the Arabic translation, is it needed ?

@DaanSelen
Copy link
Collaborator

I'm doing the Arabic translation, is it needed ?

Always!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

11 participants