Skip to content

Fixes issue #1: fixed hardcoded strings#41

Open
manjeetsinghmeena wants to merge 3 commits into
iiitl:masterfrom
manjeetsinghmeena:issue-1-fix_hardcoded_strings
Open

Fixes issue #1: fixed hardcoded strings#41
manjeetsinghmeena wants to merge 3 commits into
iiitl:masterfrom
manjeetsinghmeena:issue-1-fix_hardcoded_strings

Conversation

@manjeetsinghmeena
Copy link
Copy Markdown

@manjeetsinghmeena manjeetsinghmeena commented Apr 10, 2026

Resolves #1.

Move strings from Kotlin files to strings.xml for Localization (additionally moved strings from ui xml files to string.xml as well)

What is the purpose of this pull request?
This pull request replaces hardcoded strings in Kotlin and XML files with string resources defined in strings.xml
The purpose is to improve maintainability, ensure consistency across the UI, and enable easier localization support for the application

Checkout

  • I have read all the contributor guidelines for the repo.

Summary by CodeRabbit

  • Bug Fixes

    • Corrected spelling: "Send Menu for Approoval" → "Send Menu for Approval".
  • Localization

    • Replaced many hardcoded UI texts with string resources (buttons, labels, weekdays, meals, hints, alerts, toasts).
    • Alarm/time keys and related status/log messages moved to localized resources for consistency.
  • Chores

    • Updated Gradle tooling and wrapper versions.

Copilot AI review requested due to automatic review settings April 10, 2026 23:22
@coderabbitai
Copy link
Copy Markdown

coderabbitai Bot commented Apr 10, 2026

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 5eda8d8c-0e18-44c9-bb7e-b2ea31292d58

📥 Commits

Reviewing files that changed from the base of the PR and between 2166f0d and d802e65.

📒 Files selected for processing (4)
  • app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt
  • app/src/main/res/layout/activity_edit_complete.xml
  • app/src/main/res/layout/fragment_edit_complete.xml
  • app/src/main/res/values/strings.xml
✅ Files skipped from review due to trivial changes (2)
  • app/src/main/res/layout/fragment_edit_complete.xml
  • app/src/main/res/layout/activity_edit_complete.xml
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt
  • app/src/main/res/values/strings.xml

Walkthrough

Moved hardcoded UI and runtime strings from Kotlin and XML layouts into Android string resources; updated MainActivity to use resource-backed alarm keys and localized log formatting; added new string entries; upgraded Android Gradle Plugin and Gradle wrapper versions.

Changes

Cohort / File(s) Summary
Kotlin localization & alarm keys
app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt
Replaced hardcoded toasts, alert/dialog texts, and log concatenation with getString(...); switched alarm timing lookups to use resource-backed keys/defaults (getString(R.string.*)); changed alarm debug log to String.format(getString(...), ...).
Layout string replacements
app/src/main/res/layout/activity_edit_complete.xml, app/src/main/res/layout/activity_menu.xml, app/src/main/res/layout/activity_payment.xml, app/src/main/res/layout/activity_review.xml, app/src/main/res/layout/activity_settings.xml, app/src/main/res/layout/activity_show_menu.xml, app/src/main/res/layout/dateitem.xml, app/src/main/res/layout/edit_dialog.xml, app/src/main/res/layout/fragment_details.xml, app/src/main/res/layout/fragment_edit_complete.xml
Replaced many hardcoded button labels, hints, content descriptions, weekday and meal labels with @string/... references; corrected a misspelling by referencing menu_approval.
String resources added/modified
app/src/main/res/values/strings.xml
Added ~40 string resources (meal labels, weekdays, UI actions, input hints, alert/dialog text, alarm key names and default times, setting_alarms_log, download/logout messages); marked certain keys (mess_poll_id, user_is_Logged_In, user, bt/lt/st/dt) translatable="false" as appropriate.
Build tool upgrades
gradle/libs.versions.toml, gradle/wrapper/gradle-wrapper.properties
Bumped AGP reference from 8.6.18.13.2 and updated Gradle wrapper distributionUrl to Gradle 8.13.

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

