From 580855843af1d02da1004d62386125560d2199e9 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Tue, 10 May 2022 23:20:03 +0200 Subject: [PATCH 01/22] Add some of the changes made to CHANGELOG.md --- CHANGELOG.md | 3 +++ 1 file changed, 3 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc1eca2c..50e76dff 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,8 @@ **1.2.0** +- Add list view (thanks to TotalCaesar659) - Allow DLC to be queued up for downloading (thanks to flagrama) +- Fix changing library to a directory with special characters in the name (thanks to makson96) +- Translation update: Norwegian Bokmål (thanks to kimmalmo) **1.1.0** - Improve integrity check after downloading (thanks to makson96) From 82d3ecc0627ca143ce64aa3878c3945ef67dd645 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Fri, 13 May 2022 10:53:13 +0200 Subject: [PATCH 02/22] Fix signing in with Facebook by @phlash Resolves #388 --- CHANGELOG.md | 1 + README.md | 1 + data/ui/about.ui | 3 ++- minigalaxy/ui/login.py | 25 +++++++++++++++++++++++-- 4 files changed, 27 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index bc1eca2c..82537deb 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ **1.2.0** - Allow DLC to be queued up for downloading (thanks to flagrama) +- Fix signing in with Facebook (thanks to phlash) **1.1.0** - Improve integrity check after downloading (thanks to makson96) diff --git a/README.md b/README.md index 3be4d5f3..7c130ee2 100644 --- a/README.md +++ b/README.md @@ -201,6 +201,7 @@ Special thanks goes out to all contributors: - stephanlachnit for upstreaming to Debian and multiple code contributions - sgn for fixing a bug - otaconix for fixing a bug +- phlash for fixing a bug - s8321414 for translating to Taiwanese Mandarin - fuzunspm for translating to Turkish - thomansb22 for translating to French diff --git a/data/ui/about.ui b/data/ui/about.ui index 0eb8aeb1..d79285d7 100644 --- a/data/ui/about.ui +++ b/data/ui/about.ui @@ -22,7 +22,8 @@ <a href="https://github.com/stephanlachnit">Stephan Lachnit</a> <a href="https://github.com/graag">Konrad Klimaszewski</a> <a href="https://github.com/lmeunier">Laurent Meunier</a> -<a href="https://github.com/zweif">zweif</a> +<a href="https://github.com/zweif">zweif</a> +<a href="https://github.com/phlash">Phil Ashby</a> <a href="https://github.com/ArturWroblewski">Artur Wróblewski</a> <a href="https://github.com/BlindJerobine">BlindJerobine</a> <a href="https://github.com/EsdrasTarsis">Esdras Tarsis</a> diff --git a/minigalaxy/ui/login.py b/minigalaxy/ui/login.py index 3b7ac56f..aba096b8 100644 --- a/minigalaxy/ui/login.py +++ b/minigalaxy/ui/login.py @@ -21,10 +21,13 @@ def __init__(self, login_url=None, redirect_url=None, parent=None): self.redirect_url = redirect_url - context = WebKit2.WebContext.new() - webview = WebKit2.WebView.new_with_context(context) + # https://stackoverflow.com/questions/9147875/webview-dont-display-javascript-windows-open + settings = WebKit2.Settings.new() + settings.props.javascript_can_open_windows_automatically = True + webview = WebKit2.WebView.new_with_settings(settings) webview.load_uri(login_url) webview.connect('load-changed', self.on_navigation) + webview.connect('create', self.on_create) self.box.pack_start(webview, True, True, 0) self.show_all() @@ -37,6 +40,24 @@ def on_navigation(self, widget, load_event): self.result = self.__get_code_from_url(uri) self.hide() + # Create any pop-up windows during authentication + def on_create(self, widget, action): + popup = Gtk.Dialog(title=_("Facebook Login"), parent=self, flags=0, buttons=()) + webview = WebKit2.WebView.new_with_related_view(widget) + webview.load_uri(action.get_request().get_uri()) + webview.__dict__['popup'] = popup + webview.connect('close', self.on_close_popup) + popup.get_content_area().pack_start(webview, True, True, 0) + popup.set_size_request(400, 600) + popup.set_modal(True) + popup.show_all() + return webview + + # When a pop up is closed (by Javascript), close the Gtk window too + def on_close_popup(self, widget): + if 'popup' in widget.__dict__: + widget.__dict__['popup'].hide() + # Return the code when can be used by the API to authenticate def get_result(self): return self.result From 2d595ced4caea6196f9eec8f19add4323cd3a28c Mon Sep 17 00:00:00 2001 From: jakbuz23 <48175696+jakbuz23@users.noreply.github.com> Date: Sat, 14 May 2022 14:20:08 +0200 Subject: [PATCH 03/22] Updated czech translation --- data/po/cs_CZ.po | 239 ++++++++++++++++++++++++++++++++--------------- 1 file changed, 162 insertions(+), 77 deletions(-) diff --git a/data/po/cs_CZ.po b/data/po/cs_CZ.po index e609fb1a..c8ad434f 100644 --- a/data/po/cs_CZ.po +++ b/data/po/cs_CZ.po @@ -7,16 +7,16 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2021-11-26 14:30-0800\n" -"PO-Revision-Date: 2021-11-02 14:19+0100\n" +"POT-Creation-Date: 2022-05-14 13:59+0200\n" +"PO-Revision-Date: 2022-05-14 14:17+0200\n" "Last-Translator: \n" "Language-Team: \n" "Language: cs_CZ\n" "MIME-Version: 1.0\n" "Content-Type: text/plain; charset=UTF-8\n" "Content-Transfer-Encoding: 8bit\n" -"X-Generator: Poedit 3.0\n" "Plural-Forms: nplurals=3; plural=(n==1 ? 0 : n>=2 && n<=4 ? 1 : 2);\n" +"X-Generator: Poedit 3.0.1\n" #. A short description of what Minigalaxy is #: data/ui/about.ui:10 @@ -34,23 +34,23 @@ msgctxt "about" msgid "About" msgstr "O aplikaci" -#: data/ui/properties.ui:129 +#: data/ui/properties.ui:265 msgid "Added at the end of the command used to launch the game" msgstr "Přidáno na konec příkazu pro spuštění hry" -#: data/ui/properties.ui:141 +#: data/ui/properties.ui:240 msgid "Added in front of the command used to launch the game" msgstr "Přidáno před příkaz pro spuštění hry" -#: minigalaxy/ui/gametile.py:132 +#: minigalaxy/ui/gametilelist.py:143 minigalaxy/ui/gametile.py:140 msgid "Are you sure you want to cancel downloading {}?" msgstr "Opravdu chcete zrušit stahování {}?" -#: minigalaxy/ui/window.py:100 +#: minigalaxy/ui/window.py:98 msgid "Are you sure you want to log out of GOG?" msgstr "Opravdu se chcete odhlásit z GOG?" -#: minigalaxy/ui/gametile.py:145 +#: minigalaxy/ui/gametilelist.py:156 minigalaxy/ui/gametile.py:153 #, python-format msgid "Are you sure you want to uninstall %s?" msgstr "Opravdu chcete odinstalovat %s?" @@ -59,7 +59,7 @@ msgstr "Opravdu chcete odinstalovat %s?" msgid "Brazilian Portuguese" msgstr "Brazilská portugalština" -#: data/ui/properties.ui:266 +#: data/ui/properties.ui:336 msgid "Cancel" msgstr "Zrušit" @@ -68,24 +68,33 @@ msgctxt "cancel" msgid "Cancel" msgstr "Zrušit" +#: data/ui/properties.ui:103 +msgid "Check for updates:" +msgstr "Kontrolovat aktualizace:" + #: minigalaxy/constants.py:8 msgid "Chinese" msgstr "Čínština" -#: data/ui/properties.ui:180 +#: data/ui/properties.ui:253 msgid "Command flags:" -msgstr "Možnosti příkazu:" +msgstr "Příznaky příkazu:" + +#: minigalaxy/ui/information.py:72 minigalaxy/ui/information.py:82 +#: minigalaxy/ui/information.py:92 +msgid "Couldn't open forum page" +msgstr "Stránku fóra se nepodařilo otevřít" -#: minigalaxy/ui/properties.py:103 +#: minigalaxy/ui/information.py:62 msgid "Couldn't open store page" msgstr "Stránku obchodu se nepodařilo otevřít" -#: minigalaxy/ui/properties.py:93 +#: minigalaxy/ui/information.py:52 msgid "Couldn't open support page" msgstr "Stránku podpory se nepodařilo otevřít" #. Has to end with ": " -#: data/ui/preferences.ui:288 +#: data/ui/preferences.ui:313 msgctxt "create_menu_shortcuts" msgid "Create menu shortcuts: " msgstr "Vytvořit zástupce: " @@ -94,15 +103,16 @@ msgstr "Vytvořit zástupce: " msgid "Czech" msgstr "Čeština" -#: data/ui/gametile.ui:178 +#: data/ui/gametilelist.ui:194 data/ui/gametile.ui:193 msgid "DLC" -msgstr "Stažitelný obsah" +msgstr "Stažitelný obsah (DLC)" #: minigalaxy/constants.py:9 msgid "Danish" msgstr "Dánština" -#: minigalaxy/ui/gametile.py:207 minigalaxy/ui/gametile.py:237 +#: minigalaxy/ui/gametilelist.py:222 minigalaxy/ui/gametilelist.py:252 +#: minigalaxy/ui/gametile.py:219 minigalaxy/ui/gametile.py:249 msgid "Download error" msgstr "Chyba stahování" @@ -114,7 +124,11 @@ msgstr "Nizozemština" msgid "English" msgstr "Angličtina" -#: minigalaxy/ui/preferences.py:102 +#: minigalaxy/ui/login.py:45 +msgid "Facebook Login" +msgstr "Přihlásit pomocí Facebooku" + +#: minigalaxy/ui/preferences.py:122 msgid "" "Failed to change program language. Make sure locale is generated on your " "system." @@ -122,15 +136,16 @@ msgstr "" "Nepodařilo se změnit jazyk aplikace. Ujistěte se, že je na Vašem systému " "vygenerováno příslušné locale." -#: minigalaxy/ui/gametile.py:301 +#: minigalaxy/ui/gametilelist.py:318 minigalaxy/ui/gametile.py:315 msgid "Failed to install {}" msgstr "Instalace {} se nezdařila" -#: minigalaxy/ui/library.py:141 +#: minigalaxy/ui/library.py:146 msgid "Failed to retrieve library" msgstr "Získání knihovny se nezdařilo" -#: minigalaxy/launcher.py:34 minigalaxy/ui/gametile.py:122 +#: minigalaxy/launcher.py:52 minigalaxy/ui/gametilelist.py:127 +#: minigalaxy/ui/gametile.py:124 msgid "Failed to start {}:" msgstr "{} se nezdařilo spustit:" @@ -138,11 +153,19 @@ msgstr "{} se nezdařilo spustit:" msgid "Finnish" msgstr "Finština" +#: data/ui/information.ui:89 +msgid "Forum" +msgstr "Fórum" + #: minigalaxy/constants.py:13 minigalaxy/constants.py:35 msgid "French" msgstr "Francouzština" -#: minigalaxy/ui/properties.py:140 +#: minigalaxy/ui/properties.py:82 +msgid "GameMode wasn't found. Using GameMode cannot be enabled." +msgstr "GameMode nebyl nalezen. GameMode nelze zapnout." + +#: minigalaxy/ui/information.py:138 msgid "Genre" msgstr "Žánr" @@ -156,7 +179,11 @@ msgctxt "github_page_link" msgid "GitHub page" msgstr "Stránka na GitHubu" -#: data/ui/properties.ui:105 +#: minigalaxy/constants.py:52 +msgid "Grid" +msgstr "Mřížka" + +#: data/ui/properties.ui:153 msgid "Hide game:" msgstr "Skrýt hru:" @@ -164,16 +191,24 @@ msgstr "Skrýt hru:" msgid "Hungarian" msgstr "Maďarština" +#: data/ui/gametilelist.ui:239 data/ui/gametile.ui:223 +msgid "Information" +msgstr "Informace" + +#: minigalaxy/ui/information.py:28 +msgid "Information about {}" +msgstr "Informace o {}" + #: minigalaxy/installer.py:147 msgid "Innoextract extraction failed." msgstr "Rozbalení pomocí Innoextract se nezdařilo." -#: minigalaxy/installer.py:158 +#: minigalaxy/installer.py:164 msgid "Innoextract not installed." msgstr "Innoextract není nainstalován." -#. The place directory in which games are installed. Ends with ": ". -#: data/ui/preferences.ui:118 +#. The place directory in which games are installed. Has to end with ": " +#: data/ui/preferences.ui:143 msgctxt "install_path" msgid "Installation path: " msgstr "Cesta pro instalaci: " @@ -192,7 +227,7 @@ msgstr "Italština" msgid "Japanese" msgstr "Japonština" -#: minigalaxy/ui/preferences.py:46 +#: minigalaxy/ui/preferences.py:48 msgid "" "Keep installers after downloading a game.\n" "Installers are stored in: {}" @@ -200,8 +235,8 @@ msgstr "" "Ponechat instalátory po stažení hry.\n" "Instalátory jsou uloženy v: {}" -#. Whether installer files are kept after download. Ends with ": ". -#: data/ui/preferences.ui:145 +#. Whether installer files are kept after download. Has to end with ": " +#: data/ui/preferences.ui:170 msgctxt "keep_installer" msgid "Keep installers: " msgstr "Ponechat instalátory: " @@ -210,12 +245,16 @@ msgstr "Ponechat instalátory: " msgid "Korean" msgstr "Korejština" -#. The preferred language on Minigalaxy start. Ends with ": ". +#. The preferred language on Minigalaxy start. Has to end with ": " #: data/ui/preferences.ui:68 msgctxt "language" msgid "Language: " msgstr "Jazyk: " +#: minigalaxy/constants.py:53 +msgid "List" +msgstr "Seznam" + #: minigalaxy/ui/login.py:20 msgid "Login" msgstr "Přihlášení" @@ -226,7 +265,11 @@ msgctxt "logout" msgid "Logout" msgstr "Odhlásit" -#: minigalaxy/launcher.py:179 +#: minigalaxy/ui/properties.py:87 +msgid "MangoHud wasn't found. Using MangoHud cannot be enabled." +msgstr "MangoHud nebyl nalezen. MangoHud nelze zapnout." + +#: minigalaxy/launcher.py:205 msgid "No executable was found in {}" msgstr "{} neobsahuje žádný spustitelný soubor" @@ -246,15 +289,17 @@ msgstr "Norština Nynorsk" msgid "Not enough space to extract game. Required: {} Available: {}" msgstr "Nedostatek místa pro rozbalení hry. Požadované: {} Dostupné: {}" -#: data/ui/properties.ui:280 +#: data/ui/information.ui:165 data/ui/properties.ui:350 msgid "OK" msgstr "Budiž" -#: data/ui/properties.ui:216 +#: data/ui/properties.ui:74 msgid "Open files" msgstr "Otevřít soubory" -#: minigalaxy/ui/properties.py:94 minigalaxy/ui/properties.py:104 +#: minigalaxy/ui/information.py:53 minigalaxy/ui/information.py:63 +#: minigalaxy/ui/information.py:73 minigalaxy/ui/information.py:83 +#: minigalaxy/ui/information.py:93 msgid "Please check your internet connection" msgstr "Zkontrolujte připojení k internetu" @@ -266,7 +311,7 @@ msgstr "Polština" msgid "Portuguese" msgstr "Portugalština" -#: minigalaxy/ui/preferences.py:30 +#: minigalaxy/ui/preferences.py:31 msgid "Preferences" msgstr "Možnosti" @@ -276,17 +321,17 @@ msgctxt "preferences" msgid "Preferences" msgstr "Možnosti" -#. Preferred language for downloading games in. Ends with ": ". +#. Preferred language for downloading games in. Has to end with ": " #: data/ui/preferences.ui:93 msgctxt "preferred_game_language" msgid "Preferred game language: " msgstr "Preferovaný jazyk hry: " -#: data/ui/gametile.ui:223 +#: data/ui/gametilelist.ui:254 data/ui/gametile.ui:238 msgid "Properties" msgstr "Možnosti" -#: minigalaxy/ui/properties.py:33 +#: minigalaxy/ui/properties.py:34 msgid "Properties of {}" msgstr "Možnosti {}" @@ -296,10 +341,14 @@ msgctxt "refresh" msgid "Refresh game list" msgstr "Obnovit seznam her" -#: data/ui/properties.ui:203 +#: data/ui/properties.ui:48 msgid "Regedit" msgstr "Regedit" +#: data/ui/properties.ui:275 +msgid "Reset wine executable" +msgstr "Obnovit cestu k wine" + #: minigalaxy/constants.py:22 minigalaxy/constants.py:41 msgid "Russian" msgstr "Ruština" @@ -310,18 +359,18 @@ msgctxt "save" msgid "Save" msgstr "Uložit" -#: data/ui/properties.ui:154 +#: data/ui/properties.ui:128 msgid "Show FPS in game:" msgstr "Zobrazit FPS ve hře:" #. Has to end with ": " -#: data/ui/preferences.ui:250 +#: data/ui/preferences.ui:275 msgctxt "show_windows_games" msgid "Show Windows games: " msgstr "Zobrazit hry pro Windows: " #. Has to end with ": " -#: data/ui/preferences.ui:224 +#: data/ui/preferences.ui:249 msgctxt "show_hidden_games" msgid "Show hidden games: " msgstr "Zobrazit skryté hry: " @@ -340,21 +389,25 @@ msgstr "Zjednodušená čínština" msgid "Spanish" msgstr "Španělština" -#. Whether the user will stay logged in after closing Minigalaxy. Ends with ": ". -#: data/ui/preferences.ui:171 +#: minigalaxy/constants.py:44 +msgid "Spanish (Spain)" +msgstr "Španělština (Španělsko)" + +#. Whether the user will stay logged in after closing Minigalaxy. Has to end with ": " +#: data/ui/preferences.ui:196 msgctxt "stay_logged_in" msgid "Stay logged in:" msgstr "Zapamatovat přihlášení:" -#: data/ui/properties.ui:77 +#: data/ui/information.ui:76 msgid "Store" msgstr "Obchod" -#: data/ui/properties.ui:63 +#: data/ui/information.ui:63 msgid "Support" msgstr "Podpora" -#: minigalaxy/constants.py:24 minigalaxy/constants.py:44 +#: minigalaxy/constants.py:24 minigalaxy/constants.py:45 msgid "Swedish" msgstr "Švédština" @@ -376,7 +429,12 @@ msgctxt "language_tooltip" msgid "The preferred language on Minigalaxy start" msgstr "Preferovaný jazyk pro Minigalaxy" -#: minigalaxy/ui/gametile.py:208 +#: data/ui/preferences.ui:115 +msgctxt "view_tooltip" +msgid "The preferred view of game library" +msgstr "Preferované zobrazení knihovny" + +#: minigalaxy/ui/gametilelist.py:223 minigalaxy/ui/gametile.py:220 msgid "" "There was an error when trying to fetch the download link!\n" "{}" @@ -384,117 +442,144 @@ msgstr "" "Došlo k chybě při získávání odkazu pro stažení!\n" "{}" -#: data/ui/preferences.ui:115 +#: data/ui/preferences.ui:140 msgctxt "install_path_tooltip" msgid "This is where games will be installed" msgstr "Sem se budou instalovat hry" -#: minigalaxy/constants.py:45 +#: minigalaxy/constants.py:46 msgid "Traditional Chinese" msgstr "Tradiční čínština" -#: minigalaxy/constants.py:25 minigalaxy/constants.py:46 +#: minigalaxy/constants.py:25 minigalaxy/constants.py:47 msgid "Turkish" msgstr "Turečtina" -#: minigalaxy/constants.py:47 +#: minigalaxy/constants.py:48 msgid "Ukrainian" msgstr "Ukrajinština" -#: data/ui/gametile.ui:208 +#: data/ui/gametilelist.ui:224 data/ui/gametile.ui:208 msgid "Uninstall" msgstr "Odinstalovat" -#: data/ui/gametile.ui:193 +#: data/ui/gametilelist.ui:209 data/ui/gametile.ui:172 msgid "Update" msgstr "Aktualizovat" +#: data/ui/properties.ui:178 +msgid "Use GameMode:" +msgstr "Použít GameMode:" + +#: data/ui/properties.ui:203 +msgid "Use MangoHud:" +msgstr "Použít MangoHud:" + #. Has to end with ": " -#: data/ui/preferences.ui:198 +#: data/ui/preferences.ui:223 msgctxt "use_dark_theme" msgid "Use dark theme: " msgstr "Použít tmavé téma: " -#: data/ui/properties.ui:167 +#: data/ui/properties.ui:228 msgid "Variable flags:" -msgstr "Argumenty příkazu:" +msgstr "Příznaky proměnných:" -#: minigalaxy/ui/properties.py:142 +#: minigalaxy/ui/information.py:140 msgid "Version" msgstr "Verze" -#: data/ui/preferences.ui:168 +#. The preferred view of game library. Has to end with ": " +#: data/ui/preferences.ui:118 +msgctxt "view" +msgid "View: " +msgstr "Zobrazení: " + +#: data/ui/preferences.ui:193 msgctxt "stay_logged_in_tooltip" msgid "When disabled you'll be asked to log in each time Minigalaxy is started" msgstr "" "Pokud je tato možnost vypnuta, budete se muset přihlásit při každém startu " "programu Minigalaxy" -#: data/ui/preferences.ui:195 +#: data/ui/preferences.ui:220 msgctxt "use_dark_theme_tooltip" msgid "Whether Minigalaxy should use dark theme or not" msgstr "Určuje zdali se použije tmavý vzhled" -#: data/ui/preferences.ui:247 +#: data/ui/preferences.ui:272 msgctxt "show_windows_games_tooltip" msgid "Whether Windows games are shown in the library or not" msgstr "Určuje zdali se mají zobrazovat hry pro Windows" -#: data/ui/preferences.ui:221 +#: data/ui/preferences.ui:246 msgctxt "show_hidden_games_tooltip" msgid "Whether hidden games are shown in the library or not" msgstr "Určuje zdali se mají zobrazovat skryté hry" -#: data/ui/preferences.ui:285 +#: data/ui/preferences.ui:310 msgctxt "create_menu_shortcuts_tooltip" msgid "Whether shortcuts are created for newly installed games or not" msgstr "Určuje zdali se mají vytvářet zástupci pro nově nainstalované hry" -#: minigalaxy/installer.py:172 +#: data/ui/properties.ui:291 +msgid "Wine executable:" +msgstr "Cesta k wine:" + +#: minigalaxy/installer.py:178 msgid "Wine extraction failed." msgstr "Rozbalení Wine se nezdařilo." -#: minigalaxy/ui/preferences.py:162 +#: minigalaxy/ui/preferences.py:192 msgid "Wine wasn't found. Showing Windows games cannot be enabled." msgstr "Wine nebyl nalezen. Zobrazení her pro Windows nemůže být zapnuto." -#: data/ui/properties.ui:190 +#: data/ui/properties.ui:61 msgid "Winecfg" msgstr "Winecfg" -#: minigalaxy/ui/gametile.py:460 +#: data/ui/properties.ui:87 +msgid "Winetricks" +msgstr "Winetricks" + +#: minigalaxy/ui/properties.py:113 +msgid "Winetricks wasn't found and cannot be used." +msgstr "Winetricks nebyl nalezen a nemůže být použit." + +#: minigalaxy/ui/gametilelist.py:483 minigalaxy/ui/gametile.py:480 msgid "download" msgstr "stáhnout" -#: minigalaxy/ui/gametile.py:500 +#: minigalaxy/ui/gametilelist.py:523 minigalaxy/ui/gametile.py:520 msgid "downloading…" msgstr "stahování…" -#: minigalaxy/ui/gametile.py:491 +#: minigalaxy/ui/gametilelist.py:514 minigalaxy/ui/gametile.py:511 msgid "in queue…" msgstr "ve frontě…" -#: minigalaxy/ui/gametile.py:479 +#: minigalaxy/ui/gametilelist.py:502 minigalaxy/ui/gametile.py:499 msgid "install" msgstr "nainstalovat" -#: minigalaxy/ui/gametile.py:511 +#: minigalaxy/ui/gametilelist.py:534 minigalaxy/ui/gametile.py:531 msgid "installing…" msgstr "instalace…" -#: minigalaxy/ui/gametile.py:526 minigalaxy/ui/gametile.py:556 +#: minigalaxy/ui/gametilelist.py:549 minigalaxy/ui/gametilelist.py:579 +#: minigalaxy/ui/gametile.py:546 minigalaxy/ui/gametile.py:576 msgid "play" msgstr "hrát" -#: minigalaxy/ui/gametile.py:542 +#: minigalaxy/ui/gametilelist.py:565 minigalaxy/ui/gametile.py:562 msgid "uninstalling…" msgstr "odinstalace…" -#: minigalaxy/ui/properties.py:136 +#: minigalaxy/ui/information.py:134 msgid "unknown" -msgstr "" +msgstr "neznámé" -#: minigalaxy/ui/gametile.py:565 +#: minigalaxy/ui/gametilelist.py:588 minigalaxy/ui/gametile.py:585 msgid "updating…" msgstr "aktualizace…" @@ -506,7 +591,7 @@ msgstr "{} nemohl být rozbalen." msgid "{} failed to download." msgstr "{} se nezdařilo stáhnout." -#: minigalaxy/ui/preferences.py:174 +#: minigalaxy/ui/preferences.py:204 msgid "{} isn't a usable path" msgstr "{} není použitelná cesta" From 38636256d56b57fabe9dd73acc05ab36d7f08a59 Mon Sep 17 00:00:00 2001 From: jakbuz23 <48175696+jakbuz23@users.noreply.github.com> Date: Thu, 2 Jun 2022 09:38:26 +0200 Subject: [PATCH 04/22] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 82537deb..48f610f8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,6 +1,7 @@ **1.2.0** - Allow DLC to be queued up for downloading (thanks to flagrama) - Fix signing in with Facebook (thanks to phlash) +- Updated Czech translation (thanks to jakbuz23) **1.1.0** - Improve integrity check after downloading (thanks to makson96) From 8bea90718b72486e366a0750e145bc9cca3c9410 Mon Sep 17 00:00:00 2001 From: Athanasios Nektarios Karachalios Stagkas <41343849+Pyrofanis@users.noreply.github.com> Date: Fri, 3 Jun 2022 10:40:59 +0300 Subject: [PATCH 05/22] Add Greek Translation (#495) --- CHANGELOG.md | 1 + data/po/el.po | 619 ++++++++++++++++++++++++++++++++++++++++ minigalaxy/constants.py | 1 + 3 files changed, 621 insertions(+) create mode 100644 data/po/el.po diff --git a/CHANGELOG.md b/CHANGELOG.md index 48f610f8..cb0257b1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -2,6 +2,7 @@ - Allow DLC to be queued up for downloading (thanks to flagrama) - Fix signing in with Facebook (thanks to phlash) - Updated Czech translation (thanks to jakbuz23) +- Added Greek translation (thanks to Pyrofanis) **1.1.0** - Improve integrity check after downloading (thanks to makson96) diff --git a/data/po/el.po b/data/po/el.po new file mode 100644 index 00000000..3bd51b2d --- /dev/null +++ b/data/po/el.po @@ -0,0 +1,619 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2022-06-02 18:47+0300\n" +"PO-Revision-Date: 2022-06-02 18:51+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: el\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"Plural-Forms: nplurals=2; plural=(n != 1);\n" +"X-Generator: Poedit 3.0.1\n" + +#. A short description of what Minigalaxy is +#: data/ui/about.ui:10 +msgctxt "short_description" +msgid "A simple GOG client for Linux" +msgstr "Ένας απλός εξυπηρετητής για το GOG" + +#: minigalaxy/ui/about.py:13 +msgid "About" +msgstr "Περί" + +#. Opens about dialog +#: data/ui/application.ui:58 +msgctxt "about" +msgid "About" +msgstr "Περί" + +#: data/ui/properties.ui:265 +msgid "Added at the end of the command used to launch the game" +msgstr "" +"Χρησιμοποιείται για την εκκίνηση του παιχνιδιού,Προστίθεται στο τέλος της " +"εντολής" + +#: data/ui/properties.ui:240 +msgid "Added in front of the command used to launch the game" +msgstr "" +"Χρησιμοποιείται για την εκκίνηση του παιχνιδιού,Προστίθεται στην αρχή της " +"εντολής" + +#: minigalaxy/ui/gametilelist.py:143 minigalaxy/ui/gametile.py:140 +msgid "Are you sure you want to cancel downloading {}?" +msgstr "Είστε σίγουρος/η ότι θέλετε να ακυρώσετε την εγκατάσταση του {};" + +#: minigalaxy/ui/window.py:98 +msgid "Are you sure you want to log out of GOG?" +msgstr "Είστε σίγουρος/η ότι θέλετε να αποσυνδεθείτε από το GOG;" + +#: minigalaxy/ui/gametilelist.py:156 minigalaxy/ui/gametile.py:153 +#, python-format +msgid "Are you sure you want to uninstall %s?" +msgstr "Είστε σίγουρος/η ότι θέλετε να απεγκαταστήσετε το %s ;" + +#: minigalaxy/constants.py:7 minigalaxy/constants.py:30 +msgid "Brazilian Portuguese" +msgstr "Πορτογαλικά (Βραζιλίας)" + +#: data/ui/properties.ui:336 +msgid "Cancel" +msgstr "Ακύρωση" + +#: data/ui/preferences.ui:20 +msgctxt "cancel" +msgid "Cancel" +msgstr "Ακύρωση" + +#: data/ui/properties.ui:103 +msgid "Check for updates:" +msgstr "Έλεγχος για ενημερώσεις:" + +#: minigalaxy/constants.py:8 +msgid "Chinese" +msgstr "Κινεζικά" + +#: data/ui/properties.ui:253 +msgid "Command flags:" +msgstr "Παράμετροι εντολών:" + +#: minigalaxy/ui/information.py:72 minigalaxy/ui/information.py:82 +#: minigalaxy/ui/information.py:92 +msgid "Couldn't open forum page" +msgstr "Δεν μπορούσαμε να ανοίξουμε την σελίδα φόρουμ" + +#: minigalaxy/ui/information.py:62 +msgid "Couldn't open store page" +msgstr "Δεν μπορούσαμε να ανοίξουμε την σελίδα του καταστήματος" + +#: minigalaxy/ui/information.py:52 +msgid "Couldn't open support page" +msgstr "Δεν μπορούσαμε να ανοίξουμε την σελίδα υποστήριξης" + +#. Has to end with ": " +#: data/ui/preferences.ui:313 +msgctxt "create_menu_shortcuts" +msgid "Create menu shortcuts: " +msgstr "Δημιουργία καταχωρίσεων μενού: " + +#: minigalaxy/constants.py:31 +msgid "Czech" +msgstr "Τσέχικα" + +#: data/ui/gametilelist.ui:194 data/ui/gametile.ui:193 +msgid "DLC" +msgstr "DLC" + +#: minigalaxy/constants.py:9 +msgid "Danish" +msgstr "Δανέζικα" + +#: minigalaxy/ui/gametilelist.py:222 minigalaxy/ui/gametilelist.py:252 +#: minigalaxy/ui/gametile.py:219 minigalaxy/ui/gametile.py:249 +msgid "Download error" +msgstr "Σφάλμα κατα την διαρκεια κατεβασματος" + +#: minigalaxy/constants.py:10 minigalaxy/constants.py:32 +msgid "Dutch" +msgstr "Ολλανδικά" + +#: minigalaxy/constants.py:11 minigalaxy/constants.py:33 +msgid "English" +msgstr "Αγγλικά" + +#: minigalaxy/ui/login.py:45 +msgid "Facebook Login" +msgstr "Σύνδεση μέσο Facebook" + +#: minigalaxy/ui/preferences.py:122 +msgid "" +"Failed to change program language. Make sure locale is generated on your " +"system." +msgstr "" +"Αδυναμία αλλαγής γλωσσάς προγράμματος.Βεβαιωθείτε ότι έχει δημιουργηθεί η " +"καταχώρηση τοπικότητας στο σύστημα σας." + +#: minigalaxy/ui/gametilelist.py:318 minigalaxy/ui/gametile.py:315 +msgid "Failed to install {}" +msgstr "Αδυναμία εγκατάστασης {}" + +#: minigalaxy/ui/library.py:146 +msgid "Failed to retrieve library" +msgstr "Αδυναμία εύρεσης βιβλιοθήκης" + +#: minigalaxy/launcher.py:52 minigalaxy/ui/gametilelist.py:127 +#: minigalaxy/ui/gametile.py:124 +msgid "Failed to start {}:" +msgstr "Αδυναμία έναρξης {}:" + +#: minigalaxy/constants.py:12 minigalaxy/constants.py:34 +msgid "Finnish" +msgstr "Φινλανδικά" + +#: data/ui/information.ui:89 +msgid "Forum" +msgstr "Φόρουμ" + +#: minigalaxy/constants.py:13 minigalaxy/constants.py:35 +msgid "French" +msgstr "Γαλλικά" + +#: minigalaxy/ui/properties.py:82 +msgid "GameMode wasn't found. Using GameMode cannot be enabled." +msgstr "" +"Αποτυχία εύρεσης του GameMode. Δεν είναι δυνατή η ενεργοποιήσει χρίσης " +"GameMode." + +#: minigalaxy/ui/information.py:138 +msgid "Genre" +msgstr "Είδος" + +#: minigalaxy/constants.py:14 minigalaxy/constants.py:36 +msgid "German" +msgstr "Γερμανικά" + +#. A link to the GitHub page +#: data/ui/about.ui:12 +msgctxt "github_page_link" +msgid "GitHub page" +msgstr "Σελίδα GitHub" + +#: minigalaxy/constants.py:49 +msgid "Greek" +msgstr "Ελληνικά" + +#: minigalaxy/constants.py:53 +msgid "Grid" +msgstr "Πλέγμα" + +#: data/ui/properties.ui:153 +msgid "Hide game:" +msgstr "Απόκρυψη παιχνιδιού:" + +#: minigalaxy/constants.py:15 +msgid "Hungarian" +msgstr "Ουγγαρέζικα" + +#: data/ui/gametilelist.ui:239 data/ui/gametile.ui:223 +msgid "Information" +msgstr "Πληροφορίες" + +#: minigalaxy/ui/information.py:28 +msgid "Information about {}" +msgstr "Πληροφορίες περί {}" + +#: minigalaxy/installer.py:147 +msgid "Innoextract extraction failed." +msgstr "Αποτυχία αποσυμπίεσης Innoextract." + +#: minigalaxy/installer.py:164 +msgid "Innoextract not installed." +msgstr "Δεν εγκαταστάθηκε το Innoextract." + +#. The place directory in which games are installed. Has to end with ": " +#: data/ui/preferences.ui:143 +msgctxt "install_path" +msgid "Installation path: " +msgstr "Προορισμός εγκατάστασης: " + +#. Used next to a checkbox which switches between showing all games and only installed ones +#: data/ui/application.ui:116 +msgctxt "installed" +msgid "Installed" +msgstr "Εγκατεστημένα" + +#: minigalaxy/constants.py:16 minigalaxy/constants.py:37 +msgid "Italian" +msgstr "Ιταλικά" + +#: minigalaxy/constants.py:17 +msgid "Japanese" +msgstr "Ιαπωνικά" + +#: minigalaxy/ui/preferences.py:48 +msgid "" +"Keep installers after downloading a game.\n" +"Installers are stored in: {}" +msgstr "" +"Διατήρηση αρχείων εγκατάστασης μετά από την λήψη \n" +"Τα αρχεία αποθηκεύονται στον: {}" + +#. Whether installer files are kept after download. Has to end with ": " +#: data/ui/preferences.ui:170 +msgctxt "keep_installer" +msgid "Keep installers: " +msgstr "Διατήρηση αρχείων εγκατάστασης: " + +#: minigalaxy/constants.py:18 +msgid "Korean" +msgstr "Κορεάτικα" + +#. The preferred language on Minigalaxy start. Has to end with ": " +#: data/ui/preferences.ui:68 +msgctxt "language" +msgid "Language: " +msgstr "Γλώσσα: " + +#: minigalaxy/constants.py:54 +msgid "List" +msgstr "Λίστα" + +#: minigalaxy/ui/login.py:20 +msgid "Login" +msgstr "Σύνδεση" + +#. Logs the users gog account out and returns to login page +#: data/ui/application.ui:17 +msgctxt "logout" +msgid "Logout" +msgstr "Αποσύνδεση" + +#: minigalaxy/ui/properties.py:87 +msgid "MangoHud wasn't found. Using MangoHud cannot be enabled." +msgstr "" +"Αποτυχία εύρεσης του MangoHud. Δεν είναι δυνατή η ενεργοποιήσει χρίσης " +"MangoHud." + +#: minigalaxy/launcher.py:205 +msgid "No executable was found in {}" +msgstr "Αποτυχία εύρεσης εκτελέσιμου {}" + +#: minigalaxy/constants.py:19 +msgid "Norwegian" +msgstr "Νορβηγικά" + +#: minigalaxy/constants.py:38 +msgid "Norwegian Bokmål" +msgstr "Νορβηγικά Bokmål" + +#: minigalaxy/constants.py:39 +msgid "Norwegian Nynorsk" +msgstr "Νορβηγικά Nynorsk" + +#: minigalaxy/installer.py:97 +msgid "Not enough space to extract game. Required: {} Available: {}" +msgstr "" +"Δεν επαρκεί χώρος για την αποσυμπίεση του παιχνιδιού.Χρειάζονται:{}Διαθέσιμα:" +"{}" + +#: data/ui/information.ui:165 data/ui/properties.ui:350 +msgid "OK" +msgstr "Εντάξει" + +#: data/ui/properties.ui:74 +msgid "Open files" +msgstr "Άνοιγμα αρχείων" + +#: minigalaxy/ui/information.py:53 minigalaxy/ui/information.py:63 +#: minigalaxy/ui/information.py:73 minigalaxy/ui/information.py:83 +#: minigalaxy/ui/information.py:93 +msgid "Please check your internet connection" +msgstr "Παρακαλώ ελέγξτε την σύνδεση του δικτύου σας" + +#: minigalaxy/constants.py:20 minigalaxy/constants.py:40 +msgid "Polish" +msgstr "Πολωνικά" + +#: minigalaxy/constants.py:21 +msgid "Portuguese" +msgstr "Πορτογάλικα" + +#: minigalaxy/ui/preferences.py:31 +msgid "Preferences" +msgstr "Προτιμήσεις" + +#. Opens preferences dialog +#: data/ui/application.ui:32 +msgctxt "preferences" +msgid "Preferences" +msgstr "Προτιμήσεις" + +#. Preferred language for downloading games in. Has to end with ": " +#: data/ui/preferences.ui:93 +msgctxt "preferred_game_language" +msgid "Preferred game language: " +msgstr "Προεπιλεγμένη γλωσσά παιχνιδιών: " + +#: data/ui/gametilelist.ui:254 data/ui/gametile.ui:238 +msgid "Properties" +msgstr "Ιδιότητες" + +#: minigalaxy/ui/properties.py:34 +msgid "Properties of {}" +msgstr "Ιδιότητες του {}" + +#. Tooltip for refresh button +#: data/ui/application.ui:89 +msgctxt "refresh" +msgid "Refresh game list" +msgstr "Ανανέωση λίστας παιχνιδιών" + +#: data/ui/properties.ui:48 +msgid "Regedit" +msgstr "Επεξεργασία μητρώου wine" + +#: data/ui/properties.ui:275 +msgid "Reset wine executable" +msgstr "Επαναφορά εκτελέσιμου wine" + +#: minigalaxy/constants.py:22 minigalaxy/constants.py:41 +msgid "Russian" +msgstr "Ρώσικα" + +#. Saves the preferences +#: data/ui/preferences.ui:34 +msgctxt "save" +msgid "Save" +msgstr "Αποθήκευση" + +#: data/ui/properties.ui:128 +msgid "Show FPS in game:" +msgstr "Προβολή FPS στο παιχνίδι:" + +#. Has to end with ": " +#: data/ui/preferences.ui:275 +msgctxt "show_windows_games" +msgid "Show Windows games: " +msgstr "Προβολή παιχνιδιών Windows: " + +#. Has to end with ": " +#: data/ui/preferences.ui:249 +msgctxt "show_hidden_games" +msgid "Show hidden games: " +msgstr "Προβολή κρυφών παιχνιδιών: " + +#. Tooltip for the switch which allows only showing installed games or all games +#: data/ui/application.ui:105 +msgctxt "tooltip_installed" +msgid "Show only installed games" +msgstr "Προβολή μόνο εγκατεστημένων παιχνιδιών" + +#: minigalaxy/constants.py:42 +msgid "Simplified Chinese" +msgstr "Κινεζικά Απλοποιημένα" + +#: minigalaxy/constants.py:23 minigalaxy/constants.py:43 +msgid "Spanish" +msgstr "Ισπανικά" + +#: minigalaxy/constants.py:44 +msgid "Spanish (Spain)" +msgstr "Ισπανικά (Ισπανίας)" + +#. Whether the user will stay logged in after closing Minigalaxy. Has to end with ": " +#: data/ui/preferences.ui:196 +msgctxt "stay_logged_in" +msgid "Stay logged in:" +msgstr "Διατήρηση Σύνδεσης:" + +#: data/ui/information.ui:76 +msgid "Store" +msgstr "Κατάστημα" + +#: data/ui/information.ui:63 +msgid "Support" +msgstr "Υποστήριξη" + +#: minigalaxy/constants.py:24 minigalaxy/constants.py:45 +msgid "Swedish" +msgstr "Σουηδικά" + +#: minigalaxy/constants.py:29 +msgid "System default" +msgstr "Προκαθορισμένη Συστήματος" + +#: minigalaxy/installer.py:128 +msgid "The installation of {} failed. Please try again." +msgstr "Η εγκατάσταση του {} απέτυχε.Παρακαλώ προσπαθήστε ξανά." + +#: data/ui/preferences.ui:90 +msgctxt "preferred_game_language_tooltip" +msgid "The preferred language for downloading games in" +msgstr "Επιθυμητή γλωσσά για την λήψη παιχνιδιών" + +#: data/ui/preferences.ui:65 +msgctxt "language_tooltip" +msgid "The preferred language on Minigalaxy start" +msgstr "Επιθυμητή γλωσσά κατά την εκκίνηση του Minigalaxy" + +#: data/ui/preferences.ui:115 +msgctxt "view_tooltip" +msgid "The preferred view of game library" +msgstr "Επιθυμητή απεικόνιση βιβλιοθήκης παιχνιδιών" + +#: minigalaxy/ui/gametilelist.py:223 minigalaxy/ui/gametile.py:220 +msgid "" +"There was an error when trying to fetch the download link!\n" +"{}" +msgstr "Σφάλμα κατά την προσπάθεια απόκτησης συνδέσμου λήψης!" + +#: data/ui/preferences.ui:140 +msgctxt "install_path_tooltip" +msgid "This is where games will be installed" +msgstr "Εδώ θα εγκαθίστανται τα παιχνίδια" + +#: minigalaxy/constants.py:46 +msgid "Traditional Chinese" +msgstr "Κινεζικά Παραδοσιακά" + +#: minigalaxy/constants.py:25 minigalaxy/constants.py:47 +msgid "Turkish" +msgstr "Τουρκικά" + +#: minigalaxy/constants.py:48 +msgid "Ukrainian" +msgstr "Ουκρανικά" + +#: data/ui/gametilelist.ui:224 data/ui/gametile.ui:208 +msgid "Uninstall" +msgstr "Απεγκατάσταση" + +#: data/ui/gametilelist.ui:209 data/ui/gametile.ui:172 +msgid "Update" +msgstr "Ενημέρωση" + +#: data/ui/properties.ui:178 +msgid "Use GameMode:" +msgstr "Χρήση GameMode:" + +#: data/ui/properties.ui:203 +msgid "Use MangoHud:" +msgstr "Χρήση MangoHud:" + +#. Has to end with ": " +#: data/ui/preferences.ui:223 +msgctxt "use_dark_theme" +msgid "Use dark theme: " +msgstr "Χρύση σκοτεινού θέματος: " + +#: data/ui/properties.ui:228 +msgid "Variable flags:" +msgstr "Μεταβλητές παραμέτρων:" + +#: minigalaxy/ui/information.py:140 +msgid "Version" +msgstr "Εκδοσή" + +#. The preferred view of game library. Has to end with ": " +#: data/ui/preferences.ui:118 +msgctxt "view" +msgid "View: " +msgstr "Απεικόνιση: " + +#: data/ui/preferences.ui:193 +msgctxt "stay_logged_in_tooltip" +msgid "When disabled you'll be asked to log in each time Minigalaxy is started" +msgstr "" +"Όταν απενεργοποιηθεί θα σας ζητείται σύνδεση κάθε φόρα που εκκινείται το " +"Minigalaxy" + +#: data/ui/preferences.ui:220 +msgctxt "use_dark_theme_tooltip" +msgid "Whether Minigalaxy should use dark theme or not" +msgstr "" +"Άμα θα επιτρέπεται στο Minigalaxy να χρησιμοποιήσει το σκοτεινό θέμα η όχι" + +#: data/ui/preferences.ui:272 +msgctxt "show_windows_games_tooltip" +msgid "Whether Windows games are shown in the library or not" +msgstr "" +"Άμα θα επιτρέπεται στα παιχνίδια windows η προβολή στην βιβλιοθήκη η όχι" + +#: data/ui/preferences.ui:246 +msgctxt "show_hidden_games_tooltip" +msgid "Whether hidden games are shown in the library or not" +msgstr "" +"Άμα θα επιτρέπεται στα κριμένα παιχνίδια η προβολή στην βιβλιοθήκη η όχι" + +#: data/ui/preferences.ui:310 +msgctxt "create_menu_shortcuts_tooltip" +msgid "Whether shortcuts are created for newly installed games or not" +msgstr "" +"Άμα θα επιτρέπεται η δημιουργία συντομεύσεων για τα νέα εγκατεστημένα " +"παιχνίδια η όχι" + +#: data/ui/properties.ui:291 +msgid "Wine executable:" +msgstr "Εκτελέσιμο wine:" + +#: minigalaxy/installer.py:178 +msgid "Wine extraction failed." +msgstr "Αποτυχία αποσυμπίεσης wine." + +#: minigalaxy/ui/preferences.py:192 +msgid "Wine wasn't found. Showing Windows games cannot be enabled." +msgstr "" +"Αποτυχία εύρεσης wine.Δεν είναι δυνατή η δυνατότητα προβολής παιχνιδιών " +"Windows." + +#: data/ui/properties.ui:61 +msgid "Winecfg" +msgstr "Winecfg" + +#: data/ui/properties.ui:87 +msgid "Winetricks" +msgstr "Winetricks" + +#: minigalaxy/ui/properties.py:113 +msgid "Winetricks wasn't found and cannot be used." +msgstr "Αποτυχία εύρεσης winetricks.Δεν είναι δυνατή η χρήση του." + +#: minigalaxy/ui/gametilelist.py:483 minigalaxy/ui/gametile.py:480 +msgid "download" +msgstr "λήψη" + +#: minigalaxy/ui/gametilelist.py:523 minigalaxy/ui/gametile.py:520 +msgid "downloading…" +msgstr "ενυμέρωση…" + +#: minigalaxy/ui/gametilelist.py:514 minigalaxy/ui/gametile.py:511 +msgid "in queue…" +msgstr "σε αναμονή…" + +#: minigalaxy/ui/gametilelist.py:502 minigalaxy/ui/gametile.py:499 +msgid "install" +msgstr "εγκατάστασή" + +#: minigalaxy/ui/gametilelist.py:534 minigalaxy/ui/gametile.py:531 +msgid "installing…" +msgstr "εγκαθίσταται…" + +#: minigalaxy/ui/gametilelist.py:549 minigalaxy/ui/gametilelist.py:579 +#: minigalaxy/ui/gametile.py:546 minigalaxy/ui/gametile.py:576 +msgid "play" +msgstr "παίξε" + +#: minigalaxy/ui/gametilelist.py:565 minigalaxy/ui/gametile.py:562 +msgid "uninstalling…" +msgstr "απ εγκαθίσταται…" + +#: minigalaxy/ui/information.py:134 +msgid "unknown" +msgstr "άγνωστο" + +#: minigalaxy/ui/gametilelist.py:588 minigalaxy/ui/gametile.py:585 +msgid "updating…" +msgstr "ενημερώνεται…" + +#: minigalaxy/installer.py:130 +msgid "{} could not be unzipped." +msgstr "{} αδυναμία αποσυμπίεσης." + +#: minigalaxy/installer.py:73 +msgid "{} failed to download." +msgstr "() αποτυχία λήψης." + +#: minigalaxy/ui/preferences.py:204 +msgid "{} isn't a usable path" +msgstr "()μη εύχρηστη διαδρομη" + +#: minigalaxy/installer.py:85 +msgid "{} was corrupted. Please download it again." +msgstr "()διαφθείρει.Παρακαλώ κατεβαστε το ξανά." diff --git a/minigalaxy/constants.py b/minigalaxy/constants.py index 8d8581ee..96c39f55 100644 --- a/minigalaxy/constants.py +++ b/minigalaxy/constants.py @@ -46,6 +46,7 @@ ["zh_TW", _("Traditional Chinese")], ["tr", _("Turkish")], ["uk", _("Ukrainian")], + ["el", _("Greek")], ] VIEWS = [ From 8439d132fd1faa65963ba47241797a24de332300 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Tue, 14 Jun 2022 17:00:55 +0200 Subject: [PATCH 06/22] Add Pyrofanis to README and about --- README.md | 1 + data/ui/about.ui | 1 + 2 files changed, 2 insertions(+) diff --git a/README.md b/README.md index 7c130ee2..4edc1f2a 100644 --- a/README.md +++ b/README.md @@ -213,6 +213,7 @@ Special thanks goes out to all contributors: - dummyx for translating to simplified Chinese - juanborda, advy99 and LocalPinkRobin for translating to Spanish - Newbytee for translating to Swedish +- Pyrofanis for translating to Greek - jubalh for packaging Minigalaxy for openSUSE - gasinvein for packaging Minigalaxy for flathub - metafarion for packaging Minigalaxy for Gentoo diff --git a/data/ui/about.ui b/data/ui/about.ui index d79285d7..3bb5fdb5 100644 --- a/data/ui/about.ui +++ b/data/ui/about.ui @@ -25,6 +25,7 @@ <a href="https://github.com/zweif">zweif</a> <a href="https://github.com/phlash">Phil Ashby</a> <a href="https://github.com/ArturWroblewski">Artur Wróblewski</a> +<a href="https://github.com/Pyrofani">Athanasios Nektarios Karachalios Stagkas</a> <a href="https://github.com/BlindJerobine">BlindJerobine</a> <a href="https://github.com/EsdrasTarsis">Esdras Tarsis</a> <a href="https://github.com/fuzunspm">Hüseyin Fahri Uzun</a> From f563d6999202041b6ffbf6d25b7f4d56286a67c5 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Tue, 14 Jun 2022 17:29:40 +0200 Subject: [PATCH 07/22] Update CHANGELOG to reflect current state --- CHANGELOG.md | 25 ++++++++++++++++++++++++- 1 file changed, 24 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 473982c6..0ec34b3b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,11 +1,34 @@ **1.2.0** +- Split game information and properties into different windows (thanks to TotalCaesar659) - Add list view (thanks to TotalCaesar659) - Allow DLC to be queued up for downloading (thanks to flagrama) - Fix changing library to a directory with special characters in the name (thanks to makson96) - Fix signing in with Facebook (thanks to phlash) +- Always use cached DLC icons and thumbnails (thanks to TotalCaesar659) +- Cache information covers (thanks to TotalCaesar659) +- Fix installers not being cleaned up like expected (thanks to Kzimir) +- Fix error when opening game properties window when wine is not installed (thanks to lmeunier) +- Fix freeze for games generating a lot of output (thanks to lmeunier) +- Fix extracting rar based games with innoextract (thanks to Kzimir) +- Allow setting wine executable per game (thanks to Kzimir) +- Add GameMode support (thanks to TotalCaesar659) +- Add MangoHud support (thanks to TotalCaesar659) +- Add option to use Winetricks (thanks to TotalCaesar659) +- Fix updates not always being detected directly after opening Minigalaxy (thanks to TotalCaesar659) +- Fix desktop files generated not always being able to launch (thanks to otaconix) +- Show percentage when hovering over download progress bar (thanks to TotalCaesar659) +- Add option to disable update check per game (thanks to TotalCaesar659) +- Add forum, GOG Database and PCGamingWiki URLs to game information (thanks to TotalCaesar659) +- List genre as unknown in game information when none is found (thanks to mareksapota) +- Fix changing installation path causing crashes in rare cases (thanks to makson96) +- Fall back to English when locale cannot be determined (thanks to flagrama) +- Add gettext to build dependencies (thanks to larslindq) + +- Add Greek translation (thanks to Pyrofanis) +- Add Spanish (Spain) translation (thanks to mbarrio) + - Update Norwegian Bokmål translation (thanks to kimmalmo) - Update Czech translation (thanks to jakbuz23) -- Add Greek translation (thanks to Pyrofanis) **1.1.0** - Improve integrity check after downloading (thanks to makson96) From 5e0010ca91a9fc5129ddb6d34c9235580c46855f Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Tue, 14 Jun 2022 17:36:52 +0200 Subject: [PATCH 08/22] Add missing contributors to README and about page --- README.md | 3 +++ data/ui/about.ui | 5 ++++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4edc1f2a..4bd8de6d 100644 --- a/README.md +++ b/README.md @@ -202,6 +202,8 @@ Special thanks goes out to all contributors: - sgn for fixing a bug - otaconix for fixing a bug - phlash for fixing a bug +- mareksapota for fixing a bug +- zocker-160 for code cleanup - s8321414 for translating to Taiwanese Mandarin - fuzunspm for translating to Turkish - thomansb22 for translating to French @@ -214,6 +216,7 @@ Special thanks goes out to all contributors: - juanborda, advy99 and LocalPinkRobin for translating to Spanish - Newbytee for translating to Swedish - Pyrofanis for translating to Greek +- mbarrio for translating to Spanish - jubalh for packaging Minigalaxy for openSUSE - gasinvein for packaging Minigalaxy for flathub - metafarion for packaging Minigalaxy for Gentoo diff --git a/data/ui/about.ui b/data/ui/about.ui index 3bb5fdb5..c3af74a0 100644 --- a/data/ui/about.ui +++ b/data/ui/about.ui @@ -23,7 +23,9 @@ <a href="https://github.com/graag">Konrad Klimaszewski</a> <a href="https://github.com/lmeunier">Laurent Meunier</a> <a href="https://github.com/zweif">zweif</a> -<a href="https://github.com/phlash">Phil Ashby</a> +<a href="https://github.com/phlash">Phil Ashby</a> +<a href="https://github.com/mareksapota">Marek Sapota</a> +<a href="https://github.com/zocker-160">zocker-160</a> <a href="https://github.com/ArturWroblewski">Artur Wróblewski</a> <a href="https://github.com/Pyrofani">Athanasios Nektarios Karachalios Stagkas</a> <a href="https://github.com/BlindJerobine">BlindJerobine</a> @@ -37,6 +39,7 @@ <a href="https://github.com/tim77">Artem Polishchuk</a> <a href="https://github.com/dummyx">dummyx</a> <a href="https://github.com/juanborda">JB</a> +<a href="https://github.com/mbarrio">Miguel Barrio Orsikowsky</a> <a href="https://github.com/Newbytee">Newbytee</a> <a href="https://github.com/jakbuz23">jakbuz23</a> <a href="https://github.com/heidiwenger">heidiwenger</a> From 5ab2fe5d57f2eb3e44bd490c8981743d55a9c641 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Wed, 22 Jun 2022 12:47:36 +0200 Subject: [PATCH 09/22] Improve error handling upon API errors --- CHANGELOG.md | 1 + minigalaxy/api.py | 65 +++++++++++++++++++++------------- minigalaxy/download_manager.py | 4 +-- minigalaxy/installer.py | 1 + minigalaxy/ui/window.py | 2 +- tests/test_api.py | 53 +++++++++++++++++++++++++++ 6 files changed, 99 insertions(+), 27 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 0ec34b3b..75007174 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -23,6 +23,7 @@ - Fix changing installation path causing crashes in rare cases (thanks to makson96) - Fall back to English when locale cannot be determined (thanks to flagrama) - Add gettext to build dependencies (thanks to larslindq) +- Improve error handling upon API errors - Add Greek translation (thanks to Pyrofanis) - Add Spanish (Spain) translation (thanks to mbarrio) diff --git a/minigalaxy/api.py b/minigalaxy/api.py index cc0cfd0f..ccc6e100 100644 --- a/minigalaxy/api.py +++ b/minigalaxy/api.py @@ -174,12 +174,14 @@ def get_download_file_md5(self, url): :return: the md5 sum as string """ result = "" - checksum_data = self.__request(url) - if 'checksum' in checksum_data.keys() and len(checksum_data['checksum']) > 0: - xml_data = self.__get_xml_checksum(checksum_data['checksum']) - if "md5" in xml_data.keys() and len(xml_data["md5"]) > 0: - result = xml_data["md5"] - + try: + checksum_data = self.__request(url) + if 'checksum' in checksum_data.keys() and len(checksum_data['checksum']) > 0: + xml_data = self.__get_xml_checksum(checksum_data['checksum']) + if "md5" in xml_data.keys() and len(xml_data["md5"]) > 0: + result = xml_data["md5"] + except requests.exceptions.RequestException as e: + print("Couldn't retrieve md5. Encountered HTTP exception: {}".format(e)) if not result: print("Couldn't find md5 in xml checksum data") @@ -204,26 +206,32 @@ def get_file_size(self, url): return result - def __get_xml_checksum(self, url): + @staticmethod + def __get_xml_checksum(url): result = {} - response = SESSION.get(url) - if response.status_code == http.HTTPStatus.OK and len(response.text) > 0: - response_object = ET.fromstring(response.text) - if response_object and response_object.attrib: - result = response_object.attrib - else: - print("Couldn't read xml data. Response with code {} received with the following content: {}".format( - response.status_code, response.text - )) - return result + try: + response = SESSION.get(url) + if response.status_code == http.HTTPStatus.OK and len(response.text) > 0: + response_object = ET.fromstring(response.text) + if response_object and response_object.attrib: + result = response_object.attrib + else: + print("Couldn't read xml data. Response with code {} received with the following content: {}".format( + response.status_code, response.text + )) + except requests.exceptions.RequestException as e: + print("Couldn't read xml data. Received RequestException : {}".format(e)) + finally: + return result def get_user_info(self) -> str: username = Config.get("username") if not username: url = "https://embed.gog.com/userData.json" response = self.__request(url) - username = response["username"] - Config.set("username", username) + if "username" in response.keys(): + username = response["username"] + Config.set("username", username) return username def get_version(self, game: Game, gameinfo=None, dlc_name="") -> str: @@ -269,13 +277,22 @@ def __request(self, url: str = None, params: dict = None) -> dict: headers = { 'Authorization': "Bearer {}".format(str(self.active_token)), } - response = SESSION.get(url, headers=headers, params=params) - if self.debug: + result = {} + try: + response = SESSION.get(url, headers=headers, params=params) + if self.debug: + print("Request: {}".format(url)) + print("Return code: {}".format(response.status_code)) + print("Response body: {}".format(response.text)) + print("") + if response.status_code < 300: + result = response.json() + except requests.exceptions.RequestException as e: + print("Encountered exception while making HTTP request.") print("Request: {}".format(url)) - print("Return code: {}".format(response.status_code)) - print("Response body: {}".format(response.text)) + print("Exception: {}".format(e)) print("") - return response.json() + return result @staticmethod def __request_gamesdb(game: Game): diff --git a/minigalaxy/download_manager.py b/minigalaxy/download_manager.py index 3f663ad4..e8f05027 100644 --- a/minigalaxy/download_manager.py +++ b/minigalaxy/download_manager.py @@ -4,7 +4,7 @@ import threading import queue -from requests.exceptions import ConnectionError +from requests.exceptions import RequestException from minigalaxy.config import Config from minigalaxy.constants import DOWNLOAD_CHUNK_SIZE, MINIMUM_RESUME_SIZE, SESSION from minigalaxy.download import Download @@ -85,7 +85,7 @@ def __download_file(self, download): start_point, download_mode = self.get_start_point_and_download_mode(download) result = self.download_operation(download, start_point, download_mode) break - except ConnectionError as e: + except RequestException as e: print(e) download_attempt += 1 # Successful downloads diff --git a/minigalaxy/installer.py b/minigalaxy/installer.py index 3f3e8606..cf617f0e 100644 --- a/minigalaxy/installer.py +++ b/minigalaxy/installer.py @@ -42,6 +42,7 @@ def check_diskspace(required_size, location): def install_game(game, installer): # noqa: C901 error_message = "" tmp_dir = "" + print("Installing {}".format(game.name)) if not error_message: error_message = verify_installer_integrity(game, installer) if not error_message: diff --git a/minigalaxy/ui/window.py b/minigalaxy/ui/window.py index 86970df7..f4fec9b2 100644 --- a/minigalaxy/ui/window.py +++ b/minigalaxy/ui/window.py @@ -71,7 +71,7 @@ def __init__(self, name="Minigalaxy"): self.__authenticate() self.HeaderBar.set_subtitle(self.api.get_user_info()) except Exception as e: - print(e) + print("Starting in offline mode, after receiving exception: {}".format(e)) self.offline = True self.sync_library() diff --git a/tests/test_api.py b/tests/test_api.py index 445c037e..5b918479 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -104,6 +104,7 @@ def test1_get_library(self): response_mock = MagicMock() response_mock.json.return_value = response_dict m_constants.SESSION.get.return_value = response_mock + m_constants.SESSION.get().status_code = http.HTTPStatus.OK exp = "Neverwinter Nights: Enhanced Edition" retrieved_games, err_msg = api.get_library() obs = retrieved_games[0].name @@ -232,6 +233,26 @@ def test_get_file_size_returns_zero_on_response_error(self): obs = api.get_file_size("url") self.assertEqual(exp, obs) + def test_get_file_size_returns_zero_on_request_exception(self): + api = Api() + api._Api__request = MagicMock() + api._Api__request.return_value = {"checksum": "url"} + m_constants.SESSION.get.side_effect = requests.exceptions.RequestException("test") + + exp = 0 + obs = api.get_file_size("url") + self.assertEqual(exp, obs) + + def test_get_file_size_returns_zero_on_request_timeout_exception(self): + api = Api() + api._Api__request = MagicMock() + api._Api__request.return_value = {"checksum": "url"} + m_constants.SESSION.get.side_effect = requests.exceptions.ReadTimeout("test") + + exp = 0 + obs = api.get_file_size("url") + self.assertEqual(exp, obs) + def test_get_file_size_returns_zero_on_missing_total_size(self): api = Api() api._Api__request = MagicMock() @@ -281,6 +302,38 @@ def test3_get_gamesdb_info_no_genre(self): obs = api.get_gamesdb_info(test_game) self.assertEqual(exp, obs) + def test_get_user_info_from_api(self): + username = "test" + api = Api() + api._Api__request = MagicMock() + api._Api__request.return_value = {"username": username} + m_config.Config.get.return_value = "" + m_constants.SESSION.get.side_effect = MagicMock() + m_constants.SESSION.get().status_code = http.HTTPStatus.OK + + obs = api.get_user_info() + self.assertEqual(username, obs) + + def test_get_user_info_from_config(self): + username = "test" + api = Api() + api._Api__request = MagicMock() + api._Api__request.return_value = {"username": "wrong"} + m_config.Config.get.return_value = username + + obs = api.get_user_info() + self.assertEqual(username, obs) + + def test_get_user_info_return_empty_string_when_nothing_is_returned(self): + api = Api() + api._Api__request = MagicMock() + api._Api__request.return_value = {} + m_config.Config.get.return_value = "" + + exp = "" + obs = api.get_user_info() + self.assertEqual(exp, obs) + del sys.modules['minigalaxy.constants'] del sys.modules['minigalaxy.config'] From 571eeb6fb85361b77560555ce57560a7bdb5158c Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Wed, 22 Jun 2022 13:23:22 +0200 Subject: [PATCH 10/22] Fix several issues with launching Windows games --- CHANGELOG.md | 1 + minigalaxy/launcher.py | 30 ++++++++++----- tests/test_launcher.py | 83 +++++++++++++++++++++++++++++++++++++++++- 3 files changed, 104 insertions(+), 10 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 75007174..91d21589 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -24,6 +24,7 @@ - Fall back to English when locale cannot be determined (thanks to flagrama) - Add gettext to build dependencies (thanks to larslindq) - Improve error handling upon API errors +- Fix several issues with launching Windows games from Minigalaxy - Add Greek translation (thanks to Pyrofanis) - Add Spanish (Spain) translation (thanks to mbarrio) diff --git a/minigalaxy/launcher.py b/minigalaxy/launcher.py index 5bfee541..f74b7766 100644 --- a/minigalaxy/launcher.py +++ b/minigalaxy/launcher.py @@ -76,6 +76,7 @@ def get_execute_command(game) -> list: exe_cmd.insert(0, "mangohud") exe_cmd.insert(1, "--dlsym") exe_cmd = get_exe_cmd_with_var_command(game, exe_cmd) + print("Launch command for {}: {}".format(game.name, " ".join(exe_cmd))) return exe_cmd @@ -115,17 +116,28 @@ def get_windows_exe_cmd(game, files): # Find game executable file for file in files: - if re.match(r'^goggame-[0-9]*\.info$', file): + if re.match(r'^goggame-\d*\.info$', file): os.chdir(game.install_dir) with open(file, 'r') as info_file: info = json.loads(info_file.read()) # if we have the workingDir property, start the executable at that directory - if info["playTasks"]: - if "workingDir" in info["playTasks"][0] and info["playTasks"][0]["workingDir"]: - exe_cmd = [get_wine_path(game), "start", "/b", "/wait", "/d", info["playTasks"][0]["workingDir"], - info["playTasks"][0]["path"]] - else: - exe_cmd = [get_wine_path(game), info["playTasks"][0]["path"]] + if "playTasks" in info: + has_primary = False + for task in info["playTasks"]: + if "isPrimary" in task: + has_primary = True + print("Primary playTask found") + break + for task in info["playTasks"]: + if "category" in task and task["category"] == "game" and "path" in task: + working_dir = task["workingDir"] if "workingDir" in task else "." + path = task["path"] + exe_cmd = [get_wine_path(game), "start", "/b", "/wait", "/d", working_dir, + path] + if "arguments" in task: + exe_cmd += task["arguments"].split(" ") + if not has_primary or ("isPrimary" in task and task["isPrimary"]): + break if exe_cmd == [""]: # in case no goggame info file was found executables = glob.glob(game.install_dir + '/*.exe') @@ -140,9 +152,9 @@ def get_dosbox_exe_cmd(game, files): dosbox_config = "" dosbox_config_single = "" for file in files: - if re.match(r'^dosbox_?([a-z]|[A-Z]|[0-9])+\.conf$', file): + if re.match(r'^dosbox_?([a-z]|[A-Z]|\d)+\.conf$', file): dosbox_config = file - if re.match(r'^dosbox_?([a-z]|[A-Z]|[0-9])+_single\.conf$', file): + if re.match(r'^dosbox_?([a-z]|[A-Z]|\d)+_single\.conf$', file): dosbox_config_single = file print("Using system's dosbox to launch {}".format(game.name)) return ["dosbox", "-conf", dosbox_config, "-conf", dosbox_config_single, "-no-console", "-c", "exit"] diff --git a/tests/test_launcher.py b/tests/test_launcher.py index 09ebdf12..2663f026 100644 --- a/tests/test_launcher.py +++ b/tests/test_launcher.py @@ -104,7 +104,88 @@ def test2_get_windows_exe_cmd(self, mock_os_chdir, mo): files = ['thumbnail.jpg', 'docs', 'support', 'game', 'minigalaxy-dlc.json', 'MetroExodus.exe', 'unins000.exe', 'goggame-1407287452.info', 'goggame-1414471894.info'] game = Game("Test Game", install_dir="/test/install/dir") - exp = ["wine", "MetroExodus.exe"] + exp = ['wine', 'start', '/b', '/wait', '/d', '.', 'MetroExodus.exe'] + obs = launcher.get_windows_exe_cmd(game, files) + self.assertEqual(exp, obs) + + @mock.patch('builtins.open', new_callable=mock_open, read_data="") + @mock.patch('os.chdir') + def test3_get_windows_exe_cmd(self, mock_os_chdir, mo): + goggame_1207658919_info_content = """{ + "buildId": "52095557858882770", + "clientId": "49843178982252086", + "gameId": "1207658919", + "language": "English", + "languages": [ + "en-US" + ], + "name": "Rayman Forever", + "playTasks": [ + { + "arguments": "-conf \\"..\\\\dosboxRayman.conf\\" -conf \\"..\\\\dosboxRayman_single.conf\\" -noconsole -c \\"exit\\"", + "category": "game", + "isPrimary": true, + "languages": [ + "*" + ], + "name": "Rayman Forever", + "path": "DOSBOX\\\\dosbox.exe", + "type": "FileTask", + "workingDir": "DOSBOX" + }, + { + "arguments": "1207658919", + "category": "tool", + "languages": [ + "*" + ], + "name": "Graphic Mode Setup", + "path": "DOSBOX\\\\GOGDOSConfig.exe", + "type": "FileTask", + "workingDir": "DOSBOX" + }, + { + "category": "document", + "languages": [ + "*" + ], + "link": "http://www.gog.com/support/rayman_forever", + "name": "Support", + "type": "URLTask" + }, + { + "category": "document", + "languages": [ + "*" + ], + "name": "Manual", + "path": "Manual.pdf", + "type": "FileTask" + }, + { + "category": "tool", + "languages": [ + "*" + ], + "name": "Mapper", + "path": "RayKit\\\\Mapper.exe", + "type": "FileTask", + "workingDir": "RayKit" + } + ], + "rootGameId": "1207658919", + "version": 1 + }""" + mo.side_effect = (mock_open(read_data=goggame_1207658919_info_content).return_value,) + files = ['goggame-1207658919.script', 'DOSBOX', 'thumbnail.jpg', 'game.gog', 'unins000.dat', 'webcache.zip', + 'EULA.txt', 'Music', 'dosboxRayman_single.conf', 'Rayman', 'unins000.exe', 'support.ico', 'prefix', + 'goggame-1207658919.info', 'Manual.pdf', 'gog.ico', 'unins000.msg', 'goggame-1207658919.hashdb', + 'RayFan', 'dosboxRayman.conf', 'unins000.ini', 'thumbnail_100.jpg', 'RayKit', 'game.ins', + 'goggame-1207658919.ico', 'goglog.ini', 'Launch Rayman Forever.lnk', 'cloud_saves', + 'thumbnail_196.jpg'] + game = Game("Test Game", install_dir="/test/install/dir") + exp = ['wine', 'start', '/b', '/wait', '/d', 'DOSBOX', 'DOSBOX\\dosbox.exe', '-conf', '"..\\dosboxRayman.conf"', + '-conf', '"..\\dosboxRayman_single.conf"', '-noconsole', '-c', '"exit"'] obs = launcher.get_windows_exe_cmd(game, files) self.assertEqual(exp, obs) From 44510f412a8d6d44162ced79806024eaef6f0651 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Wed, 22 Jun 2022 13:30:11 +0200 Subject: [PATCH 11/22] Lower complexity in get_windows_exe_cmd This assumes that there is a primary playTask now --- minigalaxy/launcher.py | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) diff --git a/minigalaxy/launcher.py b/minigalaxy/launcher.py index f74b7766..be361084 100644 --- a/minigalaxy/launcher.py +++ b/minigalaxy/launcher.py @@ -122,13 +122,9 @@ def get_windows_exe_cmd(game, files): info = json.loads(info_file.read()) # if we have the workingDir property, start the executable at that directory if "playTasks" in info: - has_primary = False - for task in info["playTasks"]: - if "isPrimary" in task: - has_primary = True - print("Primary playTask found") - break for task in info["playTasks"]: + if "isPrimary" not in task or not task["isPrimary"]: + continue if "category" in task and task["category"] == "game" and "path" in task: working_dir = task["workingDir"] if "workingDir" in task else "." path = task["path"] @@ -136,8 +132,7 @@ def get_windows_exe_cmd(game, files): path] if "arguments" in task: exe_cmd += task["arguments"].split(" ") - if not has_primary or ("isPrimary" in task and task["isPrimary"]): - break + break if exe_cmd == [""]: # in case no goggame info file was found executables = glob.glob(game.install_dir + '/*.exe') From 90960fdb7d33d7954f178a4507a7afd60dd55c55 Mon Sep 17 00:00:00 2001 From: WalterCool Date: Thu, 7 Jul 2022 09:52:50 -0400 Subject: [PATCH 12/22] Resolve #389 (#500) --- minigalaxy/ui/window.py | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/minigalaxy/ui/window.py b/minigalaxy/ui/window.py index f4fec9b2..5509b203 100644 --- a/minigalaxy/ui/window.py +++ b/minigalaxy/ui/window.py @@ -1,7 +1,11 @@ import os import locale -from minigalaxy.ui.login import Login +try: + from minigalaxy.ui.login import Login +except ValueError as err: + print("Login UI disabled due lack of dependencies: {}".format(err)) + from minigalaxy.ui.preferences import Preferences from minigalaxy.ui.about import About from minigalaxy.api import Api @@ -187,7 +191,7 @@ def __authenticate(self): authenticated = self.api.authenticate(refresh_token=token, login_code=url) - while not authenticated: + while not authenticated and 'Login' in dir(): login_url = self.api.get_login_url() redirect_url = self.api.get_redirect_url() login = Login(login_url=login_url, redirect_url=redirect_url, parent=self) From d7d5292a46fe325a867c99487c8c14d6c1738685 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Thu, 7 Jul 2022 15:55:35 +0200 Subject: [PATCH 13/22] Add waltercool to about screen and README Thanks for contributing! --- README.md | 1 + data/ui/about.ui | 3 ++- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 4bd8de6d..e379d0f5 100644 --- a/README.md +++ b/README.md @@ -204,6 +204,7 @@ Special thanks goes out to all contributors: - phlash for fixing a bug - mareksapota for fixing a bug - zocker-160 for code cleanup +- waltercool for contributing code - s8321414 for translating to Taiwanese Mandarin - fuzunspm for translating to Turkish - thomansb22 for translating to French diff --git a/data/ui/about.ui b/data/ui/about.ui index c3af74a0..6d193fb2 100644 --- a/data/ui/about.ui +++ b/data/ui/about.ui @@ -25,7 +25,8 @@ <a href="https://github.com/zweif">zweif</a> <a href="https://github.com/phlash">Phil Ashby</a> <a href="https://github.com/mareksapota">Marek Sapota</a> -<a href="https://github.com/zocker-160">zocker-160</a> +<a href="https://github.com/zocker-160">zocker-160</a> +<a href="https://github.com/waltercool">WalterCool</a> <a href="https://github.com/ArturWroblewski">Artur Wróblewski</a> <a href="https://github.com/Pyrofani">Athanasios Nektarios Karachalios Stagkas</a> <a href="https://github.com/BlindJerobine">BlindJerobine</a> From d9e66d028f26c03d6530d3b3debc17f65abf5efc Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Mon, 11 Jul 2022 12:21:38 +0200 Subject: [PATCH 14/22] Add pyproject.toml file This should replace setup-tools in the future. --- .github/workflows/release.yml | 4 ++-- pyproject.toml | 15 +++++++++++++++ scripts/create-release.sh | 2 ++ 3 files changed, 19 insertions(+), 2 deletions(-) create mode 100644 pyproject.toml diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index ec020b25..e129ec51 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -28,8 +28,8 @@ jobs: run: | git config --global user.name 'Wouter Wijsman' git config --global user.email 'sharkwouter@users.noreply.github.com' - git add data/io.github.sharkwouter.Minigalaxy.metainfo.xml debian/changelog - git commit -m "Update changelogs for Debian and Flatpak" + git add pyproject.toml data/io.github.sharkwouter.Minigalaxy.metainfo.xml debian/changelog + git commit -m "Update changelogs and pyproject.toml to new release" git push - name: Release uses: softprops/action-gh-release@v1 diff --git a/pyproject.toml b/pyproject.toml new file mode 100644 index 00000000..992a0170 --- /dev/null +++ b/pyproject.toml @@ -0,0 +1,15 @@ +[project] +name = "minigalaxy" +description = "A simple GOG Linux client" +version = "1.1.0" +authors = [ + { name = "Wouter Wijsman", email = "wwijsman@live.nl" } +] +dependencies = [ + "PyGObject", + "requests" +] + +[build-system] +requires = ["setuptools", "wheel"] +build-backend = "setuptools.build_meta:__legacy__" diff --git a/scripts/create-release.sh b/scripts/create-release.sh index 44c1328e..430c5369 100755 --- a/scripts/create-release.sh +++ b/scripts/create-release.sh @@ -10,6 +10,7 @@ CHANGELOG_FILE="${WORK_DIR}/CHANGELOG.md" METADATA_FILE="${WORK_DIR}/data/io.github.sharkwouter.Minigalaxy.metainfo.xml" RELEASE_FILE="${WORK_DIR}/release.md" VERSION_FILE="${WORK_DIR}/minigalaxy/version.py" +TOML_FILE="${WORK_DIR}/pyproject.toml" VERSION="$(head -1 "${CHANGELOG_FILE}"|tr -d "*")" check_changelog() { @@ -67,6 +68,7 @@ set_debian_changelog_release() { set_version() { echo "VERSION = \"${VERSION}\"" > "${VERSION_FILE}" + sed -i "s/version = .*/version = \"${VERSION}\"/" "${TOML_FILE}" } return_version_info() { From 083ec4d3e27003ffc04ca3471534467baef27490 Mon Sep 17 00:00:00 2001 From: xSlendiX Date: Wed, 13 Jul 2022 16:50:18 +0300 Subject: [PATCH 15/22] Add Romanian language --- CHANGELOG.md | 1 + data/po/ro.po | 520 ++++++++++++++++++++++++++++++++++++++++ minigalaxy/constants.py | 2 + 3 files changed, 523 insertions(+) create mode 100644 data/po/ro.po diff --git a/CHANGELOG.md b/CHANGELOG.md index 91d21589..552a7f91 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -28,6 +28,7 @@ - Add Greek translation (thanks to Pyrofanis) - Add Spanish (Spain) translation (thanks to mbarrio) +- Add Romanian (Romania) translation (thanks to xSlendiX) - Update Norwegian Bokmål translation (thanks to kimmalmo) - Update Czech translation (thanks to jakbuz23) diff --git a/data/po/ro.po b/data/po/ro.po new file mode 100644 index 00000000..dc849c9e --- /dev/null +++ b/data/po/ro.po @@ -0,0 +1,520 @@ +# SOME DESCRIPTIVE TITLE. +# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER +# This file is distributed under the same license as the PACKAGE package. +# FIRST AUTHOR , YEAR. +# +msgid "" +msgstr "" +"Project-Id-Version: \n" +"Report-Msgid-Bugs-To: \n" +"POT-Creation-Date: 2021-11-26 14:30-0800\n" +"PO-Revision-Date: 2021-09-29 19:02+0300\n" +"Last-Translator: \n" +"Language-Team: \n" +"Language: uk\n" +"MIME-Version: 1.0\n" +"Content-Type: text/plain; charset=UTF-8\n" +"Content-Transfer-Encoding: 8bit\n" +"X-Generator: Poedit 3.0\n" +"Plural-Forms: nplurals=3; plural=(n%10==1 && n%100!=11 ? 0 : n%10>=2 && n" +"%10<=4 && (n%100<12 || n%100>14) ? 1 : 2);\n" + +#. A short description of what Minigalaxy is +#: data/ui/about.ui:10 +msgctxt "short_description" +msgid "A simple GOG client for Linux" +msgstr "Un client simplu GOG pentru Linux" + +#: minigalaxy/ui/about.py:13 +msgid "About" +msgstr "Despre" + +#. Opens about dialog +#: data/ui/application.ui:58 +msgctxt "about" +msgid "About" +msgstr "Despre" + +#: data/ui/properties.ui:129 +msgid "Added at the end of the command used to launch the game" +msgstr "Adăugat la sfârșitul comenzii folosită pentru pornirea jocului" + +#: data/ui/properties.ui:141 +msgid "Added in front of the command used to launch the game" +msgstr "Adăugat în fața comenzii folosită pentru pornirea jocului" + +#: minigalaxy/ui/gametile.py:132 +msgid "Are you sure you want to cancel downloading {}?" +msgstr "Ești sigur că vrei să oprești descărcarea jocului {}?" + +#: minigalaxy/ui/window.py:100 +msgid "Are you sure you want to log out of GOG?" +msgstr "Ești sigur că vrei să te deconectezi din GOG?" + +#: minigalaxy/ui/gametile.py:145 +#, python-format +msgid "Are you sure you want to uninstall %s?" +msgstr "Ești sigur că vrei să dezinstalezi %s?" + +#: minigalaxy/constants.py:7 minigalaxy/constants.py:30 +msgid "Brazilian Portuguese" +msgstr "Portugheză Braziliană" + +#: data/ui/properties.ui:266 +msgid "Cancel" +msgstr "Anulează" + +#: data/ui/preferences.ui:20 +msgctxt "cancel" +msgid "Cancel" +msgstr "Anulează" + +#: minigalaxy/constants.py:8 +msgid "Chinese" +msgstr "Chineză" + +#: data/ui/properties.ui:180 +msgid "Command flags:" +msgstr "Flag-uri comandă:" + +#: minigalaxy/ui/properties.py:103 +msgid "Couldn't open store page" +msgstr "Nu s-a putut deschide pagina magazinului" + +#: minigalaxy/ui/properties.py:93 +msgid "Couldn't open support page" +msgstr "Nu s-a putut deschide pagina de suport" + +#. Has to end with ": " +#: data/ui/preferences.ui:288 +msgctxt "create_menu_shortcuts" +msgid "Create menu shortcuts: " +msgstr "Creează scurtături meniu: " + +#: minigalaxy/constants.py:31 +msgid "Czech" +msgstr "Ceh" + +#: data/ui/gametile.ui:178 +msgid "DLC" +msgstr "DLC" + +#: minigalaxy/constants.py:9 +msgid "Danish" +msgstr "Danez" + +#: minigalaxy/ui/gametile.py:207 minigalaxy/ui/gametile.py:237 +msgid "Download error" +msgstr "Eroare de descărcare" + +#: minigalaxy/constants.py:10 minigalaxy/constants.py:32 +msgid "Dutch" +msgstr "Olandeză" + +#: minigalaxy/constants.py:11 minigalaxy/constants.py:33 +msgid "English" +msgstr "Engleză" + +#: minigalaxy/ui/preferences.py:102 +msgid "" +"Failed to change program language. Make sure locale is generated on your " +"system." +msgstr "Nu s-a putut schimba limba programului. Asigură-te că locale-ul este generat" +"în sistemul tău" + +#: minigalaxy/ui/gametile.py:301 +msgid "Failed to install {}" +msgstr "Nu s-a putut instala {}" + +#: minigalaxy/ui/library.py:141 +msgid "Failed to retrieve library" +msgstr "Nu s-a putut descărca libraria" + +#: minigalaxy/launcher.py:34 minigalaxy/ui/gametile.py:122 +msgid "Failed to start {}:" +msgstr "Nu s-a putut porni {}:" + +#: minigalaxy/constants.py:12 minigalaxy/constants.py:34 +msgid "Finnish" +msgstr "Finlandeză" + +#: minigalaxy/constants.py:13 minigalaxy/constants.py:35 +msgid "French" +msgstr "Franceză" + +#: minigalaxy/ui/properties.py:140 +msgid "Genre" +msgstr "Gen" + +#: minigalaxy/constants.py:14 minigalaxy/constants.py:36 +msgid "German" +msgstr "Germană" + +#. A link to the GitHub page +#: data/ui/about.ui:12 +msgctxt "github_page_link" +msgid "GitHub page" +msgstr "Pagină GitHub" + +#: data/ui/properties.ui:105 +msgid "Hide game:" +msgstr "Ascunde joc:" + +#: minigalaxy/constants.py:15 +msgid "Hungarian" +msgstr "Maghiară" + +#: minigalaxy/installer.py:147 +msgid "Innoextract extraction failed." +msgstr "Nu s-a putut extrage innoextract." + +#: minigalaxy/installer.py:158 +msgid "Innoextract not installed." +msgstr "Innoextract nu s-a instalat." + +#. The place directory in which games are installed. Ends with ": ". +#: data/ui/preferences.ui:118 +msgctxt "install_path" +msgid "Installation path: " +msgstr "Locație instalare: " + +#. Used next to a checkbox which switches between showing all games and only installed ones +#: data/ui/application.ui:116 +msgctxt "installed" +msgid "Installed" +msgstr "Instalat" + +#: minigalaxy/constants.py:16 minigalaxy/constants.py:37 +msgid "Italian" +msgstr "Italiană" + +#: minigalaxy/constants.py:17 +msgid "Japanese" +msgstr "Japoneză" + +#: minigalaxy/ui/preferences.py:46 +msgid "" +"Keep installers after downloading a game.\n" +"Installers are stored in: {}" +msgstr "" +"Ține installer-urile dupa descărcarea unui joc\n" +"Installerele sunt salvate în: {}" + +#. Whether installer files are kept after download. Ends with ": ". +#: data/ui/preferences.ui:145 +msgctxt "keep_installer" +msgid "Keep installers: " +msgstr "Ține installerele: " + +#: minigalaxy/constants.py:18 +msgid "Korean" +msgstr "Koreană" + +#. The preferred language on Minigalaxy start. Ends with ": ". +#: data/ui/preferences.ui:68 +msgctxt "language" +msgid "Language: " +msgstr "Limbă: " + +#: minigalaxy/ui/login.py:20 +msgid "Login" +msgstr "Autentificare" + +#. Logs the users gog account out and returns to login page +#: data/ui/application.ui:17 +msgctxt "logout" +msgid "Logout" +msgstr "Deconectare" + +#: minigalaxy/launcher.py:179 +msgid "No executable was found in {}" +msgstr "Nici-un executabil nu a fost găsit în {}" + +#: minigalaxy/constants.py:19 +msgid "Norwegian" +msgstr "Norvegiană" + +#: minigalaxy/constants.py:38 +msgid "Norwegian Bokmål" +msgstr "Norvegiană Bokmål" + +#: minigalaxy/constants.py:39 +msgid "Norwegian Nynorsk" +msgstr "Norvegiană Nynorsk" + +#: minigalaxy/installer.py:97 +msgid "Not enough space to extract game. Required: {} Available: {}" +msgstr "Nu-i destul de mult spațiu pentru extragerea jocului. Necesar: {} Valabil: {}" + +#: data/ui/properties.ui:280 +msgid "OK" +msgstr "ОК" + +#: data/ui/properties.ui:216 +msgid "Open files" +msgstr "Deschide fișiere" + +#: minigalaxy/ui/properties.py:94 minigalaxy/ui/properties.py:104 +msgid "Please check your internet connection" +msgstr "Te rog verifică conexiunea la internet" + +#: minigalaxy/constants.py:20 minigalaxy/constants.py:40 +msgid "Polish" +msgstr "Poloneză" + +#: minigalaxy/constants.py:21 +msgid "Portuguese" +msgstr "Portugheză" + +#: minigalaxy/ui/preferences.py:30 +msgid "Preferences" +msgstr "Preferințe" + +#. Opens preferences dialog +#: data/ui/application.ui:32 +msgctxt "preferences" +msgid "Preferences" +msgstr "Preferințe" + +#. Preferred language for downloading games in. Ends with ": ". +#: data/ui/preferences.ui:93 +msgctxt "preferred_game_language" +msgid "Preferred game language: " +msgstr "Limbaj preferat pentru joc: " + +#: data/ui/gametile.ui:223 +msgid "Properties" +msgstr "Proprietăți" + +#: minigalaxy/ui/properties.py:33 +msgid "Properties of {}" +msgstr "Proprietățile {}" + +#. Tooltip for refresh button +#: data/ui/application.ui:89 +msgctxt "refresh" +msgid "Refresh game list" +msgstr "Reîmprospătează listă jocuri" + +#: data/ui/properties.ui:203 +msgid "Regedit" +msgstr "Regedit" + +#: minigalaxy/constants.py:22 minigalaxy/constants.py:41 +msgid "Russian" +msgstr "Rusă" + +#. Saves the preferences +#: data/ui/preferences.ui:34 +msgctxt "save" +msgid "Save" +msgstr "Salvează" + +#: data/ui/properties.ui:154 +msgid "Show FPS in game:" +msgstr "Arată FPS în joc:" + +#. Has to end with ": " +#: data/ui/preferences.ui:250 +msgctxt "show_windows_games" +msgid "Show Windows games: " +msgstr "Arată jocuri Windows: " + +#. Has to end with ": " +#: data/ui/preferences.ui:224 +msgctxt "show_hidden_games" +msgid "Show hidden games: " +msgstr "Arată jocuri ascunse: " + +#. Tooltip for the switch which allows only showing installed games or all games +#: data/ui/application.ui:105 +msgctxt "tooltip_installed" +msgid "Show only installed games" +msgstr "Arată doar jocurile instalate" + +#: minigalaxy/constants.py:42 +msgid "Simplified Chinese" +msgstr "Chineză Simplificată" + +#: minigalaxy/constants.py:23 minigalaxy/constants.py:43 +msgid "Spanish" +msgstr "Spaniolă" + +#. Whether the user will stay logged in after closing Minigalaxy. Ends with ": ". +#: data/ui/preferences.ui:171 +msgctxt "stay_logged_in" +msgid "Stay logged in:" +msgstr "Rămâi conectat:" + +#: data/ui/properties.ui:77 +msgid "Store" +msgstr "Magazin" + +#: data/ui/properties.ui:63 +msgid "Support" +msgstr "Suport" + +#: minigalaxy/constants.py:24 minigalaxy/constants.py:44 +msgid "Swedish" +msgstr "Suedeză" + +#: minigalaxy/constants.py:29 +msgid "System default" +msgstr "Implicit sistemului" + +#: minigalaxy/installer.py:128 +msgid "The installation of {} failed. Please try again." +msgstr "Instalarea a eșuat. Te rog incearcă din nou." + +#: data/ui/preferences.ui:90 +msgctxt "preferred_game_language_tooltip" +msgid "The preferred language for downloading games in" +msgstr "Limbajul preferat pentru descărcarea jocurilor" + +#: data/ui/preferences.ui:65 +msgctxt "language_tooltip" +msgid "The preferred language on Minigalaxy start" +msgstr "Limbajul preferat la deschiderea Minigalaxy-ului" + +#: minigalaxy/ui/gametile.py:208 +msgid "" +"There was an error when trying to fetch the download link!\n" +"{}" +msgstr "" +"A fost o eroare la luat-ul linkului de descărcare!\n" +"{}" + +#: data/ui/preferences.ui:115 +msgctxt "install_path_tooltip" +msgid "This is where games will be installed" +msgstr "Aici vor fi jocurile descărcate" + +#: minigalaxy/constants.py:45 +msgid "Traditional Chinese" +msgstr "Chineză Tradițională" + +#: minigalaxy/constants.py:25 minigalaxy/constants.py:46 +msgid "Turkish" +msgstr "Turcă" + +#: minigalaxy/constants.py:47 +msgid "Ukrainian" +msgstr "Ukraineană" + +#: minigalaxy/constants.py:26 minigalaxy/constants.py:51 +msgid "Romanian" +msgstr "Română" + +#: data/ui/gametile.ui:208 +msgid "Uninstall" +msgstr "Dezinstalează" + +#: data/ui/gametile.ui:193 +msgid "Update" +msgstr "Actualizează" + +#. Has to end with ": " +#: data/ui/preferences.ui:198 +msgctxt "use_dark_theme" +msgid "Use dark theme: " +msgstr "Folosește mod întunecat" + +#: data/ui/properties.ui:167 +msgid "Variable flags:" +msgstr "Flag-uri variabile:" + +#: minigalaxy/ui/properties.py:142 +msgid "Version" +msgstr "Versiune" + +#: data/ui/preferences.ui:168 +msgctxt "stay_logged_in_tooltip" +msgid "When disabled you'll be asked to log in each time Minigalaxy is started" +msgstr "" +"Cât timp este dezactivat, vei fi întrebat de fiecare dată când Minigalaxy se deschide " +"să te autentifici" + +#: data/ui/preferences.ui:195 +msgctxt "use_dark_theme_tooltip" +msgid "Whether Minigalaxy should use dark theme or not" +msgstr "Dacă Minigalaxy să folosească modul întunecat sau nu" + +#: data/ui/preferences.ui:247 +msgctxt "show_windows_games_tooltip" +msgid "Whether Windows games are shown in the library or not" +msgstr "Dacă jocurile Windows sunt afișate în librărie sau nu" + +#: data/ui/preferences.ui:221 +msgctxt "show_hidden_games_tooltip" +msgid "Whether hidden games are shown in the library or not" +msgstr "Dacă jocurile ascunse sunt afișate în librărie sau nu" + +#: data/ui/preferences.ui:285 +msgctxt "create_menu_shortcuts_tooltip" +msgid "Whether shortcuts are created for newly installed games or not" +msgstr "Dacă scurtăturile sunt create pentru jocuri nou-instalate sau nu" +"" + +#: minigalaxy/installer.py:172 +msgid "Wine extraction failed." +msgstr "Extragerea Wine a eșuat." + +#: minigalaxy/ui/preferences.py:162 +msgid "Wine wasn't found. Showing Windows games cannot be enabled." +msgstr "Wine nu a fost găsit. Arătarea jocurilor Windows nu poate fi pornită." + +#: data/ui/properties.ui:190 +msgid "Winecfg" +msgstr "Winecfg" + +#: minigalaxy/ui/gametile.py:460 +msgid "download" +msgstr "descarcă" + +#: minigalaxy/ui/gametile.py:500 +msgid "downloading…" +msgstr "se descarcă…" + +#: minigalaxy/ui/gametile.py:491 +msgid "in queue…" +msgstr "în coadă…" + +#: minigalaxy/ui/gametile.py:479 +msgid "install" +msgstr "instalează" + +#: minigalaxy/ui/gametile.py:511 +msgid "installing…" +msgstr "se instalează…" + +#: minigalaxy/ui/gametile.py:526 minigalaxy/ui/gametile.py:556 +msgid "play" +msgstr "joacă" + +#: minigalaxy/ui/gametile.py:542 +msgid "uninstalling…" +msgstr "se dezinstalează…" + +#: minigalaxy/ui/properties.py:136 +msgid "unknown" +msgstr "necunoscut" + +#: minigalaxy/ui/gametile.py:565 +msgid "updating…" +msgstr "se actualizează…" + +#: minigalaxy/installer.py:130 +msgid "{} could not be unzipped." +msgstr "{} nu poate fi unzipped." + +#: minigalaxy/installer.py:73 +msgid "{} failed to download." +msgstr "Nu s-a putut descărca {}." + +#: minigalaxy/ui/preferences.py:174 +msgid "{} isn't a usable path" +msgstr "{} nu este o locație validă" + +#: minigalaxy/installer.py:85 +msgid "{} was corrupted. Please download it again." +msgstr "{} este corupt. Te rog descarcă din nou." diff --git a/minigalaxy/constants.py b/minigalaxy/constants.py index 96c39f55..c6f85d59 100644 --- a/minigalaxy/constants.py +++ b/minigalaxy/constants.py @@ -23,6 +23,7 @@ ["es", _("Spanish")], ["sv", _("Swedish")], ["tr", _("Turkish")], + ["ro", _("Romanian")], ] SUPPORTED_LOCALES = [ @@ -47,6 +48,7 @@ ["tr", _("Turkish")], ["uk", _("Ukrainian")], ["el", _("Greek")], + ["ro", _("Romanian")], ] VIEWS = [ From 1008ab4bbda14f729678832f800166c6bae6bf42 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Fri, 19 Aug 2022 09:30:42 +0200 Subject: [PATCH 16/22] Return coverage report after running tests --- .github/workflows/pythontests.yml | 2 +- requirements-testing.txt | 1 + 2 files changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index 0d18d67a..cd74249d 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -25,4 +25,4 @@ jobs: flake8 . --count --show-source --statistics --exit-zero - name: Run unit tests run: | - python -m unittest tests/*.py + python3 -m coverage run -m unittest discover -v tests/ && python3 -m coverage report -m --include="minigalaxy/**,bin/*" diff --git a/requirements-testing.txt b/requirements-testing.txt index 64f48642..e8bd10e1 100644 --- a/requirements-testing.txt +++ b/requirements-testing.txt @@ -1,3 +1,4 @@ requests flake8 simplejson +coverage From ac5d29736b70322192ae30ee515560c61d94b524 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Fri, 19 Aug 2022 09:46:05 +0200 Subject: [PATCH 17/22] Calculate coverage based on all files --- .github/workflows/pythontests.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/pythontests.yml b/.github/workflows/pythontests.yml index cd74249d..9ef814e0 100644 --- a/.github/workflows/pythontests.yml +++ b/.github/workflows/pythontests.yml @@ -25,4 +25,5 @@ jobs: flake8 . --count --show-source --statistics --exit-zero - name: Run unit tests run: | - python3 -m coverage run -m unittest discover -v tests/ && python3 -m coverage report -m --include="minigalaxy/**,bin/*" + python3 -m coverage run --source minigalaxy -m unittest discover -v tests && python3 -m coverage report -m + From 0ffcdc6af5d1cf485cd6ad4e9f51d5c10e402a57 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Mon, 5 Sep 2022 17:18:12 +0200 Subject: [PATCH 18/22] Make sure the links to the xml based checksum are only used once This links are made to be used only once. The second time you do not get a response. This was causing #484 it seems. This took a while to figure out, but it should be fixed with this. --- minigalaxy/api.py | 40 ++++++++++++----------------------- minigalaxy/file_info.py | 7 ++++++ minigalaxy/ui/gametile.py | 8 +++---- minigalaxy/ui/gametilelist.py | 8 +++---- tests/test_api.py | 40 +++++++++++++++++------------------ 5 files changed, 49 insertions(+), 54 deletions(-) create mode 100644 minigalaxy/file_info.py diff --git a/minigalaxy/api.py b/minigalaxy/api.py index ccc6e100..859d071c 100644 --- a/minigalaxy/api.py +++ b/minigalaxy/api.py @@ -4,6 +4,8 @@ from urllib.parse import urlencode import requests import xml.etree.ElementTree as ET + +from minigalaxy.file_info import FileInfo from minigalaxy.game import Game from minigalaxy.constants import IGNORE_GAME_IDS, SESSION from minigalaxy.config import Config @@ -166,45 +168,31 @@ def get_download_info(self, game: Game, operating_system="linux", dlc_installers def get_real_download_link(self, url): return self.__request(url)['downlink'] - def get_download_file_md5(self, url): + def get_download_file_info(self, url): """ - Returns a download file's md5 sum - Returns an empty string if anything goes wrong + Returns some information about a downloadable file based on an XML file offered by GOG :param url: Url to get download and checksum links from the API - :return: the md5 sum as string + :return: a FileInfo object with md5 set to the md5 or and empty string and size set to the file size or 0 """ - result = "" + file_info = FileInfo(md5="", size=0) try: checksum_data = self.__request(url) if 'checksum' in checksum_data.keys() and len(checksum_data['checksum']) > 0: xml_data = self.__get_xml_checksum(checksum_data['checksum']) if "md5" in xml_data.keys() and len(xml_data["md5"]) > 0: - result = xml_data["md5"] + file_info.md5 = xml_data["md5"] + if "total_size" in xml_data.keys() and len(xml_data["total_size"]) > 0: + file_info.size = int(xml_data["total_size"]) except requests.exceptions.RequestException as e: - print("Couldn't retrieve md5. Encountered HTTP exception: {}".format(e)) - if not result: - print("Couldn't find md5 in xml checksum data") + print("Couldn't retrieve file info. Encountered HTTP exception: {}".format(e)) - return result + if not file_info.md5: + print("Couldn't find md5 in xml checksum data") - def get_file_size(self, url): - """ - Returns the file size according to an XML file offered by GOG - Returns 0 if anything goes wrong - :param url: Url to get download and checksum links from the API - :return: probable file size in bytes as int - """ - result = 0 - checksum_data = self.__request(url) - if 'checksum' in checksum_data.keys() and len(checksum_data['checksum']) > 0: - xml_data = self.__get_xml_checksum(checksum_data['checksum']) - if "total_size" in xml_data.keys() and int(xml_data["total_size"]) > 0: - result = int(xml_data["total_size"]) - - if not result: + if not file_info.size: print("Couldn't find file size in xml checksum data") - return result + return file_info @staticmethod def __get_xml_checksum(url): diff --git a/minigalaxy/file_info.py b/minigalaxy/file_info.py new file mode 100644 index 00000000..0f53f7f2 --- /dev/null +++ b/minigalaxy/file_info.py @@ -0,0 +1,7 @@ +class FileInfo: + """ + Just a container for the md5 checksum and file size of a downloadable file + """ + def __init__(self, md5, size): + self.md5 = md5 + self.size = size diff --git a/minigalaxy/ui/gametile.py b/minigalaxy/ui/gametile.py index 8248fd25..f35f4b2b 100644 --- a/minigalaxy/ui/gametile.py +++ b/minigalaxy/ui/gametile.py @@ -249,7 +249,8 @@ def __download(self, download_info, finish_func, cancel_to_state): GLib.idle_add(self.parent.parent.show_error, _("Download error"), _(str(e))) download_success = False break - total_file_size += self.api.get_file_size(file_info["downlink"]) + info = self.api.get_download_file_info(file_info["downlink"]) + total_file_size += info.size try: # Extract the filename from the download url (filename is between %2F and &token) filename = urllib.parse.unquote(re.search('%2F(((?!%2F).)*)&t', download_url).group(1)) @@ -259,9 +260,8 @@ def __download(self, download_info, finish_func, cancel_to_state): if key == 0: # If key = 0, denote the file as the executable's path executable_path = download_path - md5sum = self.api.get_download_file_md5(file_info["downlink"]) - if md5sum: - self.game.md5sum[os.path.basename(download_path)] = md5sum + if info.md5: + self.game.md5sum[os.path.basename(download_path)] = info.md5 download = Download( url=download_url, save_location=download_path, diff --git a/minigalaxy/ui/gametilelist.py b/minigalaxy/ui/gametilelist.py index c187852f..2d94c3b9 100644 --- a/minigalaxy/ui/gametilelist.py +++ b/minigalaxy/ui/gametilelist.py @@ -252,7 +252,8 @@ def __download(self, download_info, finish_func, cancel_to_state): GLib.idle_add(self.parent.parent.show_error, _("Download error"), _(str(e))) download_success = False break - total_file_size += self.api.get_file_size(file_info["downlink"]) + info = self.api.get_download_file_info(file_info["downlink"]) + total_file_size += info.size try: # Extract the filename from the download url (filename is between %2F and &token) filename = urllib.parse.unquote(re.search('%2F(((?!%2F).)*)&t', download_url).group(1)) @@ -262,9 +263,8 @@ def __download(self, download_info, finish_func, cancel_to_state): if key == 0: # If key = 0, denote the file as the executable's path executable_path = download_path - md5sum = self.api.get_download_file_md5(file_info["downlink"]) - if md5sum: - self.game.md5sum[os.path.basename(download_path)] = md5sum + if info.md5: + self.game.md5sum[os.path.basename(download_path)] = info.md5 download = Download( url=download_url, save_location=download_path, diff --git a/tests/test_api.py b/tests/test_api.py index 5b918479..489f1737 100644 --- a/tests/test_api.py +++ b/tests/test_api.py @@ -138,7 +138,7 @@ def test2_get_version(self): obs = api.get_version(test_game, gameinfo=API_GET_INFO_TOONSTRUCK, dlc_name=dlc_name) self.assertEqual(exp, obs) - def test_get_download_file_md5(self): + def test_get_download_file__info_md5(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} @@ -151,10 +151,10 @@ def test_get_download_file_md5(self): 0261b9225fc10c407df083f6d254c47b ''' exp = "8acedf66c0d2986e7dee9af912b7df4f" - obs = api.get_download_file_md5("url") + obs = api.get_download_file_info("url").md5 self.assertEqual(exp, obs) - def test_get_download_file_md5_returns_empty_string_on_empty_response(self): + def test_get_download_file_info_md5_returns_empty_string_on_empty_response(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} @@ -163,10 +163,10 @@ def test_get_download_file_md5_returns_empty_string_on_empty_response(self): m_constants.SESSION.get().text = "" exp = "" - obs = api.get_download_file_md5("url") + obs = api.get_download_file_info("url").md5 self.assertEqual(exp, obs) - def test_get_download_file_md5_returns_empty_string_on_response_error(self): + def test_get_download_file_info_md5_returns_empty_string_on_response_error(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} @@ -174,10 +174,10 @@ def test_get_download_file_md5_returns_empty_string_on_response_error(self): m_constants.SESSION.get().status_code = http.HTTPStatus.NOT_FOUND exp = "" - obs = api.get_download_file_md5("url") + obs = api.get_download_file_info("url").md5 self.assertEqual(exp, obs) - def test_get_download_file_md5_returns_empty_string_on_missing_md5(self): + def test_get_download_file_info_md5_returns_empty_string_on_missing_md5(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} @@ -191,10 +191,10 @@ def test_get_download_file_md5_returns_empty_string_on_missing_md5(self): ''' exp = "" - obs = api.get_download_file_md5("url") + obs = api.get_download_file_info("url").md5 self.assertEqual(exp, obs) - def test_get_file_size(self): + def test_get_file_info_size(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} @@ -207,10 +207,10 @@ def test_get_file_size(self): 0261b9225fc10c407df083f6d254c47b ''' exp = 36717998 - obs = api.get_file_size("url") + obs = api.get_download_file_info("url").size self.assertEqual(exp, obs) - def test_get_file_size_returns_zero_on_empty_response(self): + def test_get_file_info_size_returns_zero_on_empty_response(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} @@ -219,10 +219,10 @@ def test_get_file_size_returns_zero_on_empty_response(self): m_constants.SESSION.get().text = "" exp = 0 - obs = api.get_file_size("url") + obs = api.get_download_file_info("url").size self.assertEqual(exp, obs) - def test_get_file_size_returns_zero_on_response_error(self): + def test_get_file_info_size_returns_zero_on_response_error(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} @@ -230,30 +230,30 @@ def test_get_file_size_returns_zero_on_response_error(self): m_constants.SESSION.get().status_code = http.HTTPStatus.NOT_FOUND exp = 0 - obs = api.get_file_size("url") + obs = api.get_download_file_info("url").size self.assertEqual(exp, obs) - def test_get_file_size_returns_zero_on_request_exception(self): + def test_get_file_info_size_returns_zero_on_request_exception(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} m_constants.SESSION.get.side_effect = requests.exceptions.RequestException("test") exp = 0 - obs = api.get_file_size("url") + obs = api.get_download_file_info("url").size self.assertEqual(exp, obs) - def test_get_file_size_returns_zero_on_request_timeout_exception(self): + def test_get_file_info_size_returns_zero_on_request_timeout_exception(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} m_constants.SESSION.get.side_effect = requests.exceptions.ReadTimeout("test") exp = 0 - obs = api.get_file_size("url") + obs = api.get_download_file_info("url").size self.assertEqual(exp, obs) - def test_get_file_size_returns_zero_on_missing_total_size(self): + def test_get_file_info_size_returns_zero_on_missing_total_size(self): api = Api() api._Api__request = MagicMock() api._Api__request.return_value = {"checksum": "url"} @@ -267,7 +267,7 @@ def test_get_file_size_returns_zero_on_missing_total_size(self): ''' exp = 0 - obs = api.get_file_size("url") + obs = api.get_download_file_info("url").size self.assertEqual(exp, obs) def test1_get_gamesdb_info(self): From 0d734125cdaeb95b41e00db606fca9ba3f6d8c30 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Mon, 5 Sep 2022 17:20:18 +0200 Subject: [PATCH 19/22] Update CHANGELOG.md --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 552a7f91..38780b2e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -25,6 +25,7 @@ - Add gettext to build dependencies (thanks to larslindq) - Improve error handling upon API errors - Fix several issues with launching Windows games from Minigalaxy +- Fix some games getting stuck on in queue - Add Greek translation (thanks to Pyrofanis) - Add Spanish (Spain) translation (thanks to mbarrio) From 4f9d10dab36b9388a6936ee3231e5d2017b0d381 Mon Sep 17 00:00:00 2001 From: Maxime Lombard Date: Mon, 18 Apr 2022 17:52:01 +0200 Subject: [PATCH 20/22] Add language option for Innoextract installation. --- minigalaxy/installer.py | 29 ++++++++++++++++++++++++++++- 1 file changed, 28 insertions(+), 1 deletion(-) diff --git a/minigalaxy/installer.py b/minigalaxy/installer.py index cf617f0e..7b5736af 100644 --- a/minigalaxy/installer.py +++ b/minigalaxy/installer.py @@ -141,8 +141,10 @@ def extract_windows(game, installer, temp_dir): def extract_by_innoextract(installer, temp_dir): err_msg = "" + lang = lang_install(installer) + print(lang) if shutil.which("innoextract"): - cmd = ["innoextract", installer, "-d", temp_dir, "--gog"] + cmd = ["innoextract", installer, "-d", temp_dir, "--gog", lang] stdout, stderr, exitcode = _exe_cmd(cmd) if exitcode not in [0]: err_msg = _("Innoextract extraction failed.") @@ -335,3 +337,28 @@ def _mv(source_dir, target_dir): if os.path.exists(dst_file): os.remove(dst_file) shutil.move(file_to_copy, destination_dir) + + +# Some installers allow to choose game's language before installation (Divinity Original Sin or XCom EE / XCom 2) +# "--list-languages" option returns "en-US", "fr-FR" etc... for these games. +# Others installers return "French : Français" but disallow to choose game's language before installation +def lang_install(installer): + languages = [] + arg = "" + process = subprocess.Popen(["innoextract", installer, "--list-languages"], stdout=subprocess.PIPE, stderr=subprocess.PIPE) + stdout, stderr = process.communicate() + output = stdout.decode("utf-8") + + for line in output.split('\n'): + if not line.startswith(' -'): + continue + languages.append(line[3:]) + for lang in languages: + if "-" in lang: # lang must be like "en-US" only. + if Config.get("lang") == lang[0:2]: + arg = "--language={}".format(lang) + break + else: + arg = "--language=en-US" + break + return arg From b1ab6c7858cea59f07b2ad01e2d6901d93653dc0 Mon Sep 17 00:00:00 2001 From: Maxime Lombard Date: Sat, 14 May 2022 23:00:07 +0200 Subject: [PATCH 21/22] Move lang_install function in extract_by_innoextract to fix tests errors. --- minigalaxy/installer.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/minigalaxy/installer.py b/minigalaxy/installer.py index 7b5736af..a50d4a2c 100644 --- a/minigalaxy/installer.py +++ b/minigalaxy/installer.py @@ -141,9 +141,8 @@ def extract_windows(game, installer, temp_dir): def extract_by_innoextract(installer, temp_dir): err_msg = "" - lang = lang_install(installer) - print(lang) if shutil.which("innoextract"): + lang = lang_install(installer) cmd = ["innoextract", installer, "-d", temp_dir, "--gog", lang] stdout, stderr, exitcode = _exe_cmd(cmd) if exitcode not in [0]: From 343ba01cbd48aafe53661dbd7d6aeb88d2ffe6c5 Mon Sep 17 00:00:00 2001 From: Wouter Wijsman Date: Mon, 19 Sep 2022 20:44:53 +0200 Subject: [PATCH 22/22] Update changelog to include entry for PR by Kzimir --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 38780b2e..0eb4c95c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ - Improve error handling upon API errors - Fix several issues with launching Windows games from Minigalaxy - Fix some games getting stuck on in queue +- Fix Windows game installation not caring about preferred language (thanks to Kzimir) - Add Greek translation (thanks to Pyrofanis) - Add Spanish (Spain) translation (thanks to mbarrio)