fix (shop): Fix localisation issues.

This commit is contained in:
2023-03-08 16:49:42 +02:00
parent ab70c3178e
commit 3f637302fe
3 changed files with 5 additions and 6 deletions

View File

@@ -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):

View File

@@ -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()

View File

@@ -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 = []