guweb icon indicating copy to clipboard operation
guweb copied to clipboard

i18n, redesign, admin panel

Open arily opened this issue 2 years ago • 22 comments

This pull request includes several key features to improve user experience and add more features.

Features:

  • Internationalization (i18n)
  • User management with a more populated table
  • Beatmap management (currently requires the user to have an API key, but we are open to better ideas)
  • ~~Score uploads (pending merge of https://github.com/osuAkatsuki/bancho.py/pull/281)~~ removed from codebase

Visual changes:

  • Removing the admin side panel in favor of a top bar
  • subtle animations
  • language switcher

Fixes:

  • Fixing a dangerous API key injection:
<script>
    window.api_key = {{ session.user_data['api_key'] | JSON }} // it was really scary!
</script>

i18n

requires node during development, we recommend using vscode for developing translation for better tooling, you will be prompted to install recommended plugins when you open the repository for the first time. we will update the readme later to include the tutorial on managing translations.

steps

  • make sure you have node and yarn installed.
  • run yarn
  • create config.js from config.sample.js
  • run yarn i18n:build
  • you are good to go.

Sorry for creating a pull request this large 👩‍🦼

arily avatar Jan 27 '23 15:01 arily

dude WHATTTTTTTTTTTTTT

varkaria avatar Jan 27 '23 16:01 varkaria

afaik guweb 2.0 is already being worked on tho

Also I think it would make more sense to upgrade guweb to api v2 if you're already doing api stuff, api v1 is deprecated and that's why /submit_score won't be merged

minisbett avatar Jan 27 '23 16:01 minisbett

image you might wanna delete this folder?

minisbett avatar Jan 27 '23 16:01 minisbett

image I also see stuff like this that should not be defaulted to chinese I guess

minisbett avatar Jan 27 '23 16:01 minisbett

I think you should get rid of everything that says "gulag" instead of renaming stuff to gulag

minisbett avatar Jan 27 '23 16:01 minisbett

tbh I think this PR is too big to get merged as a whole, you should trim stuff down, like redesigning stuff, making QOL changes, implementing yarn etc.

minisbett avatar Jan 27 '23 16:01 minisbett

give this man some TRUE

alowave223 avatar Jan 27 '23 16:01 alowave223

tbh I think this PR is too big to get merged as a whole, you should trim stuff down, like redesigning stuff, making QOL changes, implementing yarn etc.

I should check the 'draft' when I created this pr.

we made these changes through out the months, simultaneously, so it's really hard to separate one changes with another.

Let's focus on addressing any problems inside the code we should fix. Then we could try to create separate pull requests in order to merge them.

arily avatar Jan 27 '23 17:01 arily

image you might wanna delete this folder?

I think it's better to have translations for any private server that willing to contribute leaving their translations in the repository . you'll never know when it's needed.

arily avatar Jan 27 '23 17:01 arily

image I also see stuff like this that should not be defaulted to chinese I guess

@app.template_global()
def t(key, **kwargs) -> str:
    kwargs["locale"] = session.get("lang", config.default_locale)

it looks like this now, please check out the latest code

arily avatar Jan 27 '23 17:01 arily

image you might wanna delete this folder?

I think it's better to have translations for any private server that willing to contribute leaving their translations in the repository . you'll never know when it's needed.

I don't really understand what the folder is for, maybe give it a more clarifying name

minisbett avatar Jan 27 '23 17:01 minisbett

image you might wanna delete this folder?

I think it's better to have translations for any private server that willing to contribute leaving their translations in the repository . you'll never know when it's needed.

I don't really understand what the folder is for, maybe give it a more clarifying name

it's our translation on top of the default translation. Do you have any suggestions on what we should rename it?

arily avatar Jan 27 '23 17:01 arily

image you might wanna delete this folder?

I think it's better to have translations for any private server that willing to contribute leaving their translations in the repository . you'll never know when it's needed.

I don't really understand what the folder is for, maybe give it a more clarifying name

it's our translation on top of the default translation. Do you have any suggestions on what we should rename it?

Oh I see, so if you modify the frontend and add your own texts you put them in there? Why not edit the normal files instead?

minisbett avatar Jan 27 '23 17:01 minisbett

image you might wanna delete this folder?

I think it's better to have translations for any private server that willing to contribute leaving their translations in the repository . you'll never know when it's needed.

I don't really understand what the folder is for, maybe give it a more clarifying name

it's our translation on top of the default translation. Do you have any suggestions on what we should rename it?

Oh I see, so if you modify the frontend and add your own texts you put them in there? Why not edit the normal files instead?

so that we all private server enjoyers could share our translation, rather than copy pasting them. the yarn i18n:build command will merge all layers in to one based on config.js for guweb to use.

arily avatar Jan 27 '23 17:01 arily

image you might wanna delete this folder?

I think it's better to have translations for any private server that willing to contribute leaving their translations in the repository . you'll never know when it's needed.

I don't really understand what the folder is for, maybe give it a more clarifying name

it's our translation on top of the default translation. Do you have any suggestions on what we should rename it?

Oh I see, so if you modify the frontend and add your own texts you put them in there? Why not edit the normal files instead?

so that we all private server enjoyers could share our translation, rather than copy pasting them

I don't quite get what you mean. If you need to change the translation of something, you can do so in the normal language files. I feel like it's too hard to understand what your mission with that extra stuff is, users might just ignore it

minisbett avatar Jan 27 '23 17:01 minisbett

image you might wanna delete this folder?

I think it's better to have translations for any private server that willing to contribute leaving their translations in the repository . you'll never know when it's needed.

I don't really understand what the folder is for, maybe give it a more clarifying name

it's our translation on top of the default translation. Do you have any suggestions on what we should rename it?

Oh I see, so if you modify the frontend and add your own texts you put them in there? Why not edit the normal files instead?

so that we all private server enjoyers could share our translation, rather than copy pasting them

I don't quite get what you mean. If you need to change the translation of something, you can do so in the normal language files. I feel like it's too hard to understand what your mission with that extra stuff is, users might just ignore it

it's like your system's language setting (language packs), you can have more than one and you order them the way you like.

arily avatar Jan 27 '23 17:01 arily

Leave this poor folder alone, it's just need to be renamed

alowave223 avatar Jan 27 '23 17:01 alowave223

You can keep the upload score stuff in, it's just that the endpoint will only be implemented in api v2

minisbett avatar Jan 27 '23 18:01 minisbett

I think we accidentally formatted the whole repo in double quotes. what formatter are you using to enforce quotes? I found no formatter with configurable quotes

arily avatar Jan 27 '23 18:01 arily

You can keep the upload score stuff in, it's just that the endpoint will only be implemented in api v2

y don't worry we have it in other branch. I am planning to get this merged before v2 landed so that both of us won't have to adapt it separately before merging ✌️

arily avatar Jan 27 '23 18:01 arily

You can keep the upload score stuff in, it's just that the endpoint will only be implemented in api v2

y don't worry we have it in other branch. I am planning to get this merged before v2 landed so that both of us won't have to adapt it separately before merging ✌️

API V2 is already partly done, also I don't think this will be merged anytime soon, yet before API v2 is done

minisbett avatar Jan 27 '23 18:01 minisbett

Hi, I fixed most problems you mentioned

arily avatar Jan 31 '23 06:01 arily