Thanks, i'm currently also working on it, i have benchmarked the possible translation solutions and currently i'm preferring pure-json translation tables over gettext, it will finish the hungarian translation in the next days, after that other languages will be welcome
I use gettext because there's lots of tools supports it. In my thought you can put it on online translation websites (eg. Transifex, Crowdin). Just download .po file and you can use it.
Also, as I know Python isn't very fast. And network connection and browser loading are slower. So I think it's uncenessary to benchmark.
Json based translationt tables are pretty common, you dont need anything to edit them and transifex and other online translation helpers also supporting them.
If you spend a little time anaylizing your prossibilites, then Python offers pretty good performance/feature ratio (for this kind of applications). Network speed should be no issue (since you using your loopback connection) and browser speed are also fine.
you dont need anything to edit them
You are right, but I need a program to edit them. Editing the json file may not convenient.
Hope you can give an example for your implement.
This is how the translate tables look like, I think it's pretty easy to edit without any external utility:
For python source:
{
"Peers": "Csatlakozási pontok",
"Connected": "Csaltakozva",
"Connectable": "Csatlakozható",
"Connectable peers": "Csatlakozható peer-ek",
"Data transfer": "Adatátvitel",
"Received": "Fogadott",
"Received bytes": "Fogadott byte-ok",
"Sent": "Küldött",
"Sent bytes": "Küldött byte-ok",
"Files": "Fájlok",
"Total": "Összesen",
"Image": "Kép",
"Other": "Egyéb",
"User data": "Felh. adat",
"Size limit": "Méret korlát",
"limit used": "felhasznált",
"free space": "szabad hely",
"Set": "Beállít",
"Optional files": "Opcionális fájlok",
"Downloaded": "Letöltött",
"Download and help distribute all files": "Minden opcionális fájl letöltése",
"Total size": "Teljes méret",
"Downloaded files": "Letöltve",
"Database": "Adatbázis",
"search feeds": "Keresés források",
"{feeds} query": "{feeds} lekérdezés",
"Reload": "Újratöltés",
"Rebuild": "Újraépítés",
"No database found": "Adatbázis nem található",
"Identity address": "Azonosító cím",
"Change": "Módosít",
"Update": "Frissít",
"Resume": "Folytat",
"Delete": "Töröl",
"Site address": "Oldal címe",
"Donate": "Támogatás",
"Missing files": "Hiányzó fájlok",
"{} try": "{} próbálkozás",
"{} tries": "{} próbálkozás",
"+ {num_bad_files} more": "+ még {num_bad_files} darab",
"This is my site": "Ez az én oldalam",
"Site title": "Oldal neve",
"Site description": "Oldal leírása",
"Save site settings": "Oldal beállítások mentése",
"Content publishing": "Tartalom publikálás",
"Choose": "Válassz",
"Sign": "Aláírás",
"Publish": "Publikálás",
"This function is disabled on this proxy": "Ez a funkció ki van kapcsolva ezen a proxy-n",
"GeoLite2 City database download error: {}!<br>Please download manually and unpack to data dir:<br>{}": "GeoLite2 város adatbázis letöltési hiba: {}!<br>A térképhez töltsd le és csomagold ki a data könyvtárba:<br>{}",
"Downloading GeoLite2 City database (one time only, ~20MB)...": "GeoLite2 város adatbázis letöltése (csak egyszer kell, kb 20MB)...",
"GeoLite2 City database downloaded!": "GeoLite2 város adatbázis letöltve!"
}
For ZeroMe
{
"Opened": "Nyitva",
"Closed": "Bezárva",
"_(Disabled)": "Kikapcsolva",
"_(Error)": "Hiba",
"Status": "Állapot: ",
"Nice! Your port \" + Page.server_info.fileserver_port + \" is opened.": "Király! A \" + Page.server_info.fileserver_port + \" portod nyitva van.",
"Re-check opened port": "Port újraellenörzése",
"How to make Tor connection work?": "Hogyan lehet bekapcsolni a Tor kapcsolatot?",
"How to use ZeroNet in Tor Browser?": "Hogyan használjam a ZeroNet-et a Tor böngészőben?",
"Disable always Tor mode": "Tor mindig mód kikapcsolása",
"Enable Tor for every connection (slower)": "Tor használata minden kapcsolatra (lassabb)",
"Help to keep this project alive": "Segíts életben tartani a projectet",
"Welcome to ZeroNet": "Üdv a ZeroNet-en",
"Let's build a decentralized Internet together!": "Építsünk egy decentralizált Internetet közösen!",
"This site currently served by ": "Ez azt az oldalt jelenleg ",
" peers, without any central server.": " számítógép szolgálja ki, központi szerver nélkül.",
"Some sites we created:": "Pár oldal, amit mi csináltunk:",
"Simple messaging board": "Egyszerű üzenő fal",
"Reddit-like, decentralized forum": "Reddit-szerű, decentralizált fórum",
"Activate \\u2501": "Aktiválás \\u2501",
"Microblogging platform": "Mini blog-motor",
"End-to-end encrypted mailing": "Ponttól-ponting titkosított üzenetküldő",
"P2P social network": "P2P szociális hálózat",
"_(Sites)": "Oldalak",
"_(Files)": "Fájlok",
"Connected sites:": "Elérhető oldalak",
" file update failed": " hiányzó fájl",
"More sites:": "Több oldal:",
"Activate \\u00BB": "Aktiválás \\u00BB",
" minutes ago": " perce",
" hours ago": " órája",
" days ago": " napja",
"on ": "",
"Just now": "Épp most"
}
The result:

So there is 2 separate translator: One for the python source code and one for sites source code.
The python source code translation is pretty simple _("Anything") returns the translated version of "Anything".
The site source code translation happens on server-side: you can switch any string in the javascript source code with a translated version of it. So it does not requires any modification in the site source code, but it has some drawbacks:
if (mode == "Page") $("#mode").text("Page") and you want to translate "Page" then it will also translate the one in condition so it will never matches. As for solution for this you have to write: if (mode == "Page") $("#mode").text(_("Page")) and if put "_(Page)": "Oldal" to the translate json, it will only translate _("Page")_("anything") to every string you want to translate and return the translated one based on user's language), but I choosen this one because it does not adds extra "noise" to site's source code and the other reason is speed: The virtual dom liblaries re-rendering the structure array on every update, click or keypress, so if you translate in real-time it has to call the translation function for every string you have on the page. (it it can easily add 1000s of function calls to every keypress)I will also translate ZeroTalk and ZeroMe with this solution before the release to see if it can also work for that sites. ETA: this week
I wonder if there's a tool to edit/generate these json files? Currently I use Poedit to edit po files. And use xgettext to generate .pot files.
These jsons function like gettext, but it uses less space than po files. And json is supported over most languages, we don't need to parse po files ourselves! 👍
Added in 0.5.1, translation files:
https://github.com/HelloZeroNet/ZeroNet/blob/master/src/Translate/languages/hu.json
https://github.com/HelloZeroNet/ZeroNet/blob/master/plugins/Sidebar/languages/hu.json
https://github.com/HelloZeroNet/ZeroHello/blob/master/languages/hu.json
https://github.com/HelloZeroNet/ZeroMe/blob/master/languages/hu.json
https://github.com/HelloZeroNet/ZeroTalk/blob/master/languages/hu.json
Most helpful comment
This is how the translate tables look like, I think it's pretty easy to edit without any external utility:
For python source:
For ZeroMe
The result:

So there is 2 separate translator: One for the python source code and one for sites source code.
The python source code translation is pretty simple _("Anything") returns the translated version of "Anything".
The site source code translation happens on server-side: you can switch any string in the javascript source code with a translated version of it. So it does not requires any modification in the site source code, but it has some drawbacks:
if (mode == "Page") $("#mode").text("Page")and you want to translate "Page" then it will also translate the one in condition so it will never matches. As for solution for this you have to write:if (mode == "Page") $("#mode").text(_("Page"))and if put"_(Page)": "Oldal"to the translate json, it will only translate_("Page")_("anything")to every string you want to translate and return the translated one based on user's language), but I choosen this one because it does not adds extra "noise" to site's source code and the other reason is speed: The virtual dom liblaries re-rendering the structure array on every update, click or keypress, so if you translate in real-time it has to call the translation function for every string you have on the page. (it it can easily add 1000s of function calls to every keypress)I will also translate ZeroTalk and ZeroMe with this solution before the release to see if it can also work for that sites. ETA: this week