feat(i18n) : add EN and DE localization - #23
Conversation
✅ Deploy Preview for fanciful-cannoli-268c0c ready!
To edit notification comments on pull requests, go to your Netlify project configuration. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: 79c1c375de
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| <a class="site-footer__legal-link" routerLink="/legal-notice"> | ||
| <span>Legal Notice</span> | ||
| <span>{{ 'footer.legalNotice' | translate }}</span> |
There was a problem hiding this comment.
Localize the legal-page destinations
When German is selected, these links are rendered as “Impressum” and “Datenschutzerklärung,” but their /legal-notice and /privacy-policy destinations still contain hard-coded English titles and body text in legal-notice.html and privacy-policy.html. This leaves German users— including users following the localized consent-form link—with an English legal document, so the legal-page content and titles should also use the language resources.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Pull request overview
This PR introduces English and German localization to the Angular app using @ngx-translate, including runtime language switching, localized UI copy, and localized document titles.
Changes:
- Add
@ngx-translate/core+ HTTP loader, app initialization for language selection, and aLanguageServicefor persisted language toggling. - Replace hard-coded UI strings (including many aria/alt attributes) with translation keys +
TranslatePipe, and migrate some data models to store translation keys. - Add EN/DE JSON resource files plus tests for translation resource parity and i18n-dependent UI behavior.
Reviewed changes
Copilot reviewed 49 out of 50 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| tsconfig.spec.json | Enables JSON imports in unit tests for translation resources. |
| src/app/testing/i18n-testing.ts | Adds shared test helpers and inline EN/DE test translations. |
| src/app/shared/legal-page-layout/legal-page-layout.ts | Enables TranslatePipe usage in legal layout component. |
| src/app/shared/legal-page-layout/legal-page-layout.spec.ts | Wires translate providers + sets test language for specs. |
| src/app/shared/legal-page-layout/legal-page-layout.html | Localizes the “Back” label. |
| src/app/shared/data/social-links.ts | Migrates social link labels to translation keys. |
| src/app/pages/project-detail/project-detail.ts | Enables TranslatePipe usage in project detail page. |
| src/app/pages/project-detail/project-detail.spec.ts | Adds translate providers + sets test language. |
| src/app/pages/project-detail/project-detail.html | Localizes headings, labels, aria/alt strings, and project copy via keys. |
| src/app/pages/privacy-policy/privacy-policy.spec.ts | Adds translate providers + German UI/English legal body assertion. |
| src/app/pages/not-found/not-found.ts | Enables TranslatePipe usage in not-found page. |
| src/app/pages/not-found/not-found.spec.ts | Adds translate providers + sets test language. |
| src/app/pages/not-found/not-found.html | Localizes not-found copy + aria-labels. |
| src/app/pages/legal-notice/legal-notice.spec.ts | Adds translate providers + sets test language. |
| src/app/pages/home/sections/testimonials/testimonials.ts | Enables TranslatePipe for testimonials section. |
| src/app/pages/home/sections/testimonials/testimonials.html | Localizes testimonials headings, profile label, aria-label, and per-item copy. |
| src/app/pages/home/sections/skills/skills.ts | Enables TranslatePipe for skills section. |
| src/app/pages/home/sections/skills/skills.html | Localizes skills headings, description, and aria-labels. |
| src/app/pages/home/sections/projects/projects.ts | Enables TranslatePipe for projects section. |
| src/app/pages/home/sections/projects/projects.html | Localizes projects headings, intro text, CTA label, and alt/copy via keys. |
| src/app/pages/home/sections/hero/hero.ts | Enables TranslatePipe for hero section. |
| src/app/pages/home/sections/hero/hero.html | Localizes greeting, CTA, and aria/alt strings. |
| src/app/pages/home/sections/contact/contact.ts | Converts validation + submission status messages to translation keys. |
| src/app/pages/home/sections/contact/contact.spec.ts | Adds translate providers + adjusts assertions for localized messages. |
| src/app/pages/home/sections/contact/contact.html | Localizes contact form labels, placeholders, errors, CTA, and status text. |
| src/app/pages/home/sections/about/about.ts | Migrates availability card labels to translation keys and enables TranslatePipe. |
| src/app/pages/home/sections/about/about.model.ts | Updates model shape to store translation keys. |
| src/app/pages/home/sections/about/about.html | Localizes about headings/copy and availability list aria-label. |
| src/app/layout/header/header.ts | Integrates LanguageService, switches nav labels to keys, enables TranslatePipe. |
| src/app/layout/header/header.spec.ts | Adds coverage for language toggling + persistence + translated nav copy. |
| src/app/layout/header/header.model.ts | Updates nav model to store translation keys. |
| src/app/layout/header/header.html | Localizes navigation labels + multiple aria-labels via translate pipe. |
| src/app/layout/footer/footer.ts | Enables TranslatePipe usage in footer. |
| src/app/layout/footer/footer.html | Localizes footer aria-labels, legal links, and social link labels. |
| src/app/features/testimonials/testimonials.model.ts | Migrates testimonial text fields to translation keys. |
| src/app/features/testimonials/testimonials.data.ts | Replaces embedded testimonial text with translation keys. |
| src/app/features/projects/projects.model.ts | Migrates project descriptive fields to translation keys. |
| src/app/features/projects/projects.data.ts | Replaces embedded project copy with translation keys. |
| src/app/features/projects/projects.data.spec.ts | Updates tests to validate key formats instead of raw text. |
| src/app/core/i18n/translation-resources.spec.ts | Adds test to keep EN/DE resource key structures in sync. |
| src/app/core/i18n/localized-title.strategy.ts | Adds TitleStrategy that uses translation keys and updates on language change. |
| src/app/core/i18n/localized-title.strategy.spec.ts | Adds coverage for localized route titles reacting to language changes. |
| src/app/core/i18n/language.service.ts | Adds shared language state, HTML lang updates, and persistence to localStorage. |
| src/app/core/i18n/language.service.spec.ts | Adds coverage for initialization, persistence, and toggling behavior. |
| src/app/app.routes.ts | Adjusts titles (including keyed title for not-found route). |
| src/app/app.config.ts | Registers ngx-translate providers, loader, app initializer, and TitleStrategy. |
| public/i18n/en.json | Adds English translation resource. |
| public/i18n/de.json | Adds German translation resource. |
| package.json | Adds ngx-translate dependencies. |
| package-lock.json | Locks ngx-translate dependencies. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
| export function provideTestTranslateService(): Provider[] { | ||
| return provideTranslateService({ fallbackLang: 'en' }); | ||
| } |
No description provided.