i18n(de): start German translation; key-values translated#46
Conversation
WalkthroughThe pull request adds support for the German locale. It updates the configuration in the primary settings file to enable German, introduces two new JSON files containing German translations for the main content and sidebar, and expands the list of supported languages in the translation module. These changes ensure that the application can now load and display German-language text for its user interface without altering any public API or core functionality. Changes
Sequence Diagram(s)sequenceDiagram
participant User
participant Config
participant TranslationService
participant UI
User->>Config: Request available locales
Config-->>User: Return locales with German enabled
User->>TranslationService: Select language "de"
TranslationService->>src/content/i18n/de.json: Load UI translations
TranslationService->>starlight-sidebar/de.json: Load sidebar translations
TranslationService-->>User: Return German translation data
User->>UI: Render interface with German translations
Tip ⚡💬 Agentic Chat (Pro Plan, General Availability)
✨ Finishing Touches
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. 🪧 TipsChatThere are 3 ways to chat with CodeRabbit:
Note: Be mindful of the bot's finite context window. It's strongly recommended to break down tasks such as reading entire modules into smaller chunks. For a focused discussion, use review comments to chat about specific files and their changes, instead of using the PR comments. CodeRabbit Commands (Invoked using PR comments)
Other keywords and placeholders
CodeRabbit Configuration File (
|
Lunaria Status Overview🌕 This pull request will trigger status changes. Learn moreBy default, every PR changing files present in the Lunaria configuration's You can change this by adding one of the keywords present in the Tracked Files
Warnings reference
|
There was a problem hiding this comment.
Actionable comments posted: 0
🧹 Nitpick comments (1)
starlight-sidebar/translate.ts (1)
5-5: Consider reverting formatting changes that don't affect functionality.As mentioned in the PR description, more modifications were made to this file than necessary. The changes from single quotes to double quotes and from tabs to spaces don't affect functionality but might not align with the project's coding style.
-import fallback from "./en.json"; +import fallback from './en.json'; -const Translations = ["en", "fr", "ko", "de"] as const; +const Translations = ['en', 'fr', 'ko', 'de'] as const; - Translations.map(async (t) => { - return { lang: t, data: (await import(/* @vite-ignore */ `./${t}.json`)).default }; - }) + Translations.map(async (t) => { + return { lang: t, data: (await import(/* @vite-ignore */ `./${t}.json`)).default }; + }) // Similar changes for other indentation changes in the fileAlso applies to: 12-14, 18-30
📜 Review details
Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro
📒 Files selected for processing (4)
astro.config.mts(1 hunks)src/content/i18n/de.json(1 hunks)starlight-sidebar/de.json(1 hunks)starlight-sidebar/translate.ts(1 hunks)
🔇 Additional comments (4)
astro.config.mts (1)
19-19: LGTM! Successfully enabled German locale.The German locale has been properly uncommented in the configuration file, which aligns with the PR objective of initiating German translation support.
starlight-sidebar/translate.ts (1)
7-7: LGTM! German language correctly added to the translations array.The German locale "de" has been successfully added to the supported translations list, which is necessary for enabling German language support.
starlight-sidebar/de.json (1)
1-16: LGTM! German sidebar translations look good.The German translations for the sidebar items are accurate and properly formatted. This file is essential for providing the German sidebar navigation experience.
src/content/i18n/de.json (1)
1-48: LGTM! Comprehensive German translations for site content.The German translations cover all necessary UI elements, including site titles, documentation references, search functionality, and error messages. The translations appear accurate and well-formatted.
Description
This PR decomments German configs and adds all json files in German.
If I wanna preview in dev mode or build the project, I get an error tho, not sure why the
starlight-sidebar/en.jsonfile doesnt exist, not related tho...Pretty made more changes to
starlight-sidebar/translate.tsthan necessary.Summary by CodeRabbit