Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 11 additions & 11 deletions app/src/main/java/com/theayushyadav11/MessEase/MainActivity.kt
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,7 @@ class MainActivity : AppCompatActivity() {

private val onDownloadComplete: BroadcastReceiver = object : BroadcastReceiver() {
override fun onReceive(context: Context, intent: Intent) {
Toast.makeText(context, "Download completed!", Toast.LENGTH_SHORT).show()
Toast.makeText(context, getString(R.string.download_completed), Toast.LENGTH_SHORT).show()
}
}

Expand Down Expand Up @@ -238,9 +238,9 @@ class MainActivity : AppCompatActivity() {
} else {
if (!isFinishing && !isDestroyed) {
mess.showAlertDialog(
"Alert!",
"You are not a member of Mess Committee!",
"Ok",
getString(R.string.alert),
getString(R.string.not_mess_member),
getString(R.string.ok),
""
) {}
}
Expand Down Expand Up @@ -311,7 +311,7 @@ class MainActivity : AppCompatActivity() {

mAuth.signOut()
mGoogleSignInClient.signOut().addOnCompleteListener(this) {
Toast.makeText(this, "Logged out successfully", Toast.LENGTH_SHORT).show()
Toast.makeText(this, getString(R.string.logged_out_successfully), Toast.LENGTH_SHORT).show()
}
} catch (e: Exception) {
mess.log("Sign out error: ${e.message}")
Expand Down Expand Up @@ -358,14 +358,14 @@ class MainActivity : AppCompatActivity() {
val intent = Intent(this@MainActivity, AlarmReceiver::class.java)

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.bt),getString(R.string.b_time)),
mess.get(getString(R.string.lt),getString(R.string.l_time)),
mess.get(getString(R.string.st),getString(R.string.s_time)),
mess.get(getString(R.string.dt),getString(R.string.d_time))
)
Comment on lines 360 to 365

Copilot AI Apr 10, 2026

Copy link

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.

mess.log("Setting alarms: Breakfast ${times[0]}, Lunch ${times[1]}, " +
"Snack ${times[2]}, Dinner ${times[3]}")
mess.log(String.format(
getString(R.string.setting_alarms_log), times[0], times[1], times[2], times[3]))
Comment on lines +367 to +368

Copilot AI Apr 10, 2026

Copy link

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.

for (i in times.indices) {
scheduleAlarm(i, times[i], intent)
Expand Down
4 changes: 2 additions & 2 deletions app/src/main/res/layout/activity_edit_complete.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
android:layout_height="59dp"
android:layout_marginHorizontal="25dp"
android:drawableEnd="@drawable/baseline_file_download_24"
android:text="Download edited Menu"
android:text="@string/download_edited_menu"
android:textColor="@color/white"
app:cornerRadius="5dp"
android:layout_marginVertical="15dp"
Expand All @@ -63,7 +63,7 @@
android:layout_marginHorizontal="25dp"
android:layout_marginBottom="45dp"
android:drawableEnd="@drawable/baseline_send_24"
android:text="Send Menu for Approoval"
android:text="@string/menu_approval"
android:textColor="@color/white"
app:cornerRadius="5dp"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/res/layout/activity_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="25dp"
android:text="Next"
android:text="@string/next"
android:textColor="#ffffff"
app:cornerRadius="25dp"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down Expand Up @@ -78,7 +78,7 @@
android:background="#eff3ff"

android:gravity="center"
android:text="Monday"
android:text="@string/monday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/menu"
Expand All @@ -94,7 +94,7 @@
android:background="#eff3ff"

android:gravity="center"
android:text="Tuesday"
android:text="@string/tuesday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/monday"
Expand All @@ -110,7 +110,7 @@
android:background="#eff3ff"

android:gravity="center"
android:text="Wednesday"
android:text="@string/wednesday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/tuesday"
Expand Down Expand Up @@ -142,7 +142,7 @@
android:background="#eff3ff"
android:gravity="center"

android:text="Friday"
android:text="@string/friday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/thursday"
Expand All @@ -157,7 +157,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Saturday"
android:text="@string/saturday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/friday"
Expand All @@ -173,7 +173,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Sunday"
android:text="@string/sunday"
android:textSize="20sp"
android:textStyle="bold"

Expand All @@ -189,7 +189,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Breakfast"
android:text="@string/meal_breakfast"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
Expand Down Expand Up @@ -294,7 +294,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Lunch"
android:text="@string/meal_lunch"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
Expand Down Expand Up @@ -505,7 +505,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Dinner"
android:text="@string/meal_dinner"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_payment.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
android:layout_width="40dp"
android:layout_height="40dp"
android:src="@drawable/history_svgrepo_com"
android:contentDescription="History"
android:contentDescription="@string/history"
android:background="?android:attr/selectableItemBackground"
android:layout_gravity="end|center_vertical"
app:tint="@android:color/white"
Expand All @@ -48,7 +48,7 @@
android:layout_height="wrap_content"
android:layout_margin="25dp"
android:layout_marginBottom="0dp"
android:hint="Enter Amount in Rupees"
android:hint="@string/enter_amount"
app:startIconDrawable="@drawable/baseline_currency_rupee_24"
app:layout_constraintTop_toBottomOf="@id/toolbar"
tools:layout_editor_absoluteX="25dp">
Expand All @@ -67,7 +67,7 @@
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:layout_margin="25dp"
android:hint="Enter Purpose"
android:hint="@string/enter_purpose"
app:counterEnabled="true"
app:counterMaxLength="25"
app:layout_constraintTop_toBottomOf="@id/textInputLayout2"
Expand Down Expand Up @@ -104,7 +104,7 @@
android:layout_marginHorizontal="25dp"
android:layout_marginBottom="35dp"
android:enabled="false"
android:text="Pay"
android:text="@string/pay"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"
Expand Down
8 changes: 4 additions & 4 deletions app/src/main/res/layout/activity_review.xml
Original file line number Diff line number Diff line change
Expand Up @@ -69,14 +69,14 @@
android:layout_weight="1"
android:layout_marginEnd="8dp"
android:layout_height="wrap_content"
android:hint="Day">
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" />
Comment on lines +72 to +79

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.

</com.google.android.material.textfield.TextInputLayout>

<com.google.android.material.textfield.TextInputLayout
Expand All @@ -85,15 +85,15 @@
android:layout_width="0dp"
android:layout_weight="1"
android:layout_height="wrap_content"
android:hint="Meal Type">
android:hint="@string/meal_type">

<AutoCompleteTextView
android:id="@+id/type"
android:textColor="@color/black"
android:layout_width="match_parent"
android:layout_height="wrap_content"
android:inputType="none"
android:text="Breakfast" />
android:text="@string/meal_breakfast" />
</com.google.android.material.textfield.TextInputLayout>
</LinearLayout>
</com.google.android.material.card.MaterialCardView>
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/activity_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
android:layout_height="55dp"
android:layout_marginHorizontal="25dp"
android:layout_marginVertical="55dp"
android:text="Done"
android:text="@string/done"
app:cornerRadius="5dp"
app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintTop_toBottomOf="@+id/dinnerCard" />
Expand Down
20 changes: 10 additions & 10 deletions app/src/main/res/layout/activity_show_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
android:layout_width="80dp"
android:layout_height="80dp"
android:layout_margin="25dp"
android:text="Next"
android:text="@string/next"
android:textColor="#ffffff"
app:cornerRadius="25dp"
app:layout_constraintBottom_toBottomOf="parent"
Expand Down Expand Up @@ -78,7 +78,7 @@
android:background="#eff3ff"

android:gravity="center"
android:text="Monday"
android:text="@string/monday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/menu"
Expand All @@ -94,7 +94,7 @@
android:background="#eff3ff"

android:gravity="center"
android:text="Tuesday"
android:text="@string/tuesday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/monday"
Expand All @@ -110,7 +110,7 @@
android:background="#eff3ff"

android:gravity="center"
android:text="Wednesday"
android:text="@string/wednesday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/tuesday"
Expand Down Expand Up @@ -142,7 +142,7 @@
android:background="#eff3ff"
android:gravity="center"

android:text="Friday"
android:text="@string/friday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/thursday"
Expand All @@ -157,7 +157,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Saturday"
android:text="@string/saturday"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toEndOf="@id/friday"
Expand All @@ -173,7 +173,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Sunday"
android:text="@string/sunday"
android:textSize="20sp"
android:textStyle="bold"

Expand All @@ -189,7 +189,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Breakfast"
android:text="@string/meal_breakfast"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
Expand Down Expand Up @@ -294,7 +294,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Lunch"
android:text="@string/meal_lunch"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
Expand Down Expand Up @@ -505,7 +505,7 @@
android:layout_margin="2dp"
android:background="#eff3ff"
android:gravity="center"
android:text="Dinner"
android:text="@string/meal_dinner"
android:textSize="20sp"
android:textStyle="bold"
app:layout_constraintStart_toStartOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/dateitem.xml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
android:layout_width="match_parent"
android:layout_height="20dp"
android:gravity="center"
android:text="Day"
android:text="@string/day"
android:textColor="@color/food"
android:textSize="10sp"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/edit_dialog.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@
android:layout_height="50dp"
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.


app:cornerRadius="10dp"

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
android:layout_height="50dp"
android:layout_margin="25dp"
android:backgroundTint="@color/food"
android:text="Done"
android:text="@string/done"
android:textColor="@color/white"
app:cornerRadius="5dp"
app:layout_constraintTop_toBottomOf="@id/tilBatch" />
Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/layout/fragment_edit_complete.xml
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
android:layout_marginVertical="25dp"
android:backgroundTint="@color/white"
android:drawableEnd="@drawable/baseline_send_24"
android:text="Send Menu for Approoval"
android:text="@string/menu_approval"
android:textColor="@color/food"
app:cornerRadius="15dp"
app:layout_constraintEnd_toEndOf="parent"
Expand Down
Loading