Skip to content

[i18n] add Arabic localization#350

Merged
capcom6 merged 2 commits intomasterfrom
res/add-arabic-locale
Apr 23, 2026
Merged

[i18n] add Arabic localization#350
capcom6 merged 2 commits intomasterfrom
res/add-arabic-locale

Conversation

@capcom6
Copy link
Copy Markdown
Owner

@capcom6 capcom6 commented Apr 10, 2026

Summary by CodeRabbit

  • New Features

    • App-level language support with persisted selection and applied immediately across the app and activities (supports "system/default" option).
  • Localization

    • Full Arabic translation bundle added.
    • Russian and Chinese strings updated with "Language" / "System default".
  • UI

    • Language selector added to Settings (with icon); changing language restarts UI to apply it.
  • Assets

    • New language icon and language arrays/resources included.

@github-actions
Copy link
Copy Markdown
Contributor

github-actions Bot commented Apr 10, 2026

🤖 Pull request artifacts

file commit
app-release.apk 29bbddf
app-release.aab 29bbddf
app-insecure.apk 29bbddf
app-insecure.aab 29bbddf

@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: f55065fb-d10a-4d54-974c-65bf6bccd779

📥 Commits

Reviewing files that changed from the base of the PR and between 2691710 and 29bbddf.

📒 Files selected for processing (12)
  • app/src/main/java/me/capcom/smsgateway/App.kt
  • app/src/main/java/me/capcom/smsgateway/MainActivity.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt
  • app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt
  • app/src/main/res/drawable/ic_language.xml
  • app/src/main/res/values-ar/strings.xml
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values-zh/strings.xml
  • app/src/main/res/values/arrays.xml
  • app/src/main/res/values/strings.xml
  • app/src/main/res/xml/root_preferences.xml
✅ Files skipped from review due to trivial changes (5)
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/drawable/ic_language.xml
  • app/src/main/res/xml/root_preferences.xml
  • app/src/main/res/values/arrays.xml
  • app/src/main/res/values/strings.xml
🚧 Files skipped from review as they are similar to previous changes (6)
  • app/src/main/java/me/capcom/smsgateway/App.kt
  • app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt
  • app/src/main/res/values-zh/strings.xml
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/res/values-ar/strings.xml

Walkthrough

Adds runtime locale selection: new LocaleHelper to persist/apply chosen language; App and MainActivity attachBaseContext delegate to LocaleHelper; SettingsFragment ListPreference to change language and restart MainActivity; SettingsHelper persists language; new arrays, strings (base, ru, zh, ar), and language drawable added.

Changes

