From 96561a4f3a4507932371f8671b431977dbcb28ff Mon Sep 17 00:00:00 2001 From: Jordy Ruiz Date: Sat, 9 Feb 2019 00:54:44 +0100 Subject: [PATCH 1/2] Fix browser localization hints --- src/game/client/components/menus_browser.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/game/client/components/menus_browser.cpp b/src/game/client/components/menus_browser.cpp index 8930b508e..431293dce 100644 --- a/src/game/client/components/menus_browser.cpp +++ b/src/game/client/components/menus_browser.cpp @@ -23,7 +23,7 @@ #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_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}, From bb4a8dc14e1dd691dc35ad8dc608e8b56ed533a7 Mon Sep 17 00:00:00 2001 From: Jordy Ruiz Date: Sat, 9 Feb 2019 19:28:59 +0100 Subject: [PATCH 2/2] Fix Localize with no space between parameters not being detected, fix paths --- scripts/convert_l10n.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/scripts/convert_l10n.py b/scripts/convert_l10n.py index dbd7deae0..fbcc458d4 100644 --- a/scripts/convert_l10n.py +++ b/scripts/convert_l10n.py @@ -19,7 +19,7 @@ JSON_KEY_OLDTRANSL="old translations" JSON_KEY_OR="or" JSON_KEY_TR="tr" -SOURCE_LOCALIZE_RE=re.compile(br'Localize\("(?P([^"\\]|\\.)*)"(, "(?P([^"\\]|\\.)*)")?\)') +SOURCE_LOCALIZE_RE=re.compile(br'Localize\("(?P([^"\\]|\\.)*)"(, ?"(?P([^"\\]|\\.)*)")?\)') def parse_source(): l10n = defaultdict(lambda: []) @@ -114,13 +114,13 @@ if __name__ == '__main__': if(commenttxt): commenttxt = 'Context: '+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: if (os.path.splitext(filename)[1] == ".json" and filename != "index.json"): - filename = "data/languages/" + filename + filename = "datasrc/languages/" + filename write_languagefile(filename, l10n_src, load_languagefile(filename)) except Exception as e: print("Failed on {0}, re-raising for traceback".format(filename))