Possibly related issues

  • #1 — Move all strings from Kotlin files to strings.xml for Localization: This PR migrates hardcoded strings from MainActivity and layouts into strings.xml, directly addressing the issue's objective.
  • iiitl/Student-Hub-App#1: Similar extraction of hardcoded UI/toast/alert strings into resources; changes align with that refactor pattern.
🚥 Pre-merge checks | ✅ 2 | ❌ 3

❌ Failed checks (3 warnings)

Check name Status Explanation Resolution
Linked Issues check ⚠️ Warning The PR successfully adds string resources to strings.xml and replaces hardcoded literals with resource references in Kotlin and XML files; however, comments reveal that SharedPreferences keys were changed incompatibly and localized strings were used unnecessarily in logs. Address backward compatibility by reverting SharedPreferences key changes and remove context.getString() calls from non-user-facing logs to reduce overhead and improve readability.
Out of Scope Changes check ⚠️ Warning The PR includes in-scope string externalization changes plus two out-of-scope modifications: upgrading Gradle from 8.7 to 8.13 and AGP from 8.6.1 to 8.13.2, which are unrelated to the hardcoded strings objective. Move Gradle and AGP version upgrades to a separate PR focused on dependency updates to keep the hardcoded strings fix isolated and easier to review.
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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title 'Fixes issue #1: fixed hardcoded strings' directly relates to the PR's main objective of moving hardcoded strings to strings.xml for localization as specified in issue #1.

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

✨ Finishing Touches
🧪 Generate unit tests (beta)
  • Create PR with unit tests

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.

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This pull request aims to improve localization support by replacing hardcoded UI strings with strings.xml resources, while also updating build tooling versions.

Changes:

  • Migrated several hardcoded strings in layout XML and MainActivity.kt to @string/... resources.
  • Added multiple new string resources (meal labels, day names, button labels, log/toast text) to strings.xml.
  • Upgraded Gradle wrapper and Android Gradle Plugin (AGP) versions.

Reviewed changes

Copilot reviewed 13 out of 13 changed files in this pull request and generated 6 comments.

Show a summary per file
File Description
gradle/wrapper/gradle-wrapper.properties Upgrades Gradle wrapper distribution URL/version.
gradle/libs.versions.toml Bumps AGP version in version catalog.
app/src/main/res/values/strings.xml Adds new string resources used by Kotlin and layout XML changes.
app/src/main/res/layout/fragment_details.xml Replaces hardcoded “Done” with @string/done.
app/src/main/res/layout/edit_dialog.xml Replaces hardcoded “Done” with @string/done.
app/src/main/res/layout/dateitem.xml Replaces hardcoded “Day” with @string/day.
app/src/main/res/layout/activity_show_menu.xml Replaces hardcoded day/meal/navigation labels with string resources.
app/src/main/res/layout/activity_settings.xml Replaces hardcoded “Done” with @string/done.
app/src/main/res/layout/activity_review.xml Replaces hardcoded hints/defaults with string resources.
app/src/main/res/layout/activity_payment.xml Replaces hardcoded contentDescription/hints/button text with string resources.
app/src/main/res/layout/activity_menu.xml Replaces hardcoded day/meal/navigation labels with string resources.
app/src/main/res/layout/activity_edit_complete.xml Localizes “Download edited Menu”; adjusts “Send Menu…” text (still hardcoded).
app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt Replaces hardcoded toast/dialog/log strings with string resources; changes alarm settings key/default handling.

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

Comment on lines 360 to 365
val times = listOf(
mess.get("bt", "7:30"),
mess.get("lt", "12:0"),
mess.get("st", "16:30"),
mess.get("dt", "19:0")
mess.get(getString(R.string.breakfast_time),getString(R.string.b_time)),
mess.get(getString(R.string.lunch_time),getString(R.string.l_time)),
mess.get(getString(R.string.snack_time),getString(R.string.s_time)),
mess.get(getString(R.string.dinner_time),getString(R.string.d_time))
)
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

mess.get(getString(R.string.*_time), ...) uses string resources as preference keys (e.g., "bt", "lt"). Because string resources are translatable by default, localizing these values can change the stored keys and break reading/writing alarm times across locales. Prefer keeping these keys as non-localized constants (e.g., in a Constants object) or, if they must remain resources, mark them translatable="false" and avoid exposing them to translators.