Cohort / File(s) Summary
Locale helper
app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
New LocaleHelper with onAttach(context) and setLocale(context, language) that reads/writes app.language, computes target Locale, sets Locale.setDefault, updates Configuration, and returns a configuration-scoped Context.
Application & Activity
app/src/main/java/me/capcom/smsgateway/App.kt, app/src/main/java/me/capcom/smsgateway/MainActivity.kt
Both now override attachBaseContext(...) to pass the incoming context through LocaleHelper.onAttach(...) before calling super.attachBaseContext(...).
Settings UI & wiring
app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt, app/src/main/res/xml/root_preferences.xml
Added ListPreference app.language; change listener calls LocaleHelper.setLocale(...), restarts MainActivity with `FLAG_ACTIVITY_CLEAR_TOP
Persistent setting
app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt
Added persisted property var language: String backed by APP_LANGUAGE = "app.language"; getter normalizes null/"system""", setter persists value. Removed unused PREF_KEY_FCM_TOKEN.
Resource arrays & base/ru strings
app/src/main/res/values/arrays.xml, app/src/main/res/values/strings.xml, app/src/main/res/values-ru/strings.xml
Added language_entries / language_values arrays; added language and language_system strings in base and Russian resources.
Arabic localization
app/src/main/res/values-ar/strings.xml
New Arabic strings.xml with many localized strings and a plural review_incoming_sms_webhooks.
Chinese strings updated
app/src/main/res/values-zh/strings.xml
Updated api_url* wording, added language/language_system, and reordered entries (values changed for API URL strings as noted).
Drawable
app/src/main/res/drawable/ic_language.xml
New vector drawable used as the language preference icon.

Sequence Diagram

sequenceDiagram
    participant User as User
    participant Prefs as SettingsFragment
    participant Locale as LocaleHelper
    participant SP as SettingsHelper/SharedPreferences
    participant Main as MainActivity
    participant App as Application

    User->>Prefs: select language in ListPreference
    Prefs->>Locale: setLocale(context, language)
    Locale->>SP: write `app.language`
    Locale->>Locale: compute Locale, Locale.setDefault(...)
    Prefs->>Main: start MainActivity (CLEAR_TOP | NEW_TASK)
    Prefs->>Prefs: finish()
    Main->>Locale: attachBaseContext(newBase) -> onAttach
    Locale->>SP: read `app.language`
    Locale->>Main: return configured Context
    App->>Locale: attachBaseContext at app startup
Loading

Estimated code review effort

🎯 3 (Moderate) | ⏱️ ~25 minutes

Possibly related PRs

  • #341: Direct overlap — also adds LocaleHelper, overrides attachBaseContext in App/MainActivity, and wires settings/strings for language selection.
  • #252: Edits values-zh/strings.xml; overlaps with the Chinese strings updates in this change.
🚥 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
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title accurately describes the primary change: adding Arabic localization support via the new values-ar/strings.xml file and related locale infrastructure.

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

✨ Finishing Touches
📝 Generate docstrings
  • Create stacked PR
  • Commit on current branch
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Commit unit tests in branch res/add-arabic-locale

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

@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: 2

🧹 Nitpick comments (2)
app/src/main/java/me/capcom/smsgateway/App.kt (1)

37-37: Remove the redundant LocaleHelper.onAttach(this) call in onCreate.

Line 37 repeats locale attachment after attachBaseContext already handled it, and the returned Context is ignored.

Proposed cleanup
     override fun onCreate() {
         super.onCreate()
-        LocaleHelper.onAttach(this)
 
         startKoin {
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/me/capcom/smsgateway/App.kt` at line 37, Remove the
redundant LocaleHelper.onAttach(this) call inside the App.onCreate method;
attachBaseContext already calls LocaleHelper.onAttach and returns the adjusted
Context, so delete the extra invocation in onCreate (the line calling
LocaleHelper.onAttach(this)) to avoid a duplicate/no-op call while leaving
attachBaseContext and its LocaleHelper usage intact.
app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt (1)

37-37: Consider using Locale.forLanguageTag(...) for forward-compatibility with region/script variants.

Currently, language values are simple 2-letter codes ("en", "ar", "ru", "zh"), which work correctly with Locale(language). However, if the supported languages expand to include region or script tags (e.g., "en-US", "pt-BR"), Locale(language) will not parse them correctly—it will treat the entire string as the language field. Locale.forLanguageTag(...) handles BCP-47 tags properly and would be more robust for this use case.

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

