Skip to content

Complete localization#159

Open
pauljohanneskraft wants to merge 5 commits into
mainfrom
complete-localization
Open

Complete localization#159
pauljohanneskraft wants to merge 5 commits into
mainfrom
complete-localization

Conversation

@pauljohanneskraft

Copy link
Copy Markdown
Contributor

Complete localization

♻️ Current situation & Problem

We noticed that some parts of the app were missing localization, so this PR is attempting to complete localization.

⚙️ Release Notes

  • Complete localization, incl. spanish translation

📚 Documentation

Please ensure that you properly document any additions in conformance to Spezi Documentation Guide.
You can use this section to describe your solution, but we encourage contributors to document your reasoning and changes using in-line documentation.

✅ Testing

Please ensure that the PR meets the testing requirements set by CodeCov and that new functionality is appropriately tested.
This section describes important information about the tests and why some elements might not be testable.

Code of Conduct & Contributing Guidelines

By creating and submitting this pull request, you agree to follow our Code of Conduct and Contributing Guidelines:

Copilot AI review requested due to automatic review settings April 12, 2026 11:56
@coderabbitai

coderabbitai Bot commented Apr 12, 2026

Copy link
Copy Markdown

Warning

Rate limit exceeded

@pauljohanneskraft has exceeded the limit for the number of commits that can be reviewed per hour. Please wait 13 minutes and 24 seconds before requesting another review.

Your organization is not enrolled in usage-based pricing. Contact your admin to enable usage-based pricing to continue reviews beyond the rate limit, or try again in 13 minutes and 24 seconds.

⌛ How to resolve this issue?

After the wait time has elapsed, a review can be triggered using the @coderabbitai review command as a PR comment. Alternatively, push new commits to this PR.

We recommend that you space out your commits to avoid hitting the rate limit.

🚦 How do rate limits work?

CodeRabbit enforces hourly rate limits for each developer per organization.

Our paid plans have higher rate limits than the trial, open-source and free plans. In all cases, we re-allow further reviews after a brief timeout.

Please see our FAQ for further information.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: a56429d5-b042-48b2-a7d9-a7e0a658bfc0

📥 Commits

Reviewing files that changed from the base of the PR and between 199cb06 and cb5236d.

📒 Files selected for processing (4)
  • ENGAGEHF/Dashboard/Messages/MessageRow.swift
  • ENGAGEHF/Dashboard/Messages/MessagesSection.swift
  • ENGAGEHF/Medications/RowLabel/MedicationRecommendationSymbol.swift
  • ENGAGEHF/Resources/Localizable.xcstrings
📝 Walkthrough

Walkthrough

Replaced many hard-coded UI strings with localized lookups via String(localized:comment:), added localized Spanish entries, adjusted accessibility label construction, and added a new repository onboarding document CLAUDE.md.

Changes

Cohort / File(s) Summary
Project Documentation
CLAUDE.md
Added new onboarding/documentation file describing project architecture, build/test/lint workflows, coding policies, testing, dependencies, and localization guidance.
HeartHealth — Selection & Labels
ENGAGEHF/HeartHealth/SelectionTypes/GraphSelection.swift, ENGAGEHF/HeartHealth/SelectionTypes/SymptomsType.swift, ENGAGEHF/HeartHealth/SelectionTypes/VitalsType.swift, ENGAGEHF/HeartHealth/Shared/DateGranularity.swift
Replaced hardcoded enum display strings with String(localized:comment:) for short/full labels and date granularity descriptions.
HeartHealth — Views / Inputs
ENGAGEHF/HeartHealth/AddMeasurement/AddMeasurementView.swift, ENGAGEHF/HeartHealth/GraphPicker.swift
Switched field titles, unit labels, and picker row text to localized strings (String(localized:comment:) / selection.description).
Messages UI
ENGAGEHF/Dashboard/Messages/MessageRow.swift, ENGAGEHF/Dashboard/Messages/MessagesSection.swift
Changed accessibility label construction to use string interpolation and localized formatting (explicit default "none" localization key).
Medications UI
ENGAGEHF/Medications/MedicationsList.swift, ENGAGEHF/Medications/RowLabel/MedicationRecommendationSymbol.swift
Section headers and accessibility labels now use localized strings; medication recommendation symbol uses new localized description.
Managers / Vitals
ENGAGEHF/Managers/MedicationsManager/MedicationDetails.swift, ENGAGEHF/Managers/VitalsManager/VitalsUnit.swift
Added localizedDescription property to MedicationRecommendationType; VitalsUnit.description now returns localized unit strings with translator comments.
Localization Catalog
ENGAGEHF/Resources/Localizable.xcstrings
Added many Spanish stringUnit entries for UI labels, accessibility strings, units, graph labels, medication section titles, symptom labels, and date granularity keys (+407 lines).

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~20 minutes

🚥 Pre-merge checks | ✅ 2 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (2 passed)
Check name Status Explanation
Title check ✅ Passed The title 'Complete localization' directly and concisely describes the main change—converting hardcoded strings to localized alternatives throughout the codebase.
Description check ✅ Passed The description is related to the changeset, explaining the motivation (missing localization in parts of the app) and highlighting the Spanish translation addition.

✏️ Tip: You can configure your own custom pre-merge checks in the settings.

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch complete-localization

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

Comment @coderabbitai help to get the list of available commands and usage tips.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR completes app localization coverage by expanding the String Catalog (including Spanish translations) and updating SwiftUI/UI strings to use localized resources consistently.

Changes:

  • Expanded Localizable.xcstrings with additional missing keys/translations (notably for symptoms/vitals graphs, medication sections/types, and accessibility strings).
  • Updated multiple views/enums to use String(localized:) for user-facing labels and picker text.
  • Added MedicationRecommendationType.localizedDescription and adopted it in medication-related UI.

