feat: add Spanish translation support#810
feat: add Spanish translation support#810Shweta-281 wants to merge 4 commits intoAOSSIE-Org:masterfrom
Conversation
|
🎉 Welcome @Shweta-281!
We appreciate your contribution! 🚀 |
📝 WalkthroughWalkthroughAdds Spanish ( Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
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. Comment |
There was a problem hiding this comment.
Actionable comments posted: 1
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@android/app/build.gradle.kts`:
- Around line 49-68: The release signing config is unconditionally created and
assigned using signingConfigs.create("release") and
buildTypes.release.signingConfig which causes Gradle exceptions when
keystoreProperties is missing; guard both the creation (the
signingConfigs.create("release") block that reads keystoreProperties["keyAlias"]
/ ["keyPassword"] / ["storeFile"] / ["storePassword"]) and the assignment
(buildTypes { release { signingConfig = ... } }) with a presence check for
keystoreProperties (or a boolean flag like hasKeystore), so only create the
"release" signingConfig and set buildTypes.release.signingConfig when
keystoreProperties exist / are valid, otherwise skip creation/assignment to
avoid configuration-time failures.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: 163da95d-f97a-4be0-a27d-f34c920bea0f
⛔ Files ignored due to path filters (1)
pubspec.lockis excluded by!**/*.lock
📒 Files selected for processing (2)
android/app/build.gradle.ktspubspec.yaml
There was a problem hiding this comment.
Actionable comments posted: 1
🧹 Nitpick comments (4)
test/controllers/change_email_controller_test.dart (2)
220-221: Missing newline at end of file.The file ends without a trailing newline. Consider adding one for consistency with common style conventions.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/controllers/change_email_controller_test.dart` around lines 220 - 221, Add a trailing newline at the end of the test file to satisfy POSIX/style conventions: open test/controllers/change_email_controller_test.dart and ensure the file ends with a single newline character after the final closing braces (the end of the test block that contains "});" / "}"). Save the file so the repository includes the newline at EOF.
201-207: Timing-dependent verification may be fragile.The test verifies
mockAccount.updateEmailafter the firstpumpAndSettle(), then waits 4 seconds before verifying the database update. Given the nested.then()chain inchangeEmail()(seechange_email_controller.dart:136-196), if the async operations complete faster or slower than expected, this could lead to flaky tests.Consider consolidating to a single
pumpAndSettle(Duration(seconds: N))before all verifications, or usinguntilCalled()from Mockito if deterministic ordering is needed.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/controllers/change_email_controller_test.dart` around lines 201 - 207, The test's timing is fragile because it verifies mockAccount.updateEmail immediately after the first tester.pumpAndSettle() then waits another 4 seconds; updateEmail and subsequent DB updates in changeEmail() (changeEmail()) can complete at different times leading to flakiness. Replace the two-stage waiting with a single deterministic wait or synchronization: either call tester.pumpAndSettle(const Duration(seconds: N)) once (choose N large enough for the whole changeEmail() chain) before all verify calls, or use Mockito's untilCalled(mockAccount.updateEmail(...)) to wait for that specific call before asserting the database update; target the mockAccount.updateEmail verification and the later DB verification so both occur after the chosen synchronization.lib/views/widgets/snackbar.dart (2)
28-35: Defensive fallback, but callers still crash first.The null-safe
contexthandling with a fallback color is a reasonable defensive measure. However, based on the relevant snippets (e.g.,single_room_controller.dart:173,onboarding_controller.dart:72), callers invokeAppLocalizations.of(Get.context!)!before callingcustomSnackbar, so they'd crash on the null-assertion before this fallback is reached.Consider whether a broader refactor is needed to pass
contextas a parameter (some call sites already do this), or at minimum document that this fallback only covers edge cases wherecontextbecomes null between the caller's lookup and the snackbar's theme access.🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/views/widgets/snackbar.dart` around lines 28 - 35, The snackbar currently reads Get.context internally which leads callers using AppLocalizations.of(Get.context!) to crash before the snackbar's fallback runs; change the snackbar API to accept an explicit BuildContext parameter (e.g., update customSnackbar to customSnackbar(BuildContext context, ...)) and update callers (notably in single_room_controller.dart and onboarding_controller.dart) to pass their local context instead of using Get.context!, removing the internal null-assertion reliance; if you must keep the current signature, add clear documentation on the limited fallback and audit callers to stop calling AppLocalizations.of(Get.context!) before invoking the snackbar.
48-48: Missing newline at end of file.Most style guides and linters expect a trailing newline. Consider adding one for consistency.
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@lib/views/widgets/snackbar.dart` at line 48, Add a trailing newline to the end of lib/views/widgets/snackbar.dart so the file ends with a newline character after the final closing brace; simply open snackbar.dart, place the cursor after the final "}" (the file's closing brace for the snack bar widget) and insert a newline, then save to satisfy linters and style guides.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Inline comments:
In `@test/controllers/change_email_controller_test.dart`:
- Around line 195-196: Remove the leftover development comment "// ❌ REMOVE
overlay hack completely" from
test/controllers/change_email_controller_test.dart; locate the comment in the
test file (near tests for ChangeEmailController) and delete that line so the
test file contains only actual test code and comments relevant to the tests (no
dev-hack reminders).
---
Nitpick comments:
In `@lib/views/widgets/snackbar.dart`:
- Around line 28-35: The snackbar currently reads Get.context internally which
leads callers using AppLocalizations.of(Get.context!) to crash before the
snackbar's fallback runs; change the snackbar API to accept an explicit
BuildContext parameter (e.g., update customSnackbar to
customSnackbar(BuildContext context, ...)) and update callers (notably in
single_room_controller.dart and onboarding_controller.dart) to pass their local
context instead of using Get.context!, removing the internal null-assertion
reliance; if you must keep the current signature, add clear documentation on the
limited fallback and audit callers to stop calling
AppLocalizations.of(Get.context!) before invoking the snackbar.
- Line 48: Add a trailing newline to the end of lib/views/widgets/snackbar.dart
so the file ends with a newline character after the final closing brace; simply
open snackbar.dart, place the cursor after the final "}" (the file's closing
brace for the snack bar widget) and insert a newline, then save to satisfy
linters and style guides.
In `@test/controllers/change_email_controller_test.dart`:
- Around line 220-221: Add a trailing newline at the end of the test file to
satisfy POSIX/style conventions: open
test/controllers/change_email_controller_test.dart and ensure the file ends with
a single newline character after the final closing braces (the end of the test
block that contains "});" / "}"). Save the file so the repository includes the
newline at EOF.
- Around line 201-207: The test's timing is fragile because it verifies
mockAccount.updateEmail immediately after the first tester.pumpAndSettle() then
waits another 4 seconds; updateEmail and subsequent DB updates in changeEmail()
(changeEmail()) can complete at different times leading to flakiness. Replace
the two-stage waiting with a single deterministic wait or synchronization:
either call tester.pumpAndSettle(const Duration(seconds: N)) once (choose N
large enough for the whole changeEmail() chain) before all verify calls, or use
Mockito's untilCalled(mockAccount.updateEmail(...)) to wait for that specific
call before asserting the database update; target the mockAccount.updateEmail
verification and the later DB verification so both occur after the chosen
synchronization.
🪄 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: defaults
Review profile: CHILL
Plan: Pro
Run ID: fd3c9ac1-3d34-4ca5-9170-ca3ed0e58593
📒 Files selected for processing (3)
lib/views/screens/chapter_play_screen.dartlib/views/widgets/snackbar.darttest/controllers/change_email_controller_test.dart
✅ Files skipped from review due to trivial changes (1)
- lib/views/screens/chapter_play_screen.dart
There was a problem hiding this comment.
🧹 Nitpick comments (1)
test/controllers/change_email_controller_test.dart (1)
205-205: Replace fixed-duration settle with deterministic async synchronization.Line 205 uses a hard-coded 4-second settle duration, which can make tests slower and more flaky. The subsequent mock verification (lines 207-214) can instead be awaited directly with
untilCalled()from mockito.Proposed refactor
- await tester.pumpAndSettle(const Duration(seconds: 4)); + await untilCalled( + mockDatabases.updateDocument( + databaseId: userDatabaseID, + collectionId: usernameCollectionID, + documentId: 'TestUser', + data: {'email': 'test2@test.com'}, + ), + ); + await tester.pump();🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed. In `@test/controllers/change_email_controller_test.dart` at line 205, Replace the fixed 4-second wait (tester.pumpAndSettle(const Duration(seconds: 4))) with deterministic async synchronization by awaiting mockito's untilCalled for the mocked method you expect to be invoked in this test (e.g., untilCalled(mockYourRepo.changeEmail(...)) ), then call tester.pumpAndSettle() without a long duration to flush UI frames; update the subsequent verification to run after the untilCalled await so the mock invocation is guaranteed before verify() is asserted.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.
Nitpick comments:
In `@test/controllers/change_email_controller_test.dart`:
- Line 205: Replace the fixed 4-second wait (tester.pumpAndSettle(const
Duration(seconds: 4))) with deterministic async synchronization by awaiting
mockito's untilCalled for the mocked method you expect to be invoked in this
test (e.g., untilCalled(mockYourRepo.changeEmail(...)) ), then call
tester.pumpAndSettle() without a long duration to flush UI frames; update the
subsequent verification to run after the untilCalled await so the mock
invocation is guaranteed before verify() is asserted.
ℹ️ Review info
⚙️ Run configuration
Configuration used: defaults
Review profile: CHILL
Plan: Pro
Run ID: 807a5271-55ef-4af3-9d83-c0a809d11d46
📒 Files selected for processing (1)
test/controllers/change_email_controller_test.dart
|
Hi! I've added Spanish ( The changes include:
Note: There's an unrelated Gradle build error ( Thank you! 🙌 |
|
This PR is ready to be merged. All checks have passed and the Spanish translation is complete. Please let me know if any changes are required. |
Summary
This PR adds complete Spanish language support to Resonate.
Changes made
lib/l10n/app_es.arbwith all strings translated fromapp_en.arbLocale('es')tosupportedLocalesinlib/main.dart<string>es</string>toCFBundleLocalizationsinios/Runner/Info.plistflutter gen-l10n– no errors, all placeholders preservedTesting done
{username}) work correctlyType of change
Please delete options that are not relevant.
How Has This Been Tested?
Please describe the tests that you ran to verify your changes. Provide instructions so we can reproduce. Please also list any relevant details for your test configuration
Please include screenshots below if applicable.
Checklist:
Maintainer Checklist
Summary by CodeRabbit
New Features
Chores