In `@app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt` at line 37,
The locale construction using Locale(language) in LocaleHelper (the locale
variable assignment) won’t parse BCP-47 tags like "en-US" correctly; replace it
with Locale.forLanguageTag(language) when language is non-empty (and keep
Locale.getDefault() fallback) so region/script variants are handled robustly by
the code that constructs the locale.
🤖 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/me/capcom/smsgateway/helpers/LocaleHelper.kt`:
- Around line 11-23: Change the fallback behavior so the app can preserve a
"system default" option: in onAttach(...) use an empty string "" as the fallback
when calling getPersistedData instead of Locale.getDefault().language; when you
need the actual device/system locale (not the app's current Locale), obtain it
via Resources.getSystem().configuration.locales[0]; construct locales from
stored language tags using Locale.forLanguageTag(...) rather than Locale(String)
so both empty (system) and concrete values are handled robustly; ensure
setLocale(...) / persist(...) only writes concrete language tags (non-empty) and
that updateResources(...) uses the system-locale from Resources.getSystem() when
the stored language is empty.

In `@app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt`:
- Around line 38-44: The language change handler in SettingsFragment uses
findPreference and its OnPreferenceChangeListener to restart MainActivity before
the new language is persisted; update the listener to immediately persist/apply
the selected locale by calling LocaleHelper.setLocale(requireContext(), newValue
as String) (or equivalent) inside the listener before creating the Intent to
restart MainActivity, then restart via MainActivity Intent and finish the
activity so the restarted activity reads the updated locale.

---

Nitpick comments:
In `@app/src/main/java/me/capcom/smsgateway/App.kt`:
- Line 37: Remove the redundant LocaleHelper.onAttach(this) call inside the
App.onCreate method; attachBaseContext already calls LocaleHelper.onAttach and
returns the adjusted Context, so delete the extra invocation in onCreate (the
line calling LocaleHelper.onAttach(this)) to avoid a duplicate/no-op call while
leaving attachBaseContext and its LocaleHelper usage intact.

In `@app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt`:
- Line 37: The locale construction using Locale(language) in LocaleHelper (the
locale variable assignment) won’t parse BCP-47 tags like "en-US" correctly;
replace it with Locale.forLanguageTag(language) when language is non-empty (and
keep Locale.getDefault() fallback) so region/script variants are handled
robustly by the code that constructs the locale.
🪄 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: f6336479-1579-4aa6-8e72-1a4579725afa

📥 Commits

Reviewing files that changed from the base of the PR and between 4d6169b and bb22397.

📒 Files selected for processing (9)
  • app/src/main/java/me/capcom/smsgateway/App.kt
  • app/src/main/java/me/capcom/smsgateway/MainActivity.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt
  • app/src/main/res/values-ar/strings.xml
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values/arrays.xml
  • app/src/main/res/values/strings.xml
  • app/src/main/res/xml/root_preferences.xml

Comment thread app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
Comment thread app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt Outdated
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.

🧹 Nitpick comments (1)
app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt (1)

31-36: Consider normalizing empty string sentinel in language getter for better encapsulation.

The language_values array contains an empty string ("") as a sentinel. While LocaleHelper.updateResources() already handles this case with an explicit isEmpty() check, normalizing the sentinel at the SettingsHelper level would be cleaner and reduce coupling between the components.

Suggested refactor
 var language: String
-    get() = settings.getString(APP_LANGUAGE, Locale.getDefault().language)
-        ?: Locale.getDefault().language
+    get() {
+        val stored = settings.getString(APP_LANGUAGE, null)
+        return when (stored) {
+            null, "", "system" -> Locale.getDefault().language
+            else -> stored
+        }
+    }
     set(value) = settings.edit(true) {
         putString(APP_LANGUAGE, value)
     }
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt` around
lines 31 - 36, The language getter in SettingsHelper should normalize the
empty-string sentinel stored under APP_LANGUAGE so callers don't need to handle
it: update the language property's getter (var language: String) to retrieve
settings.getString(APP_LANGUAGE, null) and if the result is null or isEmpty()
return Locale.getDefault().language; keep the setter as-is. This centralizes
handling of the "" sentinel used by language_values and avoids coupling with
LocaleHelper.updateResources.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Nitpick comments:
In `@app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt`:
- Around line 31-36: The language getter in SettingsHelper should normalize the
empty-string sentinel stored under APP_LANGUAGE so callers don't need to handle
it: update the language property's getter (var language: String) to retrieve
settings.getString(APP_LANGUAGE, null) and if the result is null or isEmpty()
return Locale.getDefault().language; keep the setter as-is. This centralizes
handling of the "" sentinel used by language_values and avoids coupling with
LocaleHelper.updateResources.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 51bc6d1b-1971-42e9-b066-7cd72730977d

