diff --git a/po/de_pysol.po b/po/de_pysol.po index 47a519a4..80618922 100644 --- a/po/de_pysol.po +++ b/po/de_pysol.po @@ -3,7 +3,7 @@ msgstr "" "Project-Id-Version: PySol 0.0.1\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-12-10 10:19-0500\n" -"PO-Revision-Date: 2023-09-03 19:05-0400\n" +"PO-Revision-Date: 2023-09-17 19:51-0400\n" "Last-Translator: H. Schaekel \n" "Language-Team: German\n" "Language: de\n" @@ -725,6 +725,12 @@ msgstr "" "\n" "Bitte überprüfen Sie die Installation von %(app)s.\n" +msgid "PySol cannot find cardsets of the following types:" +msgstr "" + +msgid "\\" +msgstr "" + #: pysollib/main.py:66 pysollib/main.py:78 pysollib/main.py:313 #: pysollib/ui/tktile/menubar.py:346 msgid "&Quit" @@ -919,6 +925,39 @@ msgstr "Nur Trumpf" msgid "Matching" msgstr "" +msgid "No Jokers" +msgstr "" + +msgid "Joker Deck" +msgstr "" + +msgid "3x3" +msgstr "" + +msgid "4x4" +msgstr "" + +msgid "5x5" +msgstr "" + +msgid "6x6" +msgstr "" + +msgid "7x7" +msgstr "" + +msgid "8x8" +msgstr "" + +msgid "9x9" +msgstr "" + +msgid "10x10" +msgstr "" + +msgid "With %(cards)d or more cards" +msgstr "" + #: pysollib/resource.py:219 msgid "Adult" msgstr "Erwachsene" diff --git a/po/fr_pysol.po b/po/fr_pysol.po index f37a47f5..b6408317 100644 --- a/po/fr_pysol.po +++ b/po/fr_pysol.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: 1.02\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-12-10 10:19-0500\n" -"PO-Revision-Date: 2023-09-03 19:06-0400\n" +"PO-Revision-Date: 2023-09-17 19:51-0400\n" "Last-Translator: Eric Rausch \n" "Language-Team: French\n" "Language: fr\n" @@ -755,6 +755,12 @@ msgstr "" "\n" "Vérifiez votre installation de %(app)s.\n" +msgid "PySol cannot find cardsets of the following types:" +msgstr "" + +msgid "\\" +msgstr "" + #: pysollib/main.py:66 pysollib/main.py:78 pysollib/main.py:313 #: pysollib/ui/tktile/menubar.py:346 msgid "&Quit" @@ -949,6 +955,39 @@ msgstr "Atouts seulement" msgid "Matching" msgstr "" +msgid "No Jokers" +msgstr "" + +msgid "Joker Deck" +msgstr "" + +msgid "3x3" +msgstr "" + +msgid "4x4" +msgstr "" + +msgid "5x5" +msgstr "" + +msgid "6x6" +msgstr "" + +msgid "7x7" +msgstr "" + +msgid "8x8" +msgstr "" + +msgid "9x9" +msgstr "" + +msgid "10x10" +msgstr "" + +msgid "With %(cards)d or more cards" +msgstr "" + #: pysollib/resource.py:219 msgid "Adult" msgstr "Adulte" diff --git a/po/it_pysol.po b/po/it_pysol.po index 80830a20..0f567cf2 100644 --- a/po/it_pysol.po +++ b/po/it_pysol.po @@ -12,7 +12,7 @@ msgstr "" "Project-Id-Version: it_pysol\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-12-10 10:19-0500\n" -"PO-Revision-Date: 2023-09-03 19:07-0400\n" +"PO-Revision-Date: 2023-09-17 19:52-0400\n" "Last-Translator: Giuliano Colla \n" "Language-Team: Italiano \n" "Language: it\n" @@ -763,6 +763,12 @@ msgstr "" "\n" "Verificare l'installazione di %s.\n" +msgid "PySol cannot find cardsets of the following types:" +msgstr "" + +msgid "\\" +msgstr "" + #: pysollib/main.py:66 pysollib/main.py:78 pysollib/main.py:313 #: pysollib/ui/tktile/menubar.py:346 msgid "&Quit" @@ -957,6 +963,39 @@ msgstr "Solo Trionfi" msgid "Matching" msgstr "" +msgid "No Jokers" +msgstr "" + +msgid "Joker Deck" +msgstr "" + +msgid "3x3" +msgstr "" + +msgid "4x4" +msgstr "" + +msgid "5x5" +msgstr "" + +msgid "6x6" +msgstr "" + +msgid "7x7" +msgstr "" + +msgid "8x8" +msgstr "" + +msgid "9x9" +msgstr "" + +msgid "10x10" +msgstr "" + +msgid "With %(cards)d or more cards" +msgstr "" + #: pysollib/resource.py:219 msgid "Adult" msgstr "Adulti" diff --git a/po/pl_pysol.po b/po/pl_pysol.po index 9411681b..f24c5bb7 100644 --- a/po/pl_pysol.po +++ b/po/pl_pysol.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: PySolFC\n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-12-10 10:19-0500\n" -"PO-Revision-Date: 2023-09-03 19:07-0400\n" +"PO-Revision-Date: 2023-09-17 19:52-0400\n" "Last-Translator: Jerzy Trzeciak \n" "Language-Team: Polish \n" "Language: pl\n" @@ -755,6 +755,12 @@ msgstr "" "\n" "Proszę sprawdzić poprawność instalacji %(app)s.\n" +msgid "PySol cannot find cardsets of the following types:" +msgstr "" + +msgid "\\" +msgstr "" + #: pysollib/main.py:66 pysollib/main.py:78 pysollib/main.py:313 #: pysollib/ui/tktile/menubar.py:346 msgid "&Quit" @@ -954,6 +960,39 @@ msgstr "Tylko Atu" msgid "Matching" msgstr "" +msgid "No Jokers" +msgstr "" + +msgid "Joker Deck" +msgstr "" + +msgid "3x3" +msgstr "" + +msgid "4x4" +msgstr "" + +msgid "5x5" +msgstr "" + +msgid "6x6" +msgstr "" + +msgid "7x7" +msgstr "" + +msgid "8x8" +msgstr "" + +msgid "9x9" +msgstr "" + +msgid "10x10" +msgstr "" + +msgid "With %(cards)d or more cards" +msgstr "" + #: pysollib/resource.py:219 msgid "Adult" msgstr "Dla dorosłych" diff --git a/po/pt_BR_pysol.po b/po/pt_BR_pysol.po index 9bcc7c9d..01b932d9 100644 --- a/po/pt_BR_pysol.po +++ b/po/pt_BR_pysol.po @@ -8,7 +8,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-12-10 10:19-0500\n" -"PO-Revision-Date: 2023-09-03 19:07-0400\n" +"PO-Revision-Date: 2023-09-17 19:53-0400\n" "Last-Translator: Matheus Knack \n" "Language-Team: \n" "Language: pt_BR\n" @@ -754,6 +754,12 @@ msgstr "" "\n" "Por favor verifique a instalação do %(app)s.\n" +msgid "PySol cannot find cardsets of the following types:" +msgstr "" + +msgid "\\" +msgstr "" + #: pysollib/main.py:66 pysollib/main.py:78 pysollib/main.py:313 #: pysollib/ui/tktile/menubar.py:346 msgid "&Quit" @@ -948,6 +954,39 @@ msgstr "Apenas trunfos" msgid "Matching" msgstr "Combinados" +msgid "No Jokers" +msgstr "" + +msgid "Joker Deck" +msgstr "" + +msgid "3x3" +msgstr "" + +msgid "4x4" +msgstr "" + +msgid "5x5" +msgstr "" + +msgid "6x6" +msgstr "" + +msgid "7x7" +msgstr "" + +msgid "8x8" +msgstr "" + +msgid "9x9" +msgstr "" + +msgid "10x10" +msgstr "" + +msgid "With %(cards)d or more cards" +msgstr "" + #: pysollib/resource.py:219 msgid "Adult" msgstr "Adulto" diff --git a/po/pysol.pot b/po/pysol.pot index bacfd32a..73c6248e 100644 --- a/po/pysol.pot +++ b/po/pysol.pot @@ -697,6 +697,14 @@ msgid "" "Please check your %(app)s installation.\n" msgstr "" +msgid "PySol cannot find cardsets of the following types:" +msgstr "" + +msgid "\n +This may make games that use those types of cardsets unplayable. Please\n +ensure that your Cardsets package is up to date." +msgstr "" + #: pysollib/main.py:66 pysollib/main.py:78 pysollib/main.py:313 #: pysollib/ui/tktile/menubar.py:346 msgid "&Quit" @@ -863,6 +871,39 @@ msgstr "" msgid "Matching" msgstr "" +msgid "No Jokers" +msgstr "" + +msgid "Joker Deck" +msgstr "" + +msgid "3x3" +msgstr "" + +msgid "4x4" +msgstr "" + +msgid "5x5" +msgstr "" + +msgid "6x6" +msgstr "" + +msgid "7x7" +msgstr "" + +msgid "8x8" +msgstr "" + +msgid "9x9" +msgstr "" + +msgid "10x10" +msgstr "" + +msgid "With %(cards)d or more cards" +msgstr "" + #: pysollib/resource.py:219 msgid "Adult" msgstr "" diff --git a/po/ru_pysol.po b/po/ru_pysol.po index 77955310..14fb1494 100644 --- a/po/ru_pysol.po +++ b/po/ru_pysol.po @@ -7,7 +7,7 @@ msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" "POT-Creation-Date: 2021-12-10 10:19-0500\n" -"PO-Revision-Date: 2023-09-03 19:08-0400\n" +"PO-Revision-Date: 2023-09-17 19:54-0400\n" "Last-Translator: Skomoroh \n" "Language-Team: Russian \n" "Language: ru\n" @@ -750,6 +750,12 @@ msgstr "" "\n" "Пожалуйста проверьте установку %(app)s.\n" +msgid "PySol cannot find cardsets of the following types:" +msgstr "" + +msgid "\\" +msgstr "" + #: pysollib/main.py:66 pysollib/main.py:78 pysollib/main.py:313 #: pysollib/ui/tktile/menubar.py:346 msgid "&Quit" @@ -944,6 +950,39 @@ msgstr "Без мастей" msgid "Matching" msgstr "" +msgid "No Jokers" +msgstr "" + +msgid "Joker Deck" +msgstr "" + +msgid "3x3" +msgstr "" + +msgid "4x4" +msgstr "" + +msgid "5x5" +msgstr "" + +msgid "6x6" +msgstr "" + +msgid "7x7" +msgstr "" + +msgid "8x8" +msgstr "" + +msgid "9x9" +msgstr "" + +msgid "10x10" +msgstr "" + +msgid "With %(cards)d or more cards" +msgstr "" + #: pysollib/resource.py:219 msgid "Adult" msgstr "Для взрослых" diff --git a/pysollib/main.py b/pysollib/main.py index 8cf1d69b..7b8fcf49 100644 --- a/pysollib/main.py +++ b/pysollib/main.py @@ -324,6 +324,18 @@ Please check your %(app)s installation. if app.cardset_manager.len() == 0: fatal_no_cardsets(app) return 3 + missing = app.cardset_manager.identify_missing_cardsets() + if len(missing) > 0: + error_text = \ + _('''PySol cannot find cardsets of the following types:''') + error_text += "\n\n" + for missingtype in missing: + error_text += missingtype + "\n" + error_text += _(''' +This may make games that use those types of cardsets unplayable. Please +ensure that your Cardsets package is up to date.''') + MfxMessageDialog(top, title=_("Cardset error"), text=error_text, + bitmap="error") if not cardset: MfxMessageDialog(top, title=_("Cardset error"), text=_(''' diff --git a/pysollib/resource.py b/pysollib/resource.py index f061e0ba..c827bc94 100644 --- a/pysollib/resource.py +++ b/pysollib/resource.py @@ -223,6 +223,18 @@ class CSI: 11: _("Puzzle") } + SUBTYPE_NAME = { + 1: {0: _("No Jokers"), 1: _("Joker Deck")}, + 11: {3: _("3x3"), + 4: _("4x4"), + 5: _("5x5"), + 6: _("6x6"), + 7: _("7x7"), + 8: _("8x8"), + 9: _("9x9"), + 10: _("10x10")} + } + TYPE_ID = { 1: "french", 2: "hanafuda", @@ -465,6 +477,8 @@ class CardsetManager(ResourceManager): def __init__(self): ResourceManager.__init__(self) self.registered_types = {} + self.registered_subtypes = {} + self.type_max_cards = {} self.registered_sizes = {} self.registered_styles = {} self.registered_nationalities = {} @@ -569,11 +583,65 @@ class CardsetManager(ResourceManager): # s = cs.si.type self.registered_types[s] = self.registered_types.get(s, 0) + 1 + if self.registered_types[s] == 1: + self.registered_subtypes[s] = {} + ss = cs.si.subtype + self.registered_subtypes[s][ss] = \ + self.registered_subtypes.get(s, 0).get(ss, 0) + 1 + if s not in self.type_max_cards or self.type_max_cards[s] < cs.ncards: + self.type_max_cards[s] = cs.ncards s = cs.si.size self.registered_sizes[s] = self.registered_sizes.get(s, 0) + 1 cs.updateCardback() ResourceManager.register(self, cs) + def identify_missing_cardsets(self): + missing = [] + # This object should list the bare minimum cardset requirements + # for a PySol install that can play all games. + required_types = { + CSI.TYPE_FRENCH: { + CSI.SUBTYPE_JOKER_DECK + }, + CSI.TYPE_HANAFUDA: {}, + CSI.TYPE_TAROCK: {}, + CSI.TYPE_MAHJONGG: {}, + CSI.TYPE_HEXADECK: {}, + CSI.TYPE_MUGHAL_GANJIFA: {}, + CSI.TYPE_DASHAVATARA_GANJIFA: {}, + CSI.TYPE_TRUMP_ONLY: {}, + CSI.TYPE_PUZZLE: { + CSI.SUBTYPE_3X3, + CSI.SUBTYPE_4X4, + CSI.SUBTYPE_5X5, + CSI.SUBTYPE_6X6, + CSI.SUBTYPE_7X7, + CSI.SUBTYPE_8X8, + CSI.SUBTYPE_9X9, + CSI.SUBTYPE_10X10 + } + } + required_cards_needed = { + CSI.TYPE_TRUMP_ONLY: 100 + } + for t in required_types.keys(): + if t not in self.registered_types: + missing.append(CSI.TYPE_NAME[t]) + else: + if len(required_types[t]) > 0: + for tt in required_types[t]: + if tt not in self.registered_subtypes[t]: + missing.append(CSI.TYPE_NAME[t] + " (" + + CSI.SUBTYPE_NAME[t][tt] + ")") + if t in required_cards_needed: + if self.type_max_cards[t] < required_cards_needed[t]: + missing.append(CSI.TYPE_NAME[t] + " (" + + _("With %(cards)d or more cards" + ")") + % {'cards': required_cards_needed[t]}) + + missing.sort() + return missing + # ************************************************************************ # * Tile