Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions lua/wikis/commons/I18n/Data.lua
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,10 @@ return {
-- MatchSummary Map Veto
['matchsummary-mapveto-start'] = 'Start Map Veto',

-- MatchTable
['matchtable-no-match-results'] = 'This ${mode} has not played any matches yet.',
['matchtable-no-h2h-match-results'] = 'These ${mode} have not played any matches against each other yet.',

-- MatchTicker
['matchticker-upcoming-matches'] = 'Upcoming Matches',

Expand Down
23 changes: 20 additions & 3 deletions lua/wikis/commons/MatchTable.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ local Class = Lua.import('Module:Class')
local Countdown = Lua.import('Module:Countdown')
local DateExt = Lua.import('Module:Date/Ext')
local Game = Lua.import('Module:Game')
local I18n = Lua.import('Module:I18n')
local Info = Lua.import('Module:Info', {loadData = true})
local LeagueIcon = Lua.import('Module:LeagueIcon')
local Logic = Lua.import('Module:Logic')
Expand Down Expand Up @@ -568,14 +569,30 @@ function MatchTable:buildDisplay()
:node(self:headerRow())

if Table.isEmpty(self.matches) then
local text = 'This ' .. (self.config.mode == Opponent.solo and Opponent.solo or Opponent.team)
.. ' has not played any matches yet.'
---@return string
local function getNoResultText()
local isH2H = Logic.isNotEmpty(self.config.vs)
if isH2H then
return I18n.translate(
'matchtable-no-h2h-match-results',
{
mode = self.config.mode == Opponent.solo and 'players' or 'teams',
}
)
end
return I18n.translate(
'matchtable-no-match-results',
{
mode = self.config.mode == Opponent.solo and 'player' or 'team',
}
)
end

return display:tag('tr')
:tag('td')
:attr('colspan', '100')
:css('font-style', 'italic')
:wikitext(text)
:wikitext(getNoResultText())
:allDone()
end

Expand Down
Loading