Skip to content

feat: Add widget for listing pages that need translation#7249

Open
LemurVladimir wants to merge 4 commits intoLiquipedia:mainfrom
LemurVladimir:main
Open

feat: Add widget for listing pages that need translation#7249
LemurVladimir wants to merge 4 commits intoLiquipedia:mainfrom
LemurVladimir:main

Conversation

@LemurVladimir
Copy link
Contributor

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

@LemurVladimir LemurVladimir requested review from a team as code owners March 13, 2026 21:39
Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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

@LemurVladimir
Copy link
Contributor Author

Changes implemented as requested.

Copy link
Collaborator

@hjpalpha hjpalpha left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm on phone

@hjpalpha hjpalpha changed the title [feat] Listing articles in need of translation feat: Add widget for listing pages that need translation Mar 14, 2026
Comment on lines +26 to +27
-- can not use defaultProps due to casting to number
local limit = tonumber(self.props.limit) or DEFAULT_LIMIT
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if you enter bullshit in the call it would be nil instead of the default value

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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)
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What is the use case of this variable?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It will be used to display the number of articles that are in need of translation via the Module:Widget/MainPage/WantToHelp.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants