Closed
Conversation
…stem - Add translationOutputPath field to GTConfig for specifying local translation file paths with [locale] placeholder - Add LOCAL enum value to LoadTranslationsType - Create createLocalTranslationLoader that reads JSON files from disk using the translationOutputPath pattern - Update TranslationsManager to handle LOCAL loader type - Add validation for LOCAL type (requires path with [locale] placeholder) - Add fs/path to rollup externals for the local loader - Add unit tests for createLocalTranslationLoader Co-authored-by: Ernest McCarter <ErnestM1234@users.noreply.github.com>
When files.gt.output is configured in gt.config.json, automatically use local file loading instead of requiring a custom loadTranslations function. This eliminates the need for users to create a separate loadTranslations.ts file when using local translations. - withGTConfig reads files.gt.output and sets loadTranslationsType to 'local' when present (and no custom loader exists) - Resolves the output path to absolute and stores it in _GENERALTRANSLATION_TRANSLATION_OUTPUT_PATH env var - I18NConfiguration accepts 'local' loadTranslationsType and enables translation when set - loadTranslation.ts reads from local filesystem when the env var is present, using fs.promises.readFile with locale substitution - TranslationManager type updated to accept 'local' type Co-authored-by: Ernest McCarter <ErnestM1234@users.noreply.github.com>
|
Cursor Agent can help with this pull request. Just |
Co-authored-by: Ernest McCarter <ErnestM1234@users.noreply.github.com>
Co-authored-by: Ernest McCarter <ErnestM1234@users.noreply.github.com>
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.
Implement automatic local translation loading based on
gt.config.jsonto simplify local translation setup.This change removes the need for users to provide a custom
loadTranslationsfunction for local files. Instead, the system now checks for thefiles.gt.outputfield ingt.config.json. If this field is present and valid (e.g.,public/_gt/[locale].json), a newcreateLocalTranslationLoaderis used to read translation files directly from the filesystem.Slack Thread