FES rework part 2: new translation strings and loading translations - #9212
Open
limzykenneth wants to merge 7 commits into
Open
limzykenneth wants to merge 7 commits into
limzykenneth wants to merge 7 commits into
Conversation
code Friendly errors are disabled by default in minified version.
Member
Author
|
@davepagurek I feel like I'm missing something obvious here but I'm not sure why the test is failing since I didn't change that dependency. |
limzykenneth
marked this pull request as ready for review
September 26, 2026 15:22
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Resolves #8882
Changes:
This is the second part of the FES rework (and hopefully the last part). Building on from #8887, this adds a clearer way translations can be loaded by the logging system.
Translations can be loaded in two ways, from a local file or from CDN. Within the same folder, the p5.js script will look for
${languageCode}.jsonfor a file matching that name and load it as a translation string JSON, if that file cannot be found, it will then load from the JSDelivr CDN for a version we publish. If that also does not exist, no translation will be loaded and messages will be printed in the language it is written, ie. English. There are some room for refinements and these will be guarded by version numbers and future iterations will try to be additive only, although this is not a guarantee.This PR also adds a translation string extraction code with its corresponding dependencies, this is still a work in progress and should be used with care.
The translation string format is currently a specific JSON format, in the future it may be switched to a more standardized format such as MF2 with YAML or Fluent.
Documentation will be added next then the PR can be merge after all has been reviewed and test passed.
PR Checklist
npm run lintpasses