📥 Commits

Reviewing files that changed from the base of the PR and between 65b307c and 50b83d0.

📒 Files selected for processing (5)
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt
  • app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt
  • app/src/main/res/drawable/ic_language.xml
  • app/src/main/res/xml/root_preferences.xml
✅ Files skipped from review due to trivial changes (1)
  • app/src/main/res/drawable/ic_language.xml
🚧 Files skipped from review as they are similar to previous changes (2)
  • app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt

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: 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 `@app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt`:
- Around line 31-40: The getter for the language property currently maps stored
"" and "system" to Locale.getDefault().language, which causes
LocaleHelper.setLocale(...) to persist a fixed locale and lose dynamic system
behavior; change the logic in the language getter (property in SettingsHelper)
so only null falls back to Locale.getDefault().language while returning the raw
stored value for "" and "system" (i.e., if stored is null ->
Locale.getDefault().language, else return stored) so the "system" preference is
preserved and not rewritten.
🪄 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: 8d0ca1ff-abbe-40c3-bb1d-faa29a5c675e

📥 Commits

Reviewing files that changed from the base of the PR and between 50b83d0 and 1d2d059.

📒 Files selected for processing (2)
  • app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt
  • app/src/main/res/values-zh/strings.xml

Comment thread app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt
@capcom6 capcom6 force-pushed the res/add-arabic-locale branch from c2dda7a to d96c124 Compare April 11, 2026 09:47
@capcom6 capcom6 added the ready label Apr 12, 2026
@capcom6 capcom6 force-pushed the res/add-arabic-locale branch from d96c124 to 2b1dbc2 Compare April 14, 2026 01:18
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: 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 `@app/src/main/res/values-ar/strings.xml`:
- Line 96: Update the Arabic translation for the string resource named
settings_start_on_boot: replace the current value "بدء التشغيل عند بناء النظام"
with a more accurate phrase for "start on boot", e.g. "بدء التشغيل عند إقلاع
النظام", so the string XML entry for settings_start_on_boot reflects the correct
Arabic wording.
🪄 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: 3efc4d0e-7172-4360-9140-0241dc95c67f

📥 Commits

Reviewing files that changed from the base of the PR and between d96c124 and 2b1dbc2.

📒 Files selected for processing (12)
  • app/src/main/java/me/capcom/smsgateway/App.kt
  • app/src/main/java/me/capcom/smsgateway/MainActivity.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt
  • app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt
  • app/src/main/res/drawable/ic_language.xml
  • app/src/main/res/values-ar/strings.xml
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values-zh/strings.xml
  • app/src/main/res/values/arrays.xml
  • app/src/main/res/values/strings.xml
  • app/src/main/res/xml/root_preferences.xml
✅ Files skipped from review due to trivial changes (5)
  • app/src/main/res/values/strings.xml
  • app/src/main/res/drawable/ic_language.xml
  • app/src/main/java/me/capcom/smsgateway/App.kt
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values/arrays.xml
🚧 Files skipped from review as they are similar to previous changes (3)
  • app/src/main/res/xml/root_preferences.xml
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/res/values-zh/strings.xml

Comment thread app/src/main/res/values-ar/strings.xml Outdated
@capcom6 capcom6 force-pushed the res/add-arabic-locale branch from 2b1dbc2 to fbfa117 Compare April 15, 2026 01:59
@github-actions github-actions Bot removed the ready label Apr 15, 2026
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: 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 `@app/src/main/res/values-ar/strings.xml`:
- Around line 137-139: The Arabic resource strings incoming_sms_messages,
incoming_data_messages, and incoming_mms_messages are still in English; update
their values to proper Arabic translations while preserving the integer
placeholder (%1$d) and order (do not alter %1$d token), and ensure the
translations are natural and RTL-friendly (e.g., use appropriate Arabic words
for "SMS", "Data SMS", and "MMS"); edit the values of string
name="incoming_sms_messages", string name="incoming_data_messages", and string
name="incoming_mms_messages" in the Arabic strings.xml accordingly.
🪄 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: cabd6acf-2029-448a-9a05-cad74e5ee5b2

📥 Commits

Reviewing files that changed from the base of the PR and between 2b1dbc2 and fbfa117.

📒 Files selected for processing (12)
  • app/src/main/java/me/capcom/smsgateway/App.kt
  • app/src/main/java/me/capcom/smsgateway/MainActivity.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt
  • app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt
  • app/src/main/res/drawable/ic_language.xml
  • app/src/main/res/values-ar/strings.xml
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values-zh/strings.xml
  • app/src/main/res/values/arrays.xml
  • app/src/main/res/values/strings.xml
  • app/src/main/res/xml/root_preferences.xml
✅ Files skipped from review due to trivial changes (5)
  • app/src/main/res/values/strings.xml
  • app/src/main/res/drawable/ic_language.xml
  • app/src/main/java/me/capcom/smsgateway/App.kt
  • app/src/main/res/xml/root_preferences.xml
  • app/src/main/res/values/arrays.xml
🚧 Files skipped from review as they are similar to previous changes (3)
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt

Comment on lines +137 to +139
<string name="incoming_sms_messages">SMS: %1$d</string>
<string name="incoming_data_messages">Data SMS: %1$d</string>
<string name="incoming_mms_messages">MMS: %1$d</string>
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 | 🟡 Minor

Localize incoming message type labels for Arabic consistency.

Lines 137-139 are still partially/fully English, which creates mixed-language UI in the Arabic locale.

Suggested fix
-    <string name="incoming_sms_messages">SMS: %1$d</string>
-    <string name="incoming_data_messages">Data SMS: %1$d</string>
-    <string name="incoming_mms_messages">MMS: %1$d</string>
+    <string name="incoming_sms_messages">رسائل SMS: %1$d</string>
+    <string name="incoming_data_messages">رسائل بيانات SMS: %1$d</string>
+    <string name="incoming_mms_messages">رسائل MMS: %1$d</string>
📝 Committable suggestion

‼️ IMPORTANT
Carefully review the code before committing. Ensure that it accurately replaces the highlighted code, contains no missing lines, and has no issues with indentation. Thoroughly test & benchmark the code to ensure it meets the requirements.