Copilot uses AI. Check for mistakes.
Comment on lines +367 to +368
mess.log(String.format(
getString(R.string.setting_alarms_log), times[0], times[1], times[2], times[3]))
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

For a formatted string resource with placeholders, prefer getString(R.string.setting_alarms_log, ...) instead of String.format(getString(...), ...). This ensures proper locale-aware formatting and avoids lint issues around string formatting.

Suggested change
mess.log(String.format(
getString(R.string.setting_alarms_log), times[0], times[1], times[2], times[3]))
mess.log(
getString(R.string.setting_alarms_log, times[0], times[1], times[2], times[3])
)

Copilot uses AI. Check for mistakes.
android:layout_marginBottom="45dp"
android:drawableEnd="@drawable/baseline_send_24"
android:text="Send Menu for Approoval"
android:text="Send Menu for Approval"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This button text is still hardcoded, which defeats the localization goal of the PR. It looks like @string/menu_approval was added and should be referenced here instead (and it would also keep the spelling fix consistent).

Suggested change
android:text="Send Menu for Approval"
android:text="@string/menu_approval"

Copilot uses AI. Check for mistakes.
<string name="menu_know_our_team">Know our team\n</string>
<string name="demolunch">Marry had a little lamb.</string>


Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

There are two consecutive blank lines here; please remove the extra whitespace to keep strings.xml tidy and minimize noisy diffs.

Suggested change

Copilot uses AI. Check for mistakes.
Comment on lines 3 to +4
distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-8.7-bin.zip
distributionUrl=https\://services.gradle.org/distributions/gradle-8.13-bin.zip
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

This PR is described as moving hardcoded UI strings into strings.xml, but it also upgrades the Gradle wrapper. If this is intentional, please call it out in the PR description (and ideally separate it into its own PR) since build tool upgrades can have wider impact/required follow-up changes.

Copilot uses AI. Check for mistakes.
Comment thread gradle/libs.versions.toml
Comment on lines 1 to +2
[versions]
agp = "8.6.1"
agp = "8.13.2"
Copy link

Copilot AI Apr 10, 2026

Choose a reason for hiding this comment

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

Along with string localization, this change upgrades the Android Gradle Plugin version. Please confirm the upgrade is intended and either document it in the PR description or split it out, since AGP bumps can require additional project-wide adjustments.

Copilot uses AI. Check for mistakes.
Copy link
Copy Markdown

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 6

Caution

Some comments are outside the diff and can’t be posted inline due to platform limitations.

⚠️ Outside diff range comments (2)
app/src/main/res/layout/activity_show_menu.xml (1)

81-97: ⚠️ Potential issue | 🟠 Major

Missed literals: Thursday and Snacks are still hardcoded.

Most labels are localized, but Line 129 and Line 402 still use raw text, which breaks full localization for this screen.

🔧 Suggested change
-                    android:text="Thursday"
+                    android:text="@string/thursday"

-                    android:text="Snacks"
+                    android:text="@string/snacks"

Also add snacks to app/src/main/res/values/strings.xml.

Also applies to: 145-160, 192-193, 297-298, 508-509

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/layout/activity_show_menu.xml` around lines 81 - 97, Replace
hardcoded text literals for "Thursday" and "Snacks" in the layout by using
string resources (e.g., android:text="@string/thursday" and
android:text="@string/snacks") wherever those raw texts currently appear (search
for TextView ids like thursday, snacks or literal "Thursday"/"Snacks" in
activity_show_menu.xml and the other mentioned occurrences). Add corresponding
entries "thursday" and "snacks" to app/src/main/res/values/strings.xml with
translated/default values. Ensure any other occurrences (e.g., other TextView
elements or attributes in the same layout) reference the new string resource
keys so the screen is fully localizable.
app/src/main/res/layout/activity_menu.xml (1)

81-176: ⚠️ Potential issue | 🟡 Minor

Localization migration is still incomplete in this screen.

There are still hardcoded user-facing strings in the same layout (e.g., Line 129 "Thursday", Line 402 "Snacks", plus other literals like Line 64 and Line 624). Please move these to strings.xml to fully satisfy Issue #1.

Also applies to: 192-508

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/layout/activity_menu.xml` around lines 81 - 176, Several
user-facing strings are still hardcoded in this layout; replace them with string
resources in strings.xml and reference them via `@string`. Specifically, move the
TextView text "Thursday" for the view with id @+id/thursday into strings.xml
(e.g., <string name="thursday">Thursday</string>) and update the layout to use
android:text="@string/thursday"; also search the same file for other hardcoded
literals mentioned in the review (e.g., the "Snacks" label and other literals
around the indicated ranges) and convert each to string resources, updating
their corresponding views (ids like @+id/snacks or any other TextView ids found)
to use `@string` references. Ensure all user-visible text in this layout is
referenced via strings.xml to complete the localization migration.
🧹 Nitpick comments (2)
app/src/main/res/values/strings.xml (1)

52-52: Use indexed placeholders for localization-safe formatting.

At Line 52, prefer %1$s, %2$s, etc., so translators can reorder sentence parts safely.

🔧 Suggested change
-    <string name="setting_alarms_log">Setting alarms: Breakfast %s, Lunch %s, Snack %s, Dinner %s</string>
+    <string name="setting_alarms_log">Setting alarms: Breakfast %1$s, Lunch %2$s, Snack %3$s, Dinner %4$s</string>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/values/strings.xml` at line 52, The string resource
setting_alarms_log uses non-indexed placeholders ("%s"); update it to use
indexed placeholders so translators can reorder items safely—replace "%s"
occurrences with "%1$s", "%2$s", "%3$s", "%4$s" respectively in the value of the
string resource named setting_alarms_log and keep the surrounding text intact.
app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt (1)

367-368: Use Android resource formatting API with arguments directly.

Replace String.format(getString(R.string.setting_alarms_log), ...) with getString(R.string.setting_alarms_log, times[0], times[1], times[2], times[3]). This is the idiomatic approach in Android and keeps localization handling in one place.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt` around lines
367 - 368, Replace the manual String.format call and pass the args directly to
Android's resource formatting: in MainActivity.kt where
mess.log(String.format(getString(R.string.setting_alarms_log), times[0],
times[1], times[2], times[3])) is used, call
getString(R.string.setting_alarms_log, times[0], times[1], times[2], times[3])
and pass that result to mess.log; update the reference to use the resource
formatting API (getString with varargs) instead of wrapping getString in
String.format.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Inline comments:
In `@app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt`:
- Around line 361-364: The code is using localized resources as
SharedPreferences keys (e.g., calls to
mess.get(getString(R.string.breakfast_time), ...)) so saved times break when
locale changes; fix by replacing those getString(R.string.*) keys with stable,
non-localized keys (either string literals like "breakfast_time" or constants in
a companion/object) wherever you read or write prefs (notably the calls in
MainActivity.kt that invoke mess.get(...) and the occurrences in Mess.kt), and
ensure the default values still use localized strings
(getString(R.string.b_time) etc.) while the preference keys remain constant
across locales.

In `@app/src/main/res/layout/activity_edit_complete.xml`:
- Line 66: Replace the hardcoded android:text="Send Menu for Approval" in
activity_edit_complete.xml with the string resource reference
`@string/menu_approval` so the layout uses the localized resource (update the
android:text attribute where "Send Menu for Approval" appears).

In `@app/src/main/res/layout/activity_review.xml`:
- Around line 72-79: The layout activity_review.xml still contains hardcoded
user-facing text (e.g., android:text attributes for views like the
AutoCompleteTextView with id "day" and other text elements showing "Rate your
experience", "Share your thoughts", "Write a review", etc. around the shown
ranges); replace each literal string with a string resource reference
(android:text="@string/your_label") and add corresponding entries in strings.xml
(giving descriptive resource names like review_rate_experience,
review_share_thoughts, review_write_review, day_default) so all UI text uses
`@string/`... for localization; update any other hardcoded occurrences in the file
(including lines 88-96 and the shown lines) to follow the same pattern.

