From 3f637302fec196537eecec50db8de6b047e53bb5 Mon Sep 17 00:00:00 2001 From: Conatum Date: Wed, 8 Mar 2023 16:49:42 +0200 Subject: [PATCH] fix (shop): Fix localisation issues. --- src/modules/shop/cog.py | 2 +- src/modules/shop/shops/base.py | 1 - src/modules/shop/shops/colours.py | 8 ++++---- 3 files changed, 5 insertions(+), 6 deletions(-) diff --git a/src/modules/shop/cog.py b/src/modules/shop/cog.py index e932f15f..290bbdf2 100644 --- a/src/modules/shop/cog.py +++ b/src/modules/shop/cog.py @@ -205,7 +205,7 @@ class StoreManager(ui.LeoUI): buttons.append(pressed_switch_shop) @ui.AButton( - label=_p('ui:stores|button:close|label', "Close"), + label=t(_p('ui:stores|button:close|label', "Close")), emoji=self.bot.config.emojis.getemoji('cancel') ) async def pressed_close(press: discord.Interaction, pressed): diff --git a/src/modules/shop/shops/base.py b/src/modules/shop/shops/base.py index 34faa398..99e53836 100644 --- a/src/modules/shop/shops/base.py +++ b/src/modules/shop/shops/base.py @@ -211,7 +211,6 @@ class Store(ui.LeoUI): # If the user keeps using the UI, # but never closes it until the origin interaction expires raise ValueError("This interaction has expired!") - return if self.embed is None: await self.refresh() diff --git a/src/modules/shop/shops/colours.py b/src/modules/shop/shops/colours.py index 93e301b1..301980aa 100644 --- a/src/modules/shop/shops/colours.py +++ b/src/modules/shop/shops/colours.py @@ -1060,9 +1060,9 @@ class ColourStore(Store): """ shop: ColourShop - @select(placeholder=_p("ui:colourstore|menu:buycolours|placeholder", "Select to Buy")) + @select(placeholder="SELECT_PLACEHOLDER") async def select_colour(self, interaction: discord.Interaction, selection: Select): - t = self.bot.translator.t + t = self.shop.bot.translator.t # User selected a colour from the list # Run purchase pathway for that item @@ -1106,7 +1106,7 @@ class ColourStore(Store): For an item to be purchasable, it needs to be affordable and not currently owned by the member. """ - t = self.bot.translator.t + t = self.shop.bot.translator.t selector = self.select_colour # Get the list of ColourRoleItems that may be purchased @@ -1151,7 +1151,7 @@ class ColourStore(Store): """ Embed for this shop. """ - t = self.bot.translator.t + t = self.shop.bot.translator.t if self.shop.items: owned = self.shop.owned() lines = []