Add comprehensive English language support with full i18n implementation#11
Draft
Copilot wants to merge 4 commits into
Draft
Add comprehensive English language support with full i18n implementation#11Copilot wants to merge 4 commits into
Copilot wants to merge 4 commits into
Conversation
Co-authored-by: setoelkahfi <1797197+setoelkahfi@users.noreply.github.com>
Co-authored-by: setoelkahfi <1797197+setoelkahfi@users.noreply.github.com>
Co-authored-by: setoelkahfi <1797197+setoelkahfi@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Add comprehensive English language support with i18n features
Add comprehensive English language support with full i18n implementation
Oct 10, 2025
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.
Overview
This PR implements comprehensive internationalization (i18n) support for the PBJ Komplit! website, enabling full bilingual functionality in Indonesian and English. The implementation leverages Astro 5.11.0's built-in i18n capabilities to provide a scalable, SEO-optimized multilingual experience.
Changes Made
1. Astro i18n Configuration
Added i18n configuration to
astro.config.ts:id) - accessible at/en- accessible at/en//en/prefix for English2. Translation System
Created a robust translation infrastructure in
src/i18n/:ui.ts- Centralized translation dictionaries containing:utils.ts- Helper functions for:getLangFromUrl()- Detect current language from URLuseTranslations()- Get translation function for current languagegetLocalizedPath()- Generate language-specific URLsgetAlternateUrl()- Calculate alternate language URLs3. Language Switcher Component
Created
src/components/ui/LanguageSwitcher.astro:4. Component Updates
Header (
src/components/layout/Header.astro):Footer (
src/components/layout/Footer.astro):BaseLayout (
src/layouts/BaseLayout.astro):langattribute (id-IDoren-US)BaseHead (
src/components/layout/BaseHead.astro):hreflangtags for language alternatesx-defaultfallback to Indonesianog:locale,og:locale:alternate)About (
src/components/pages/About.astro):5. Page Structure
Indonesian Pages (no prefix):
/- Homepage with Indonesian content/contact- Contact page in Indonesian/privacy-policy- Privacy policy in Indonesian/terms-of-use- Terms of use in IndonesianEnglish Pages (
/en/prefix):/en/- Homepage with English content/en/contact- Contact page in English/en/privacy-policy- Privacy policy in English/en/terms-of-use- Terms of use in English6. Content Translation
Created English versions of all key content:
7. SEO Optimization
Implemented comprehensive SEO best practices:
8. Documentation
Updated
README.mdwith:Technical Details
Build Output: Successfully generates 9 pages
Code Quality:
Testing
Screenshots
Indonesian Homepage

English Homepage

English Contact Page

Future Extensibility
The architecture supports easy addition of more languages by:
astro.config.tslocales arraysrc/i18n/ui.tsfor the new languagesrc/content/{collection}/{locale}/directoriesBenefits
Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
telemetry.astro.buildnode /home/REDACTED/work/pepakbasajawa-web/pepakbasajawa-web/node_modules/.bin/astro build(dns block)node /home/REDACTED/work/pepakbasajawa-web/pepakbasajawa-web/node_modules/.bin/astro preview(dns block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
This pull request was created as a result of the following prompt from Copilot chat.
💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.