feat: Add widget for listing pages that need translation#7249
feat: Add widget for listing pages that need translation#7249LemurVladimir wants to merge 4 commits intoLiquipedia:mainfrom
Conversation
hjpalpha
left a comment
There was a problem hiding this comment.
modulo the anno comment codewise okay for me
personally i would have named it TanslationWantedList (or similar) since that is what it is used for
TranslationList to me sounds like a list of available translations
|
Changes implemented as requested. |
| -- can not use defaultProps due to casting to number | ||
| local limit = tonumber(self.props.limit) or DEFAULT_LIMIT |
There was a problem hiding this comment.
What's the issue with defaultProps?
you can still do
local limit = tonumber(self.props.limit), regardless of whether the prop is from a default or from input.
There was a problem hiding this comment.
if you enter bullshit in the call it would be nil instead of the default value
There was a problem hiding this comment.
If that's a concern, can add assert(limit, "Limit must be a number").
| local limit = tonumber(self.props.limit) or DEFAULT_LIMIT | ||
|
|
||
| local translations = TranslationNeededList._getTranslations() | ||
| Variables.varDefine('total_number_of_translations', #translations) |
There was a problem hiding this comment.
What is the use case of this variable?
There was a problem hiding this comment.
It will be used to display the number of articles that are in need of translation via the Module:Widget/MainPage/WantToHelp.
Summary
This code mirrors the functionality of Widget/WantToHelpList but for listing the articles that require translation.
This also should allow updating the number of such articles through the variable.
Requested by /dota2gameru to improve keeping track of the progress.
How did you test this change?
This code is a copy of what was tested here with minor naming changes.
https://liquipedia.net/dota2gameru/%D0%9C%D0%BE%D0%B4%D1%83%D0%BB%D1%8C:Widget/TranslateList
This list is succesfully being created as shown here.
https://liquipedia.net/dota2gameru/Liquipedia:Translation/All