In `@app/src/main/res/layout/edit_dialog.xml`:
- Line 16: This layout still contains hardcoded android:text values "Updation"
and "Cancel" — replace those literals in edit_dialog.xml with string resource
references (e.g., android:text="@string/your_key_for_updation" and
android:text="@string/button_cancel") and add corresponding entries into
strings.xml (keys matching the references) so all UI text uses string resources;
ensure the keys are descriptive and consistent with the existing "@string/done"
usage.

In `@app/src/main/res/values/strings.xml`:
- Around line 44-51: The strings used as preference keys and default times
(e.g., "breakfast_time", "lunch_time", "snack_time", "dinner_time", "b_time",
"l_time", "s_time", "d_time") are being translated and must be marked
non-translatable so SharedPreferences lookups in Mess.kt (refs around the time
parsing calls) and MainActivity.kt (refs around alarm/default time usage) remain
stable; update those <string> definitions to include translatable="false" (or
move them to a non-translatable resource) so their values won’t change across
locales and preferences/alarm parsing continue to work.

In `@gradle/libs.versions.toml`:
- Line 2: Update the app's compilation settings to target Java 17 to match AGP
8.13.2: in app/build.gradle.kts update the compileOptions block (compileOptions)
to set sourceCompatibility and targetCompatibility to JavaVersion.VERSION_17 and
update kotlinOptions (kotlinOptions) to set jvmTarget to "17"; alternatively
configure a Gradle JVM toolchain by adding jvmToolchain(17) so Gradle manages
JDK 17 consistently for the project and CI/local builds.

---

Outside diff comments:
In `@app/src/main/res/layout/activity_menu.xml`:
- Around line 81-176: Several user-facing strings are still hardcoded in this
layout; replace them with string resources in strings.xml and reference them via
`@string`. Specifically, move the TextView text "Thursday" for the view with id
@+id/thursday into strings.xml (e.g., <string name="thursday">Thursday</string>)
and update the layout to use android:text="@string/thursday"; also search the
same file for other hardcoded literals mentioned in the review (e.g., the
"Snacks" label and other literals around the indicated ranges) and convert each
to string resources, updating their corresponding views (ids like @+id/snacks or
any other TextView ids found) to use `@string` references. Ensure all user-visible
text in this layout is referenced via strings.xml to complete the localization
migration.

In `@app/src/main/res/layout/activity_show_menu.xml`:
- Around line 81-97: Replace hardcoded text literals for "Thursday" and "Snacks"
in the layout by using string resources (e.g., android:text="@string/thursday"
and android:text="@string/snacks") wherever those raw texts currently appear
(search for TextView ids like thursday, snacks or literal "Thursday"/"Snacks" in
activity_show_menu.xml and the other mentioned occurrences). Add corresponding
entries "thursday" and "snacks" to app/src/main/res/values/strings.xml with
translated/default values. Ensure any other occurrences (e.g., other TextView
elements or attributes in the same layout) reference the new string resource
keys so the screen is fully localizable.

---

Nitpick comments:
In `@app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt`:
- Around line 367-368: Replace the manual String.format call and pass the args
directly to Android's resource formatting: in MainActivity.kt where
mess.log(String.format(getString(R.string.setting_alarms_log), times[0],
times[1], times[2], times[3])) is used, call
getString(R.string.setting_alarms_log, times[0], times[1], times[2], times[3])
and pass that result to mess.log; update the reference to use the resource
formatting API (getString with varargs) instead of wrapping getString in
String.format.

In `@app/src/main/res/values/strings.xml`:
- Line 52: The string resource setting_alarms_log uses non-indexed placeholders
("%s"); update it to use indexed placeholders so translators can reorder items
safely—replace "%s" occurrences with "%1$s", "%2$s", "%3$s", "%4$s" respectively
in the value of the string resource named setting_alarms_log and keep the
surrounding text intact.
🪄 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: da0a61f7-235e-4ca9-a949-a69bf7f92c00

📥 Commits

Reviewing files that changed from the base of the PR and between e9da1c5 and ecca04f.

📒 Files selected for processing (13)
  • app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt
  • app/src/main/res/layout/activity_edit_complete.xml
  • app/src/main/res/layout/activity_menu.xml
  • app/src/main/res/layout/activity_payment.xml
  • app/src/main/res/layout/activity_review.xml
  • app/src/main/res/layout/activity_settings.xml
  • app/src/main/res/layout/activity_show_menu.xml
  • app/src/main/res/layout/dateitem.xml
  • app/src/main/res/layout/edit_dialog.xml
  • app/src/main/res/layout/fragment_details.xml
  • app/src/main/res/values/strings.xml
  • gradle/libs.versions.toml
  • gradle/wrapper/gradle-wrapper.properties

Comment thread app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt Outdated
Comment thread app/src/main/res/layout/activity_edit_complete.xml Outdated
Comment on lines +72 to +79
android:hint="@string/day">
<AutoCompleteTextView
android:id="@+id/day"
android:textColor="@color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"
android:text="Monday" />
android:text="@string/monday" />
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Partial migration: several user-facing strings remain hardcoded in this layout.

The updated fields are good, but literals like Line 119 ("Rate your experience"), Line 147 ("Share your thoughts"), Line 174 ("Write a review"), Line 185, and Line 199 still need @string/... resources to complete localization.

Also applies to: 88-96

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/layout/activity_review.xml` around lines 72 - 79, The layout
activity_review.xml still contains hardcoded user-facing text (e.g.,
android:text attributes for views like the AutoCompleteTextView with id "day"
and other text elements showing "Rate your experience", "Share your thoughts",
"Write a review", etc. around the shown ranges); replace each literal string
with a string resource reference (android:text="@string/your_label") and add
corresponding entries in strings.xml (giving descriptive resource names like
review_rate_experience, review_share_thoughts, review_write_review, day_default)
so all UI text uses `@string/`... for localization; update any other hardcoded
occurrences in the file (including lines 88-96 and the shown lines) to follow
the same pattern.

android:layout_margin="25dp"
android:backgroundTint="#2196F3"
android:text="Done"
android:text="@string/done"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

Localization is still incomplete in this dialog.

Line 16 is fixed, but hardcoded UI text remains at Line 30 ("Updation") and Line 49 ("Cancel"), so this file still does not fully meet the string-extraction objective.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/layout/edit_dialog.xml` at line 16, This layout still
contains hardcoded android:text values "Updation" and "Cancel" — replace those
literals in edit_dialog.xml with string resource references (e.g.,
android:text="@string/your_key_for_updation" and
android:text="@string/button_cancel") and add corresponding entries into
strings.xml (keys matching the references) so all UI text uses string resources;
ensure the keys are descriptive and consistent with the existing "@string/done"
usage.

Comment thread app/src/main/res/values/strings.xml Outdated
Comment thread gradle/libs.versions.toml
@@ -1,5 +1,5 @@
[versions]
agp = "8.6.1"
agp = "8.13.2"
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

⚠️ Potential issue | 🟠 Major

🧩 Analysis chain

🏁 Script executed:

#!/bin/bash
# Read-only verification: check whether JDK/toolchain compatibility is explicitly configured.

echo "== Candidate build/CI files =="
fd -i 'build.gradle'
fd -i 'build.gradle.kts'
fd -i 'settings.gradle'
fd -i 'settings.gradle.kts'
fd -i 'gradle.properties'
fd -i '.github'
fd -i '*.yml'
fd -i '*.yaml'

echo
echo "== Toolchain/JDK/AGP related config hits =="
rg -n --iglob '*build.gradle' --iglob '*build.gradle.kts' --iglob 'settings.gradle' --iglob 'settings.gradle.kts' \
  --iglob 'gradle.properties' --iglob '*.yml' --iglob '*.yaml' \
  'jvmToolchain|JavaVersion\.VERSION_17|sourceCompatibility|targetCompatibility|org\.gradle\.java\.home|actions/setup-java|com\.android\.application|com\.android\.library'

Repository: iiitl/MessEase

Length of output: 1011


🏁 Script executed:

cat -n build.gradle.kts

Repository: iiitl/MessEase

Length of output: 462


🏁 Script executed:

cat -n app/build.gradle.kts

Repository: iiitl/MessEase

Length of output: 4776


🏁 Script executed:

cat -n gradle.properties

Repository: iiitl/MessEase

Length of output: 1565


