Merge pull request #2029 from Dune-jr/fix-locale-convert

Fix missing locale strings when running export scripts
This commit is contained in:
oy 2019-02-09 19:37:38 +01:00 committed by GitHub
commit 8a34cebec0
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 5 additions and 5 deletions

View file

@ -19,7 +19,7 @@ JSON_KEY_OLDTRANSL="old translations"
JSON_KEY_OR="or" JSON_KEY_OR="or"
JSON_KEY_TR="tr" JSON_KEY_TR="tr"
SOURCE_LOCALIZE_RE=re.compile(br'Localize\("(?P<str>([^"\\]|\\.)*)"(, "(?P<ctxt>([^"\\]|\\.)*)")?\)') SOURCE_LOCALIZE_RE=re.compile(br'Localize\("(?P<str>([^"\\]|\\.)*)"(, ?"(?P<ctxt>([^"\\]|\\.)*)")?\)')
def parse_source(): def parse_source():
l10n = defaultdict(lambda: []) l10n = defaultdict(lambda: [])
@ -114,13 +114,13 @@ if __name__ == '__main__':
if(commenttxt): if(commenttxt):
commenttxt = 'Context: '+commenttxt commenttxt = 'Context: '+commenttxt
po.append(polib.POEntry(msgid=msg, msgstr="", occurrences=occurrences, msgctxt=ctxt, comment=commenttxt)) po.append(polib.POEntry(msgid=msg, msgstr="", occurrences=occurrences, msgctxt=ctxt, comment=commenttxt))
po.save('data/languages/base.pot') po.save('datasrc/languages/base.pot')
for filename in os.listdir("data/languages"): for filename in os.listdir("datasrc/languages"):
try: try:
if (os.path.splitext(filename)[1] == ".json" if (os.path.splitext(filename)[1] == ".json"
and filename != "index.json"): and filename != "index.json"):
filename = "data/languages/" + filename filename = "datasrc/languages/" + filename
write_languagefile(filename, l10n_src, load_languagefile(filename)) write_languagefile(filename, l10n_src, load_languagefile(filename))
except Exception as e: except Exception as e:
print("Failed on {0}, re-raising for traceback".format(filename)) print("Failed on {0}, re-raising for traceback".format(filename))

View file

@ -23,7 +23,7 @@
#include "menus.h" #include "menus.h"
CMenus::CColumn CMenus::ms_aBrowserCols[] = { // Localize - these strings are localized within CLocConstString CMenus::CColumn CMenus::ms_aBrowserCols[] = { // Localize("Server"); Localize("Type"); Localize("Map"); Localize("Players"); Localize("Ping"); - these strings are localized within CLocConstString
{COL_BROWSER_FLAG, -1, " ", -1, 4*16.0f+3*2.0f, 0, {0}, {0}, CUI::ALIGN_CENTER}, {COL_BROWSER_FLAG, -1, " ", -1, 4*16.0f+3*2.0f, 0, {0}, {0}, CUI::ALIGN_CENTER},
{COL_BROWSER_NAME, IServerBrowser::SORT_NAME, "Server", 0, 310.0f, 0, {0}, {0}, CUI::ALIGN_CENTER}, {COL_BROWSER_NAME, IServerBrowser::SORT_NAME, "Server", 0, 310.0f, 0, {0}, {0}, CUI::ALIGN_CENTER},
{COL_BROWSER_GAMETYPE, IServerBrowser::SORT_GAMETYPE, "Type", 1, 70.0f, 0, {0}, {0}, CUI::ALIGN_CENTER}, {COL_BROWSER_GAMETYPE, IServerBrowser::SORT_GAMETYPE, "Type", 1, 70.0f, 0, {0}, {0}, CUI::ALIGN_CENTER},