@@ -11,6 +11,7 @@ local Array = Lua.import('Module:Array')
1111local Class = Lua .import (' Module:Class' )
1212local Logic = Lua .import (' Module:Logic' )
1313local Game = Lua .import (' Module:Game' )
14+ local I18n = Lua .import (' Module:I18n' )
1415local Info = Lua .import (' Module:Info' , {loadData = true })
1516local MatchTicker = Lua .import (' Module:MatchTicker' )
1617local MatchTickerEntityDisplay = Lua .import (' Module:MatchTicker/DisplayComponents/Entity' )
@@ -28,9 +29,6 @@ local WarningBoxGroup = Lua.import('Module:Widget/WarningBox/Group')
2829local WidgetUtil = Lua .import (' Module:Widget/Util' )
2930
3031local HiddenDataBox = {}
31- local INVALID_TIER_WARNING = ' ${tierString} is not a known Liquipedia '
32- .. ' ${tierMode}[[Category:Pages with invalid ${tierMode}]]'
33- local INVALID_PARENT = ' ${parent} is not a Liquipedia Tournament[[Category:Pages with invalid parent]]'
3432local DEFAULT_TIER_TYPE = ' general'
3533
3634local Language = mw .getContentLanguage ()
@@ -59,7 +57,8 @@ function HiddenDataBox.run(args)
5957 })[1 ] or {}
6058
6159 if Table .isEmpty (queryResult ) and Namespace .isMain () then
62- table.insert (warnings , String .interpolate (INVALID_PARENT , {parent = parent }))
60+ mw .ext .TeamLiquidIntegration .add_category (' Pages with invalid parent' )
61+ table.insert (warnings , I18n .translate (' hiddendatabox-invalid-parent-warning' , {parent = parent }))
6362 else
6463 local date = HiddenDataBox .cleanDate (args .date , args .sdate ) or queryResult .startdate or
6564 Variables .varDefault (' tournament_startdate' ) or HiddenDataBox .cleanDate (args .edate ) or
@@ -214,11 +213,19 @@ function HiddenDataBox.validateTier(tier, tierType)
214213 local tierValue , tierTypeValue = Tier .toValue (tier , tierType )
215214
216215 if tier and not tierValue then
217- table.insert (warnings , String .interpolate (INVALID_TIER_WARNING , {tierString = tier , tierMode = ' Tier' }))
216+ mw .ext .TeamLiquidIntegration .add_category (' Pages with invalid Tier' )
217+ table.insert (
218+ warnings ,
219+ I18n .translate (' hiddendatabox-invalid-tier-warning' , {tierString = tier , tierMode = ' Tier' })
220+ )
218221 end
219222
220223 if tierType and tierType :lower () ~= DEFAULT_TIER_TYPE and not tierTypeValue then
221- table.insert (warnings , String .interpolate (INVALID_TIER_WARNING , {tierString = tierType , tierMode = ' Tiertype' }))
224+ mw .ext .TeamLiquidIntegration .add_category (' Pages with invalid Tiertype' )
225+ table.insert (
226+ warnings ,
227+ I18n .translate (' hiddendatabox-invalid-tier-warning' , {tierString = tierType , tierMode = ' Tiertype' })
228+ )
222229 end
223230
224231 return tierValue , tierTypeValue , warnings
0 commit comments