Reviewed changes

Copilot reviewed 14 out of 14 changed files in this pull request and generated 2 comments.

Show a summary per file
File Description
ENGAGEHF/Resources/Localizable.xcstrings Adds/updates String Catalog entries (incl. Spanish) for new UI and accessibility strings.
ENGAGEHF/Medications/RowLabel/MedicationRecommendationSymbol.swift Switches accessibility label content to use localized recommendation type (but label itself still not localized).
ENGAGEHF/Medications/MedicationsList.swift Localizes medication section headers via String(localized:).
ENGAGEHF/Managers/VitalsManager/VitalsUnit.swift Localizes unit abbreviations via String(localized:).
ENGAGEHF/Managers/MedicationsManager/MedicationDetails.swift Adds localized description for recommendation types.
ENGAGEHF/HeartHealth/Shared/DateGranularity.swift Localizes date granularity labels.
ENGAGEHF/HeartHealth/SelectionTypes/VitalsType.swift Localizes vitals type labels.
ENGAGEHF/HeartHealth/SelectionTypes/SymptomsType.swift Localizes symptom picker labels and score names.
ENGAGEHF/HeartHealth/SelectionTypes/GraphSelection.swift Localizes graph selection short/full names.
ENGAGEHF/HeartHealth/GraphPicker.swift Uses localized description rather than String(describing:) for picker entries.
ENGAGEHF/HeartHealth/AddMeasurement/AddMeasurementView.swift Localizes measurement field/unit labels.
ENGAGEHF/Dashboard/Messages/MessagesSection.swift Localizes the composed accessibility label for message cards.
ENGAGEHF/Dashboard/Messages/MessageRow.swift Adjusts action icon accessibility label string composition (but still not localized).
CLAUDE.md Adds repository-specific build/test, architecture, and localization guidance.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread ENGAGEHF/Medications/RowLabel/MedicationRecommendationSymbol.swift Outdated
Comment thread ENGAGEHF/Dashboard/Messages/MessageRow.swift Outdated

@coderabbitai coderabbitai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Actionable comments posted: 3

🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@ENGAGEHF/Dashboard/Messages/MessageRow.swift`:
- Line 62: The accessibility label currently concatenates an already-localized
action description with the hardcoded English word "Symbol" in the
.accessibilityLabel call; update the call to use a fully localized format string
(e.g., use NSLocalizedString/LocalizedStringKey with a placeholder) so the whole
label is localized, referencing the existing
message.action.localizedDescription.localizedString() value inside that
localized format before passing to .accessibilityLabel (or create a localized
key like "message_action_symbol_accessibility" with a %@ placeholder and use
String.localizedStringWithFormat / LocalizedStringKey to build the final label).

In `@ENGAGEHF/Dashboard/Messages/MessagesSection.swift`:
- Line 47: The accessibility fallback currently uses the ambiguous string
"none"; change the fallback for message.description in MessagesSection (the let
description = message.description ?? String(localized: "none", ...)) to a
clearer phrase such as "No description" and update the localized key/comment
accordingly (e.g., String(localized: "No description", comment: "Accessibility
placeholder for missing message description")) so VoiceOver reads a meaningful
sentence.

In `@ENGAGEHF/Medications/RowLabel/MedicationRecommendationSymbol.swift`:
- Line 34: The accessibility label currently hardcodes the English prefix in the
.accessibilityLabel("Medication Label: \(type.localizedDescription)"); replace
that prefix with a fully localized format string so the entire label is
translated (e.g., use NSLocalizedString or String(localized:) with a format like
"Medication Label: %@" and inject type.localizedDescription). Update the
.accessibilityLabel call to use the localized format and keep
type.localizedDescription as the substituted value so the whole label appears in
the user's language.
🪄 Autofix (Beta)

Fix all unresolved CodeRabbit comments on this PR:

  • Push a commit to this branch (recommended)
  • Create a new PR with the fixes

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 1387a8bd-504f-49d9-8d4d-cc1ae6e1eb1a

📥 Commits

Reviewing files that changed from the base of the PR and between f980ffa and 13d82f4.

📒 Files selected for processing (14)
  • CLAUDE.md
  • ENGAGEHF/Dashboard/Messages/MessageRow.swift
  • ENGAGEHF/Dashboard/Messages/MessagesSection.swift
  • ENGAGEHF/HeartHealth/AddMeasurement/AddMeasurementView.swift
  • ENGAGEHF/HeartHealth/GraphPicker.swift
  • ENGAGEHF/HeartHealth/SelectionTypes/GraphSelection.swift
  • ENGAGEHF/HeartHealth/SelectionTypes/SymptomsType.swift
  • ENGAGEHF/HeartHealth/SelectionTypes/VitalsType.swift
  • ENGAGEHF/HeartHealth/Shared/DateGranularity.swift
  • ENGAGEHF/Managers/MedicationsManager/MedicationDetails.swift
  • ENGAGEHF/Managers/VitalsManager/VitalsUnit.swift
  • ENGAGEHF/Medications/MedicationsList.swift
  • ENGAGEHF/Medications/RowLabel/MedicationRecommendationSymbol.swift
  • ENGAGEHF/Resources/Localizable.xcstrings

Comment thread ENGAGEHF/Dashboard/Messages/MessageRow.swift Outdated
Comment thread ENGAGEHF/Dashboard/Messages/MessagesSection.swift Outdated
Comment thread ENGAGEHF/Medications/RowLabel/MedicationRecommendationSymbol.swift Outdated
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.

2 participants