Make contributors list a variable in About screen
Ellypse opened this issue ยท 9 comments
For now, every time we have a new contributor joining the project we have to update the list in the About screen of the Dashboard to add them, then make sure the changes are populated for all the localizations.
We would want to have a table (similar to how I handle Patreon supporters in the same text) of { contributorName = role } then output that list in the text.
While we're at it, also add Contributor to Solanya.
Simple enough task, I'll take a look... I want to say tomorrow. Might be tonight, might be Thursday - all depends on tiredness levels, how well raid goes, etc.
No rush, version 1.3.2 will probably be in beta a few days, and from the look of it we will have a beta 2 anyway ^^
For me, so that I don't forget:
- Update all the localizations on CurseForge to use the named replacement tokens.
On the subject of named replacements, should Ellyb get a special string.format
like function that allows us to use them elsewhere, rather than special casing the contributor text?
Ellyb.String.formatNamed(formatString: string, replacements: table)
This would handle the standard replacements (eg. %s
, %.2f
) using whatever's contained in the array segment of the table as-per normal rules, incrementing after each found match.
Named replacements are accepted in the form %{key[:format]}
where the format
can be s
(default if omitted), .2f
, etc. If the key can be tonumber()
'd, it will be.
local fmt = Ellyb.String.formatNamed;
fmt("%{data}", { data = "123" });
-- Returns: 123
fmt("%{1} eats %{3:#06x} %{item:s}. %s isn't very normal.", { [1] = "Elsa", [2] = "Unused", [3] = 500, item = "snowflakes" });
-- Returns: Elsa eats 0x01f4 snowflakes. Elsa isn't very normal.
-- (Note that the trailing %s refers to index 1 because it's the first position-dependent replacement).
Ellyb.String.format(formatString: string, ...)
The Ellyb.String.format
function would effectively be the same as calling Ellyb.String.formatNamed(formatString, { ... })
but without the garbage table.
This basically just gives you a string.format
-compatible replacement that also lets you re-order inputs in the actual localised text (eg. Ellyb.String.format("%{2} smells like %{1}.", "ice cubes", "Anna")
.
You can already re-order inputs using %1$s
,%2$s
etc. with the default string.format
^^ That's WoW specific I think.
But your proposition is more powerful and it might indeed be interesting to have advanced formatting capabilities in Ellyb.
Huh, that explains a lot actually. In that case we could drop the second function entirely and change the named specifiers to %key$format
for consistency, basically just allowing the key
to be a string or number.
Agreed on not delaying the release given the extent of the changes. Hadn't quite planned on rewriting half the dashboard, I must say... ๐
I'm probably gonna move this for a 1.3.3. There are some bug fixes 1.3.2 that I would want to be out asap, and the way this is going, I will want to have a beta for that new dashboard system. Heck, the way it is going, I might want to push for the carousel right now, since we are knees deep in the Dashboard.
I will release 1.3.2 with the current changes this weekend, this ticket will be for next version.
For reference, the carousel is ticket #44
If you don't jump on it like a freaking savage, I will do it myself this weekend ๐