-
-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
[Qol][Refactor] i18n lazy-loading #4327
Open
flx-sta
wants to merge
21
commits into
pagefaultgames:beta
Choose a base branch
from
flx-sta:qol/i18n-lazy-loading
base: beta
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Open
+1,341
−3,069
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Review Helperto mark all $$("#files .js-reviewed-toggle > input[id*='.json']").forEach((el) => el.click()); Your browser will probably lagg for 1-3 minutes as it sends quite a lot of server-requests at the same time then |
we don't need to test if i18next is working. This is the job of i18next itself
instead of the english translation
with lazy-load
DayKev
reviewed
Sep 19, 2024
DayKev
added
Localization
Provides or updates translation efforts
Miscellaneous
Changes that don't fit under any other label
Refactor
Rewriting existing code related
labels
Sep 19, 2024
now using "mysteryEncounters/..."
the encounter was checking if the modifier name includes `Berry` which is only true for english. Instead it has to check if the modifier is an instance of BerryModifier
the new i18n pattern requires a different namespacing which has been adopted
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
Localization
Provides or updates translation efforts
Miscellaneous
Changes that don't fit under any other label
Refactor
Rewriting existing code related
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Caution
Make sure to consult the translation team before merging as all locale files moved from
/src
into/public
!!!What are the changes the user will see?
Only the languages being used will be loaded thus less memory usage from the i18n side
Why am I making these changes?
The memory shouldn't be bloated with all languages at all time. IT should only hold the languages currently being used which at max is 2 (en as a fallback for missing keys).
What are the changes from a developer perspective?
/src/locales
into/public/locales
as they will be loaded async (via network request).camelCaseToKebabCase
function to utils/src/plugin/i18n.ts
file structurestartGame()
and lazy-load the scenes to prevent anyi18n.t()
usages before it is initializedinitI18n()
fromLoadingScene
config.ts
files inside thelocales/
locales
tests. Reason: We don't need to test if i18next is working properly. They have their own test-coverage to ensure thati18next
is now mocked for tests. This was overdue and now necessary due to the backend moduleHow to test the changes?
locales/**
)Checklist
beta
as my base branch[ ] 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)?npm run test
)[ ] Are the changes visual?[ ] Have I provided screenshots/videos of the changes?