Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

i18n, redesign, admin panel #45

Open
wants to merge 321 commits into
base: main
Choose a base branch
from
Open

i18n, redesign, admin panel #45

wants to merge 321 commits into from

Conversation

arily
Copy link
Contributor

@arily arily commented Jan 27, 2023

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

Features:

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 👩‍🦼

package.json Outdated Show resolved Hide resolved
package.json Outdated Show resolved Hide resolved
config.sample.py Outdated Show resolved Hide resolved
main.py Outdated Show resolved Hide resolved
@minisbett
Copy link
Contributor

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

@minisbett
Copy link
Contributor

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.

@alowave223
Copy link
Contributor

give this man some TRUE

@arily
Copy link
Contributor Author

arily commented Jan 27, 2023

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
Copy link
Contributor Author

arily commented Jan 27, 2023

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
Copy link
Contributor Author

arily commented Jan 27, 2023

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

@minisbett
Copy link
Contributor

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

@arily
Copy link
Contributor Author

arily commented Jan 27, 2023

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?

@minisbett
Copy link
Contributor

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?

@arily
Copy link
Contributor Author

arily commented Jan 27, 2023

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.

@minisbett
Copy link
Contributor

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

@arily
Copy link
Contributor Author

arily commented Jan 27, 2023

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.

@alowave223
Copy link
Contributor

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

@minisbett
Copy link
Contributor

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

@arily
Copy link
Contributor Author

arily commented Jan 27, 2023

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
Copy link
Contributor Author

arily commented Jan 27, 2023

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 ✌️

@minisbett
Copy link
Contributor

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

@arily
Copy link
Contributor Author

arily commented Jan 31, 2023

Hi, I fixed most problems you mentioned

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants