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

[Misc][Refactor] Automate namespace collection for en locale with vite plugin #4625

Open
wants to merge 9 commits into
base: beta
Choose a base branch
from

Conversation

Vassiat
Copy link
Contributor

@Vassiat Vassiat commented Oct 9, 2024

What are the changes the user will see?

n/a

Why am I making these changes?

Experience and sustainability of development

What are the changes from a developer perspective?

  1. Instead of manually adding each new namespace, every namespace added to the "en" locale will be automatically included.

  2. Refreshing the page when changing/deleting/creating any JSON file in public/locales which serves as a micro-optimization.

image

  1. Create a src/plugins/utils-plugin.ts file, which acts as an intermediary between variables/functions that both plugins (of Vite) and the client can use. By using this file, a server restart is isolated whenever it changes.

And some additional documentation.

How to test the changes?

You can observe that after reloading the page (if you modified/created/deleted a namespace), these should be added in camelCase format to the nsEn constant by the development tools in the i18n file.
image

Checklist

  • I'm using beta as my base branch
  • There is no overlap with another PR?
  • The PR is self-contained and cannot be split into smaller PRs?
  • Have I provided a clear explanation of the changes?
  • Have I considered writing automated tests for the issue?
  • If I have text, did I make it translatable and add a key in the English locale file(s)?
  • Have I tested the changes (manually)?
    • Are all unit tests still passing? (npm run test)
  • Are the changes visual?
    • Have I provided screenshots/videos of the changes?

@Madmadness65 Madmadness65 added the Refactor Rewriting existing code related label Oct 10, 2024
@Vassiat Vassiat marked this pull request as ready for review October 11, 2024 19:02
@Vassiat Vassiat requested a review from a team as a code owner October 11, 2024 19:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Refactor Rewriting existing code related
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants