-
-
Notifications
You must be signed in to change notification settings - Fork 490
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Implement the basic engine + replace strings in __init__ and mainWind…
…ow modules (#67)
- Loading branch information
1 parent
16899e6
commit 5144f65
Showing
9 changed files
with
166 additions
and
72 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
{ | ||
|
||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,66 @@ | ||
from os.path import exists | ||
from pathlib import Path | ||
|
||
|
||
languageReference = { | ||
"default": "System language", | ||
"ca" : "Catalan - Català", | ||
"en" : "English - English", | ||
} | ||
|
||
|
||
languageRemap = { | ||
"pt-PT": "pt_PT", | ||
"pt-BR": "pt_BR", | ||
"uk": "ua", | ||
"zh-Hant-TW": "zh_TW", | ||
"zh-Hans-CN": "zh_CN", | ||
} | ||
|
||
|
||
# ISO 3166-1 | ||
languageFlagsRemap = { | ||
"ar": "sa", | ||
"bs": "ba", | ||
"ca": "ad", | ||
"cs": "cz", | ||
"da": "dk", | ||
"en": "gb", | ||
"el": "gr", | ||
"et": "ee", | ||
"fa": "ir", | ||
"he": "il", | ||
"ja": "jp", | ||
"ko": "kr", | ||
"nb": "no", | ||
"nn": "no", | ||
"pt_BR": "br", | ||
"pt_PT": "pt", | ||
"si": "lk", | ||
"zh_CN": "cn", | ||
"zh_TW": "tw", | ||
"vi": "vn", | ||
"sr": "rs", | ||
"sv": "se", | ||
} | ||
|
||
|
||
def getMarkdownSupportLangs(): | ||
from translated_percentage import untranslatedPercentage | ||
|
||
readmeLangs = [ | ||
"| Language | Translated | |", | ||
"| :-- | :-- | --- |", | ||
] | ||
|
||
dir = str(Path(__file__).parent) | ||
for lang, langName in languageReference.items(): | ||
if (not exists(f"{dir}/lang_{lang}.json")): continue | ||
perc = untranslatedPercentage[lang] if (lang in untranslatedPercentage) else "100%" | ||
if (perc == "0%"): continue | ||
langName = languageReference[lang] if (lang in languageReference) else lang | ||
flag = languageFlagsRemap[lang] if (lang in languageFlagsRemap) else lang | ||
readmeLangs.append(f"| {langName} | {perc} | <img src='https://flagcdn.com/{flag}.svg' width=20> |") | ||
readmeLangs.append("") | ||
|
||
return "\n".join(readmeLangs) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,7 @@ | ||
# Autogenerated file, do not modify it!!! | ||
# The following list includes ONLY non-full translated files. | ||
|
||
untranslatedPercentage = { | ||
"en": "107.28%", | ||
"ca": "42069%", | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
from lang.lang_tools import languageReference | ||
|
||
lang = {} | ||
englang = {} | ||
languages = {} # will be auto-generated | ||
|
||
## auto-generate map of files | ||
for key in languageReference.keys(): | ||
if (key != "default"): | ||
languages[key] = f"lang_{key}.json" | ||
|
||
debugLang = False | ||
|
Oops, something went wrong.