🏁 Script executed:

fd --glob '.github' --type d

Repository: iiitl/MessEase

Length of output: 265


🏁 Script executed:

web_search
AGP 8.13.2 JDK Java version requirements

Repository: iiitl/MessEase

Length of output: 150


🏁 Script executed:

fd --hidden --glob '.github' --type d

Repository: iiitl/MessEase

Length of output: 66


🌐 Web query:

AGP 8.13.2 minimum Java JDK version requirements

💡 Result:

The minimum Java JDK version required for Android Gradle Plugin (AGP) 8.13.2 is JDK 17. AGP 8.13.2 is a patch release of the 8.13 major version. The official Android developer documentation for AGP 8.13.0 explicitly states in its compatibility table that the minimum JDK version is 17 (with default also 17). This requirement is consistent across recent AGP 8.x versions (e.g., 8.8.0, 8.9.0, 8.11.0), and there is no indication of changes for patch releases like 8.13.2, which primarily adds Kotlin 2.3 support via updated R8. Gradle 8.13 (the minimum Gradle version for AGP 8.13) supports running on JVM 8-23, so JDK 17 is well within compatibility. To configure, set the JDK version in your project as per the official guide: https://developer.android.com/build/jdks.

Citations:


🏁 Script executed:

find .github -type f -name '*.yml' -o -name '*.yaml' | head -20

Repository: iiitl/MessEase

Length of output: 87


🏁 Script executed:

fd --type f '.github' --extension yml --extension yaml

Repository: iiitl/MessEase

Length of output: 40


🏁 Script executed:

cat -n .github/workflows/release.yml

Repository: iiitl/MessEase

Length of output: 6986


Update compileOptions and kotlinOptions to use Java 17, matching AGP 8.13.2 requirements.

AGP 8.13.2 requires JDK 17 minimum. The app's build.gradle.kts currently hard-pins sourceCompatibility, targetCompatibility, and jvmTarget to Java 1.8 (lines 41–46), creating a mismatch. While the CI workflow correctly sets up Java 17, local builds will be environment-dependent. Update app/build.gradle.kts to align compile settings with AGP requirements:

compileOptions {
    sourceCompatibility = JavaVersion.VERSION_17
    targetCompatibility = JavaVersion.VERSION_17
}

kotlinOptions {
    jvmTarget = "17"
}

Alternatively, use jvmToolchain(17) for Gradle-managed JDK consistency across the project.

🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@gradle/libs.versions.toml` at line 2, Update the app's compilation settings
to target Java 17 to match AGP 8.13.2: in app/build.gradle.kts update the
compileOptions block (compileOptions) to set sourceCompatibility and
targetCompatibility to JavaVersion.VERSION_17 and update kotlinOptions
(kotlinOptions) to set jvmTarget to "17"; alternatively configure a Gradle JVM
toolchain by adding jvmToolchain(17) so Gradle manages JDK 17 consistently for
the project and CI/local builds.

@manjeetsinghmeena
Copy link
Copy Markdown
Author

@theayushyadav11 made the required changes

@namanhere23
Copy link
Copy Markdown
Collaborator

Hi @manjeetsinghmeena

Issues:

SharedPreferences key change breaks existing data
The keys have been changed from short identifiers (e.g., "bt") to new strings like "Breakfast timings".
This will break backward compatibility, as previously saved values will no longer be read, effectively resetting user data.

Using context.getString(R.string.all_alarms_cancelled) inside logs is unnecessary.
Logs are meant for debugging and are not user-facing, so they do not require localization. Fetching strings from resources adds unnecessary overhead and reduces readability.

@manjeetsinghmeena
Copy link
Copy Markdown
Author

@namanhere23 made the changes. please go through

@namanhere23
Copy link
Copy Markdown
Collaborator

Using getString(R.string.*_t) as keys for mess.get(...) can introduce localization issues.

Since string resources are translatable by default, their values may change across locales (e.g., "bt", "lt"), which can break key consistency when reading/writing stored values.

It’s safer to:

  • Use non-localized constant keys (e.g., in a Constants object)

This ensures stable keys regardless of language changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Move all strings from Kotlin files to strings.xml for Localization

4 participants