Suggested change
<string name="incoming_sms_messages">SMS: %1$d</string>
<string name="incoming_data_messages">Data SMS: %1$d</string>
<string name="incoming_mms_messages">MMS: %1$d</string>
<string name="incoming_sms_messages">رسائل SMS: %1$d</string>
<string name="incoming_data_messages">رسائل بيانات SMS: %1$d</string>
<string name="incoming_mms_messages">رسائل MMS: %1$d</string>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/values-ar/strings.xml` around lines 137 - 139, The Arabic
resource strings incoming_sms_messages, incoming_data_messages, and
incoming_mms_messages are still in English; update their values to proper Arabic
translations while preserving the integer placeholder (%1$d) and order (do not
alter %1$d token), and ensure the translations are natural and RTL-friendly
(e.g., use appropriate Arabic words for "SMS", "Data SMS", and "MMS"); edit the
values of string name="incoming_sms_messages", string
name="incoming_data_messages", and string name="incoming_mms_messages" in the
Arabic strings.xml accordingly.

@capcom6 capcom6 force-pushed the res/add-arabic-locale branch from fbfa117 to d0fc499 Compare April 16, 2026 01:46
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.

♻️ Duplicate comments (1)
app/src/main/res/values-ar/strings.xml (1)

137-139: ⚠️ Potential issue | 🟡 Minor

Localize incoming message type counters to avoid mixed-language Arabic UI.

Lines 137-139 are still English/partially English, which breaks Arabic locale consistency.

Suggested fix
-    <string name="incoming_sms_messages">SMS: %1$d</string>
-    <string name="incoming_data_messages">Data SMS: %1$d</string>
-    <string name="incoming_mms_messages">MMS: %1$d</string>
+    <string name="incoming_sms_messages">رسائل SMS: %1$d</string>
+    <string name="incoming_data_messages">رسائل بيانات SMS: %1$d</string>
+    <string name="incoming_mms_messages">رسائل MMS: %1$d</string>
🤖 Prompt for AI Agents
Verify each finding against the current code and only fix it if needed.

In `@app/src/main/res/values-ar/strings.xml` around lines 137 - 139, The three
string resources incoming_sms_messages, incoming_data_messages, and
incoming_mms_messages in values-ar/strings.xml are still in English; replace
their text with proper Arabic translations while preserving the numeric format
specifier (%1$d) and punctuation/spacing (e.g., "رسائل SMS: %1$d" or preferred
Arabic phrasing) so the Arabic locale shows fully localized labels for SMS, Data
SMS and MMS counters.
🤖 Prompt for all review comments with AI agents
Verify each finding against the current code and only fix it if needed.

Duplicate comments:
In `@app/src/main/res/values-ar/strings.xml`:
- Around line 137-139: The three string resources incoming_sms_messages,
incoming_data_messages, and incoming_mms_messages in values-ar/strings.xml are
still in English; replace their text with proper Arabic translations while
preserving the numeric format specifier (%1$d) and punctuation/spacing (e.g.,
"رسائل SMS: %1$d" or preferred Arabic phrasing) so the Arabic locale shows fully
localized labels for SMS, Data SMS and MMS counters.

ℹ️ Review info
⚙️ Run configuration

Configuration used: Organization UI

Review profile: CHILL

Plan: Pro

Run ID: 11a612ec-30e8-47e2-99c9-d889712a82c7

📥 Commits

Reviewing files that changed from the base of the PR and between fbfa117 and d0fc499.

📒 Files selected for processing (12)
  • app/src/main/java/me/capcom/smsgateway/App.kt
  • app/src/main/java/me/capcom/smsgateway/MainActivity.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt
  • app/src/main/java/me/capcom/smsgateway/ui/SettingsFragment.kt
  • app/src/main/res/drawable/ic_language.xml
  • app/src/main/res/values-ar/strings.xml
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values-zh/strings.xml
  • app/src/main/res/values/arrays.xml
  • app/src/main/res/values/strings.xml
  • app/src/main/res/xml/root_preferences.xml
✅ Files skipped from review due to trivial changes (5)
  • app/src/main/java/me/capcom/smsgateway/App.kt
  • app/src/main/res/values/strings.xml
  • app/src/main/res/drawable/ic_language.xml
  • app/src/main/res/values-ru/strings.xml
  • app/src/main/res/values/arrays.xml
🚧 Files skipped from review as they are similar to previous changes (4)
  • app/src/main/res/xml/root_preferences.xml
  • app/src/main/java/me/capcom/smsgateway/MainActivity.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/LocaleHelper.kt
  • app/src/main/java/me/capcom/smsgateway/helpers/SettingsHelper.kt

@capcom6 capcom6 force-pushed the res/add-arabic-locale branch from d0fc499 to 2691710 Compare April 16, 2026 11:01
@capcom6 capcom6 added the ready label Apr 17, 2026
@capcom6 capcom6 force-pushed the res/add-arabic-locale branch from 2691710 to 29bbddf Compare April 20, 2026 02:52
@github-actions github-actions Bot removed the ready label Apr 20, 2026
@capcom6 capcom6 merged commit caf8fd4 into master Apr 23, 2026
4 checks passed
@capcom6 capcom6 deleted the res/add-arabic-locale branch April 23, 2026 01:33
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.

2 participants