Merged
Conversation
- Add two-layer i18n: UI strings (translations/strings/) and content
translations (translations/content/)
- Extract all hard-coded English from templates into en.json
- Add complete pt-BR UI string translations
- Add 3 pt-BR content translations as proof of concept
- Extend generate.java to iterate locales, merge strings with fallback,
generate locale-specific output under site/{locale}/
- Add hreflang alternate links, locale picker dropdown, window.i18n
script injection
- Make app.js locale-aware: path detection, correct snippets.json
loading, locale picker behavior, i18n string usage
- Add locale picker and untranslated-notice CSS
- Use hash links (#category) for breadcrumb category filtering
- Scroll to filter section when index loads with hash
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Detect user's browser language via navigator.languages and auto-redirect to matching locale (e.g. pt-BR) on first visit. Respects explicit user choice stored in localStorage from the locale picker. Adds availableLocales array to window.i18n injected by the generator. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Generated locale directories (site/pt-BR/) should not be committed; they are built by html-generators/generate.java at deploy time. Co-authored-by: Copilot <223556219+Copilot@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.
Internationalization and locale support:
locales.propertiesand UI strings from JSON translation files, with English fallback for missing keys. Also implemented flattening of nested JSON translation keys for easier token replacement. [1] [2] [3]buildLocalefunction to generate site content for each locale, including localized HTML files, data files, and index pages. Locale-specific tokens and paths are handled throughout.Content translation and fallback:
resolveSnippetto load translated content for snippets, falling back to English and always using English code samples. This ensures consistency in code while allowing localized explanations and metadata.HTML meta and UI enhancements for localization:
hreflangmeta tags for SEO and locale switching, locale picker dropdown HTML, and client-side i18n script block for dynamic UI translations.Token replacement improvements: