Skip to content

Adds support for Spanish, French and German languages.#6

Merged
rafaelfelipeac merged 2 commits intomainfrom
feature/add-new-languages
Jul 28, 2025
Merged

Adds support for Spanish, French and German languages.#6
rafaelfelipeac merged 2 commits intomainfrom
feature/add-new-languages

Conversation

@rafaelfelipeac
Copy link
Owner

@rafaelfelipeac rafaelfelipeac commented Jul 28, 2025

Summary by CodeRabbit

  • New Features

    • Added support for German, French, and Spanish languages throughout the app, including localized interface text and settings options.
    • Users can now select German, French, or Spanish as their preferred language in the settings screen.
  • Improvements

    • Updated language selection labels to include the new language options in all supported languages.

@coderabbitai
Copy link

coderabbitai bot commented Jul 28, 2025

Walkthrough

Support for German, French, and Spanish languages was added throughout the application. This includes extending the language enum, updating the settings UI to offer these languages as options, providing new localized string resources, and updating the strings provider to handle the new languages. No existing logic was removed or altered.

Changes

Cohort / File(s) Change Summary
AppLanguage Enum Extension
composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/language/AppLanguage.kt
Added GERMAN, FRENCH, and SPANISH entries to the AppLanguage enum.
Strings Interface and English/Portuguese Strings
composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/Strings.kt,
.../StringsEn.kt,
.../StringsPt.kt
Added settingsLanguageGerman, settingsLanguageFrench, and settingsLanguageSpanish properties to the Strings interface and implemented them in the English and Portuguese string resources.
German, French, Spanish String Resources
.../StringsDe.kt,
.../StringsFr.kt,
.../StringsEs.kt
Introduced new objects implementing Strings for German, French, and Spanish, providing comprehensive localized string resources for each language.
Strings Provider Update
composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsProvider.kt
Updated to support returning string resources for the new languages (German, French, Spanish) by importing, instantiating, and handling them in the get method.
Settings Screen Language Options
composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/features/settings/presentation/SettingsScreen.kt
Extended language selection UI to include German, French, and Spanish as selectable options. Updated label function to support these languages.

Sequence Diagram(s)

sequenceDiagram
    participant User
    participant SettingsScreen
    participant StringsProvider
    participant AppLanguage Enum
    participant StringsXX (Localized Strings)

    User->>SettingsScreen: Opens language selection
    SettingsScreen->>AppLanguage Enum: Lists all languages (EN, PT, DE, FR, ES, SYSTEM)
    User->>SettingsScreen: Selects a language (e.g., German)
    SettingsScreen->>StringsProvider: get(GERMAN)
    StringsProvider->>StringsDe: Return German strings
    SettingsScreen->>User: Displays UI in German
Loading

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Poem

Three new tongues join the app today—
Hallo, Bonjour, and ¡Hola! we say.
With strings now set and menus bright,
Settings gleam in tricolor light.
A rabbit hops from code to code,
Delighted by each language mode!
🐇🌍✨

Note

⚡️ Unit Test Generation is now available in beta!

Learn more here, or try it out under "Finishing Touches" below.


📜 Recent review details

Configuration used: CodeRabbit UI
Review profile: CHILL
Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 83aee09 and 07d55ec.

📒 Files selected for processing (9)
  • composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/language/AppLanguage.kt (1 hunks)
  • composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/Strings.kt (1 hunks)
  • composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsDe.kt (1 hunks)
  • composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsEn.kt (1 hunks)
  • composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsEs.kt (1 hunks)
  • composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsFr.kt (1 hunks)
  • composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsProvider.kt (2 hunks)
  • composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsPt.kt (1 hunks)
  • composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/features/settings/presentation/SettingsScreen.kt (3 hunks)
🧰 Additional context used
🧠 Learnings (1)
📓 Common learnings
Learnt from: rafaelfelipeac
PR: rafaelfelipeac/replyradar#5
File: config/detekt/detekt.yml:15-17
Timestamp: 2025-07-24T20:32:51.160Z
Learning: The user rafaelfelipeac prefers to create tech debt tasks to track future cleanup and refactoring work when temporarily relaxing code quality thresholds, showing a proactive approach to technical debt management.
Learnt from: rafaelfelipeac
PR: rafaelfelipeac/replyradar#5
File: composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/features/reply/presentation/replylist/ReplyListViewModel.kt:0-0
Timestamp: 2025-07-24T22:13:32.263Z
Learning: The user rafaelfelipeac consistently implements robust solutions that go beyond the immediate problem, adding defensive programming measures like the isPendingReplyHandled flag in the ReplyListViewModel to prevent duplicate processing, showing strong attention to edge cases and race conditions.
🔇 Additional comments (14)
composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/language/AppLanguage.kt (1)

6-8: LGTM! Clean enum extension for new language support.

The three new language entries are correctly added and well-positioned between existing languages and the SYSTEM default. The existing fromString method will work seamlessly with these additions.

composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/Strings.kt (1)

64-66: LGTM! Consistent interface extension for new language properties.

The new string properties follow the established naming convention and are logically positioned with other language-related strings. This maintains interface consistency and readability.

composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/features/settings/presentation/SettingsScreen.kt (2)

44-45: LGTM! Proper imports for new language enum values.

The imports are correctly added for the new language constants, maintaining alphabetical order and consistency with the existing import pattern.

Also applies to: 47-47


285-287: LGTM! Comprehensive UI integration for new languages.

The implementation correctly:

  • Adds language options in the same order as the enum definition
  • Extends the label mapping function to handle all new language cases
  • Maintains consistency with existing UI patterns

The new languages will be properly displayed and selectable in the settings UI.

Also applies to: 324-326

composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsPt.kt (1)

72-74: LGTM! Accurate Portuguese translations for new language names.

The Portuguese translations are correct:

  • "Alemão" (German)
  • "Francês" (French)
  • "Espanhol" (Spanish)

The implementation follows the established pattern and maintains consistency with the interface definition.

composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsEn.kt (2)

72-74: LGTM! Standard English translations for new language names.

The English translations are correct and follow the established implementation pattern. The positioning maintains consistency with the interface definition.


1-130: All new localization files are present and fully implemented

  • StringsDe.kt, StringsFr.kt, and StringsEs.kt each override 97 properties—matching StringsEn.kt and StringsPt.kt.
  • StringsProvider registers German, French, and Spanish.
  • SettingsScreen’s language selector and labels include all three.

No further changes needed.

composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsDe.kt (1)

1-130: Excellent German localization implementation!

The German translations are comprehensive, linguistically accurate, and properly integrated with the Strings interface. The translations follow proper German conventions including:

  • Correct use of formal address ("Sie" forms)
  • Proper German punctuation and capitalization
  • Appropriate technical terminology
  • Consistent placeholder usage (%1, %2)

The dynamic app version integration in the feedback email body (line 89) is well implemented.

composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsFr.kt (1)

1-130: Well-executed French localization!

The French translations are thorough and linguistically appropriate. Key strengths include:

  • Proper use of formal French ("vous" forms)
  • Correct French grammar and syntax
  • Appropriate technical vocabulary
  • Consistent placeholder formatting
  • Professional tone throughout

The feedback email template (lines 80-90) maintains the friendly yet professional tone expected in French correspondence.

composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsEs.kt (2)

58-61: Minor inconsistency in button labels.

The time and date picker buttons use different Spanish terms for "OK":

  • Line 58 & 60: "Aceptar" (Accept)
  • Line 59 & 61: "Aceptar" (Accept)

This is actually consistent, but consider that "OK" is also commonly used and understood in Spanish interfaces. The current choice of "Aceptar" is appropriate and consistent.


1-130: Excellent Spanish localization implementation!

The Spanish translations are comprehensive and linguistically sound. Notable strengths:

  • Proper use of formal Spanish conventions
  • Accurate technical terminology
  • Consistent placeholder usage (%1, %2)
  • Appropriate tone for user interface text
  • Well-structured feedback email template

The translations maintain consistency with the app's tone while being culturally appropriate for Spanish-speaking users.

composeApp/src/commonMain/kotlin/com/rafaelfelipeac/replyradar/core/strings/StringsProvider.kt (3)

5-8: Clean import organization for new languages.

The imports for the new language enum values (FRENCH, GERMAN, SPANISH) are properly organized and follow the existing alphabetical pattern.


14-16: Proper instantiation of new string objects.

The private properties for the new language string objects are correctly declared and follow the established naming convention.


28-30: Correct integration of new languages in provider logic.

The new language cases are properly added to the when expression, maintaining consistency with the existing pattern and ensuring all new languages are supported.

✨ Finishing Touches
  • 📝 Generate Docstrings
🧪 Generate unit tests
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch feature/add-new-languages

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.

❤️ Share
🪧 Tips

Chat

There are 3 ways to chat with CodeRabbit:

  • Review comments: Directly reply to a review comment made by CodeRabbit. Example:
    • I pushed a fix in commit <commit_id>, please review it.
    • Explain this complex logic.
    • Open a follow-up GitHub issue for this discussion.
  • Files and specific lines of code (under the "Files changed" tab): Tag @coderabbitai in a new review comment at the desired location with your query. Examples:
    • @coderabbitai explain this code block.
    • @coderabbitai modularize this function.
  • PR comments: Tag @coderabbitai in a new PR comment to ask questions about the PR branch. For the best results, please provide a very specific query, as very limited context is provided in this mode. Examples:
    • @coderabbitai gather interesting stats about this repository and render them as a table. Additionally, render a pie chart showing the language distribution in the codebase.
    • @coderabbitai read src/utils.ts and explain its main purpose.
    • @coderabbitai read the files in the src/scheduler package and generate a class diagram using mermaid and a README in the markdown format.
    • @coderabbitai help me debug CodeRabbit configuration file.

Support

Need help? Create a ticket on our support page for assistance with any issues or questions.

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)

  • @coderabbitai pause to pause the reviews on a PR.
  • @coderabbitai resume to resume the paused reviews.
  • @coderabbitai review to trigger an incremental review. This is useful when automatic reviews are disabled for the repository.
  • @coderabbitai full review to do a full review from scratch and review all the files again.
  • @coderabbitai summary to regenerate the summary of the PR.
  • @coderabbitai generate docstrings to generate docstrings for this PR.
  • @coderabbitai generate sequence diagram to generate a sequence diagram of the changes in this PR.
  • @coderabbitai generate unit tests to generate unit tests for this PR.
  • @coderabbitai resolve resolve all the CodeRabbit review comments.
  • @coderabbitai configuration to show the current CodeRabbit configuration for the repository.
  • @coderabbitai help to get help.

Other keywords and placeholders

  • Add @coderabbitai ignore anywhere in the PR description to prevent this PR from being reviewed.
  • Add @coderabbitai summary to generate the high-level summary at a specific location in the PR description.
  • Add @coderabbitai anywhere in the PR title to generate the title automatically.

CodeRabbit Configuration File (.coderabbit.yaml)

  • You can programmatically configure CodeRabbit by adding a .coderabbit.yaml file to the root of your repository.
  • Please see the configuration documentation for more information.
  • If your editor has YAML language server enabled, you can add the path at the top of this file to enable auto-completion and validation: # yaml-language-server: $schema=https://coderabbit.ai/integrations/schema.v2.json

Documentation and Community

  • Visit our Documentation for detailed information on how to use CodeRabbit.
  • Join our Discord Community to get help, request features, and share feedback.
  • Follow us on X/Twitter for updates and announcements.

@rafaelfelipeac rafaelfelipeac marked this pull request as ready for review July 28, 2025 20:32
@rafaelfelipeac rafaelfelipeac merged commit f2295bb into main Jul 28, 2025
2 checks passed
@rafaelfelipeac rafaelfelipeac deleted the feature/add-new-languages branch July 28, 2025 21:10
This was referenced Aug 2, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant