Skip to content

Commit

Permalink
fix filtering
Browse files Browse the repository at this point in the history
  • Loading branch information
Rathoz committed Jan 10, 2025
1 parent 87cddc9 commit 54b33ce
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 174 deletions.
168 changes: 0 additions & 168 deletions .editorconfig

This file was deleted.

4 changes: 2 additions & 2 deletions components/widget/tournaments/widget_tournament_label.lua
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ function TournamentsTickerWidget:render()
if not tournament then
return
end
return HtmlWidgets.Li{children = HtmlWidgets.Div{
return HtmlWidgets.Div{
css = {
display = 'flex',
gap = '5px',
Expand Down Expand Up @@ -68,7 +68,7 @@ function TournamentsTickerWidget:render()
},
},
},
}}
}
end

return TournamentsTickerWidget
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function TournamentsTickerWidget:render()
return Array.reduce(self.props.filterGroups or {}, function(prev, filter)
return HtmlWidgets.Div{
attributes = {
['data-filter-group'] = 'filterbuttons-' .. filter,
['data-filter-group'] = 'filterbuttons-' .. string.lower(filter),
['data-filter-category'] = tournament[filter],
['data-curated'] = tournament.featured and '' or nil,
},
Expand All @@ -43,7 +43,7 @@ function TournamentsTickerWidget:render()
local list = HtmlWidgets.Ul{
classes = {'tournaments-list-type-list'},
children = Array.map(self.props.tournaments, function(tournament)
return createFilterWrapper(tournament, TournamentLabel{tournament = tournament})
return HtmlWidgets.Li{children = createFilterWrapper(tournament, TournamentLabel{tournament = tournament})}
end),
}

Expand Down
8 changes: 6 additions & 2 deletions standard/i18n.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,21 +6,25 @@
-- Please see https://github.com/Liquipedia/Lua-Modules to contribute
--

local FnUtil = require('Module:FnUtil')
local Lua = require('Module:Lua')
local String = require('Module:StringUtils')

local I18nData = Lua.import('Module:I18n/Data', {loadData = true})
local I18n = {}

local LANGUAGE = mw.language.getContentLanguage():getCode()
local getLanguage = FnUtil.memoize(function ()
return mw.language.getContentLanguage():getCode()
end)

---Interpolates an i18n string with data
---TODO Add pluralization support (https://cldr.unicode.org/index/cldr-spec/plural-rules)
---@param key string
---@param data table<string, string|number>?
---@return string
function I18n.translate(key, data)
local langMessages = I18nData[LANGUAGE] or I18nData.en
local language = getLanguage()
local langMessages = I18nData[language] or I18nData.en
local message = langMessages[key] or I18nData.en[key]
if not message then
return '' .. key .. ''
Expand Down

0 comments on commit 54b33ce

Please sign in to comment.