Commit Graph

3 Commits

Author SHA1 Message Date
modeco80
e3f0ec56a2 Port modals to HTML dialog
Places that used alert() now use a custom dialog. Also the change username modal has been remade.

Also styles some elements. These aren't final, more just to actually style them.

I would like to use jsx or osmething instead of stuffing these in the html, especially since it would allow us to single-source-of-truth i18n (removing our second-source-of-truth in the i18n module that statically replace stuff) in a lot more places. and make other code a lot less iffy.

we do NOT need react or some shit if we do that. just nano-jsx, or something even simpler is more than good enough, and should keep us in our "100 kb smaller" track
2024-03-25 10:12:01 -04:00
modeco80
6327036283 Implement basic i18n
Not fully functional yet, so this won't/shouldn't be pushed onto the site yet (no language dropdown, there are still quite a few hardcoded strings that need to become string keys ...) but it works more than well enough to at least test and add more things as string keys that are currently hardcoded.

There are two languages provided, "en-us" and "pirate". Pirate is a test language to make sure all string keys are applying properly and all that.

As a bonus the new I18n system also offers a slightly less boneheaded way to do replacements, which is much more flexible than blind replace calls, and can take any type which is able to be stringified.

The parsing code for this is far from my best work, but it'll do for now, and seems to work okay (and has basic idiot proofing), so eh.

Supersedes #13.
2024-03-12 06:45:03 -04:00
modeco80
125e6a769d reformat typescript code with prettier
Mostly just for nicity. I did manually clean up a few things, but other than that, this basically was just importing configs from cvm3/crusttest, adding prettier as a dev dependency, and just ctrl-shift-I on every typescript file part of the codebase
2024-03-12 01:28:23 -04:00