Add localization support and preview to Initializr (bundles, UI, generator)#4573
Merged
shai-almog merged 10 commits intomasterfrom Feb 26, 2026
Merged
Conversation
Cloudflare Preview
|
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.
Motivation
Description
PreviewLanguageenum and two fields toProjectOptions:includeLocalizationBundlesandpreviewLanguage, and wire them into defaults.Initializrwith aCheckBoxto include bundles and aPickerto choose preview language, and pass those options through to the preview and generator.TemplatePreviewPanelto install the selected localization bundle intoUIManagerfor live previews and to look up L10N resources by language suffix (with fallback for region variants).GeneratorModelto includemessages*.propertiesfiles in the generated zip for Barebones templates (and only when enabled), and inject Java/Kotlin bootstrap code into the main source to load the messages bundle at runtime.messages.propertiesresource files for multiple languages (including RTL markers for Arabic/Hebrew) and update the summary and validation UI to reflect localization options.GeneratorModelMatrixTestto assert presence (or absence) of localization bundles in generated outputs for the relevant templates.Testing
GeneratorModelMatrixTestwhich validates generated zip contents; tests passed.UIManagerbundle installation and that generated zips containcommon/src/main/resources/messages*.propertiesand injected bootstrap code in Barebones/Kotlin mains.Codex Task