feat: add Arabic-first i18n with locale switcher#21
Conversation
There was a problem hiding this comment.
Pull request overview
This PR introduces an Arabic-first internationalization setup for the Eleventy site, with / serving Arabic and /en/ serving English, plus shared translated UI and RTL support.
Changes:
- Added i18next-based build-time i18n loading + translation parity validation, with per-locale page generation via Eleventy pagination.
- Updated templates (home, blogs, contributing, layout/components) to use translation keys and locale-aware URLs.
- Added RTL/LTR styling adjustments, a navbar language switcher, and build verification scripts to ensure localized outputs exist.
Reviewed changes
Copilot reviewed 34 out of 35 changed files in this pull request and generated 5 comments.
Show a summary per file
| File | Description |
|---|---|
.eleventy.js |
Initializes i18n globals (t, localeUrl) and validates dictionaries during build. |
src/i18n/index.js |
Loads translation resources, validates parity, and localizes URLs. |
src/_data/locales.js |
Defines supported locales and routing prefixes. |
src/index.njk + src/index.11tydata.js |
Converts home page to localized metadata + localized routing. |
src/blogs.njk + src/blogs.11tydata.js |
Converts blogs listing page to localized metadata + localized routing. |
content/blogs/blogs.11tydata.js |
Generates localized blog post routes for both locales. |
src/contributing.njk + src/contributing.11tydata.js |
Localizes the contributing page and routes. |
src/_includes/layouts/base.njk |
Adds locale-aware <html lang/dir>, localized meta, and hreflang alternates. |
src/_includes/layouts/blog.njk |
Localizes blog UI strings and improves RTL/LTR handling for metadata/tags. |
src/_includes/components/* |
Localizes header/footer/widget/giscus and adds a language switcher. |
src/assets/css/input.css |
Adds RTL support, bidi handling, and language switcher styling; adds Arabic/Latin fonts. |
src/assets/js/main.js |
Adds language switcher navigation + stores locale; keeps tag filtering enhancement. |
scripts/check-i18n.js + scripts/verify-localized-build.js |
Adds translation validation and localized output verification during build. |
package.json + package-lock.json |
Adds i18next dependency and build steps for i18n validation/verification. |
src/_data/site.json |
Removes hardcoded tagline/description in favor of translated equivalents. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| <a | ||
| href="https://github.com/{{ site.repo }}/edit/main/content/blogs/{{ page.fileSlug }}.md" | ||
| <a | ||
| href="https://github.com/{{ site.repo }}/edit/master/content/blogs/{{ page.fileSlug }}.md" |
There was a problem hiding this comment.
The “Edit on GitHub” link switched from /edit/main/... to /edit/master/.... If the repository default branch is main (as previously assumed), this link will 404. Consider reverting to main or making the branch configurable (e.g., site.defaultBranch).
| href="https://github.com/{{ site.repo }}/edit/master/content/blogs/{{ page.fileSlug }}.md" | |
| href="https://github.com/{{ site.repo }}/edit/main/content/blogs/{{ page.fileSlug }}.md" |
There was a problem hiding this comment.
I validated this against the local git metadata, and master is the current default branch in this repository context.
Local refs show:
remotes/origin/HEAD -> origin/masterremotes/origin/masterremotes/upstream/master
So switching the edit link to master was intentional and matches the branch this repo is currently using. Because of that, I’m not reverting this to main.
fahdfady
left a comment
There was a problem hiding this comment.
Really nice work overall. And the font is really cool!
I just had some comments on the translation itself. We can work on this together and get this merged.
…تصنيف:" in Arabic localization
Summary
Closes #17
This PR adds an Arabic-first internationalization flow for the BLEU website.
What changed
/for Arabic/en/for EnglishTechnical notes
i18nextwith split JSON translation filesHow to test
npm installnpm run buildnpm run dev//en//blogs//en/blogs/Scope notes