donaldzou / WGDashboard

Simple dashboard for WireGuard VPN written in Python & Vue.js
https://donaldzou.github.io/WGDashboard-Documentation/
Apache License 2.0
1.63k stars 248 forks source link

Added template and script to check local files #488

Open donaldzou opened 1 week ago

donaldzou commented 1 week ago

How to use

python3 verify_locale_files.py in src/static/locale

Example

(venv) donaldzou@Mac locale % python3 verify_locale_files.py 
========================================================
| WGDashboard Locale File Verification [by @donaldzou] |
========================================================

Active Languages
        [Language #1] Czech
        [Language #2] German
        [Language #3] English
        [Language #4] Italian
        [Language #5] Dutch
        [Language #6] Russian
        [Language #7] Turkish
        [Language #8] Ukrainian
        [Language #9] Chinese (Simplified)
        [Language #10] Chinese (Traditional)
Select the language number you want to verify or enter [q] to exit: 1

Selected Language: Czech

        [Missing Translations] Simply copy the JSON below into the locale file and translate them in :)
                "Signing In\.\.\.": "",
                "Multi-Factor Authentication \(MFA\)": "",
                "Are you sure to delete this API key\?": "",
                "When should this API Key expire\?": "",
                "Creating\.\.\.": "",
                "Turning On\.\.\.": "",
                "Turning Off\.\.\.": "",
                "Search Peers\.\.\.": "",
                "\(Required for QR Code and Download\)": "",
                "\(Required\)": "",
                "This peer does not have any job yet\.": "",
                "No active job at the moment\.": "",
                "Sharing\.\.\.": "",
                "Stop Sharing\.\.\.": "",
                "Restricting\.\.\.": "",
                "Allowing Access\.\.\.": "",
                "Download \& QR Code is not available due to no private key set for this peer": "",
                "By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP\.": "",
                "How many peers you want to add\?": "",
                "Adding\.\.\.": "",
                "Dashboard IP Address \& Listen Port": ""

        [Deprecated Translations] Simply remove the translation below :)1
                "Signing In...": "Přihlašování..."
                "Multi-Factor Authentication (MFA)": "Vícefaktorové ověření (MFA)"
                "Are you sure to delete this API key?": "Určitě chcete smazat tento API klíč?"
                "When should this API Key expire?": "Kdy má tento API klíč vypršet?"
                "Creating...": "Tvořím..."
                "Turning On...": "Zapínám..."
                "Turning Off...": "Vypínám..."
                "Search Peers...": "Hledat peers..."
                "(Required for QR Code and Download)": "(Nutné pro QR kód a stažení)"
                "(Required)": "(Povinné)"
                "This peer does not have any job yet.": "Tento peer ještě nemá žádný úkol."
                "No active job at the moment.": "Žádný úkol v současnosti neprobíhá."
                "Sharing...": "Sdílím..."
                "Stop Sharing...": "Ukončit sdílení..."
                "Restricting...": "Omezuji..."
                "Allowing Access...": "Povoluji přístup..."
                "Download & QR Code is not available due to no private key set for this peer": "Stažení a QR kód nejsou k dispozici, peer nemá nastavený soukromý klíč."
                "By adding peers by bulk, each peer's name will be auto generated, and Allowed IP will be assign to the next available IP.": "Při hromadném importu bude jméno každého peera vygenerované automaticky, a povolená IP adresa bude nastavena na další v pořadí"
                "How many peers you want to add?": "Kolik peerů chcete přidat?"
                "Adding...": "Přidávám..."
donaldzou commented 1 week ago

Hi @DaanSelen, when u are free, do you mind going through this PR and see if there's anything to improve and streamline the localization process?

Thank u!

DaanSelen commented 1 week ago

I'll go through it, give me some time!

DaanSelen commented 1 week ago

https://github.com/donaldzou/WGDashboard/pull/492

donaldzou commented 5 days ago

Yes I found out a bug in the python script that it escaped 2 back slashes when printed out. Need to figure that out :)

DaanSelen commented 3 days ago

Yes I found out a bug in the python script that it escaped 2 back slashes when printed out. Need to figure that out :)

Did all things get resolved?

donaldzou commented 9 hours ago

Yes I found out a bug in the python script that it escaped 2 back slashes when printed out. Need to figure that out :)

Did all things get resolved?

Yes, now what's left to do is fixing the empty translations that got replaced by the regex escaped keys:

"Sharing..." ==> "Sharing\.\.\."

donaldzou commented 9 hours ago

The current script will insert the new translation and remove deprecated ones directly from the file.