Skip to content

localize Scribe-Server API messages for Android (#112)#624

Open
prince-0408 wants to merge 4 commits into
scribe-org:mainfrom
prince-0408:feat/android-server-localization-112
Open

localize Scribe-Server API messages for Android (#112)#624
prince-0408 wants to merge 4 commits into
scribe-org:mainfrom
prince-0408:feat/android-server-localization-112

Conversation

@prince-0408

Copy link
Copy Markdown
Contributor

Goal

Implements localized user-facing messages for all Scribe-Server API interactions in the Android app, using the newly merged localization keys from Scribe-i18n (#115). Also updates the submodule pointer and syncs translated resources, including the completed Nepali translations from #113.


Changes

1. Submodule & Resource Sync

  • Scribe-i18n submodule (app/src/main/assets/i18n): Updated pointer to commit a6ae352 on scribe-org:main, which includes the merged server localization keys and completed Nepali translations.
  • values-ne/strings.xml: Synced with the updated submodule to import the completed Nepali (ne) translations.

2. Core Helpers

  • StringUtils.kt: Added formatStringWithParams() to resolve {placeholder} tokens in localization templates outside Composable contexts (e.g. ViewModels).
  • DynamicDbHelper.kt: Now catches and re-throws SQLiteException so ViewModels can handle database-specific errors and display localized messages.

3. Localized Messages & UI

DataDownloadViewModel.kt & ConjugateDataDownloadViewModel.kt — localized all 7 Toast messages:

Key Message
i18n.app.download.error.network Network error
i18n.app.download.error.database Database error
i18n.app.download.error.server Server error
i18n.app.download.error.timeout Timeout
i18n.app.download.menu_ui.download_data.already_up_to_date Already up to date
i18n.app.download.menu_ui.download_data.generic_already_up_to_date Generic already up to date
i18n.app.download.menu_ui.download_data.download_success Download success

SelectLanguageScreen.kt: Localized the download confirmation dialog warning and source language button.

DataDownloadScreen.kt & ConjugateDownloadDataScreen.kt: Localized the "Update all" button.

Implements localized strings for all Scribe-Server API-related
user-facing messages in the Android app, using the new keys
added to Scribe-i18n in scribe-org/Scribe-i18n#115.

Changes:
- DataDownloadViewModel.kt: localized 7 Toast messages
  (network error, database error, server error, timeout,
  already up to date, generic up to date, download success)
- ConjugateDataDownloadViewModel.kt: localized 7 Toast messages
  with conjugate-specific keys where applicable
- DataDownloadScreen.kt: 'Update all' button text localized
- ConjugateDownloadDataScreen.kt: 'Update all' button text localized
- SelectLanguageScreen.kt: confirmation dialog strings localized
  (download warning and keep source language button)
- DynamicDbHelper.kt: re-throws SQLiteException so ViewModels
  can catch and display localized database error messages
- StringUtils.kt: added formatStringWithParams() helper for
  template string interpolation outside Composable scope
- string.xml: added 14 new resource keys synced from i18n submodule

Note: i18n submodule pointer will be updated to the merged
scribe-org/Scribe-i18n#115 commit in a follow-up.
@github-actions

Copy link
Copy Markdown

Thank you for the pull request! 💙🩵

The Scribe-Android team will do our best to address your contribution as soon as we can. The following are some important points:

  • Those interested in developing their skills and expanding their role in the community should read the mentorship and growth section of the contribution guide
  • If you're not already a member of our public Matrix community, please consider joining!
    • We'd suggest that you use the Element client as well as Element X for a mobile app
    • Join the General and Android rooms once you're in
  • Also consider attending our bi-weekly Saturday developer syncs!
    • Details are shared in the General room on Matrix each Wednesday before the sync
    • It would be great to meet you 😊

Note

Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible.

@github-actions

Copy link
Copy Markdown

Maintainer Checklist

The following is a checklist for maintainers to make sure this process goes as well as possible. Feel free to address the points below yourself in further commits if you realize that actions are needed :)

  • Tests for changes have been written and the unit test, linting and formatting workflows within the PR checks do not indicate new errors in the files changed

    • Tests may need to be reran as they're at times not deterministic
  • The CHANGELOG has been updated with a description of the changes for the upcoming release and the corresponding issue (if necessary)

@andrewtavis

Copy link
Copy Markdown
Member

Thanks so much for the full work here for the Android app, @prince-0408! @angrezichatterbox, can you take a first look here?

@andrewtavis

Copy link
Copy Markdown
Member

Or @DeleMike, could you also do an initial review? I'll try to look into this tomorrow before the sync, or maybe we could check it during the sync :)

@andrewtavis

Copy link
Copy Markdown
Member

@prince-0408, there are also new changes to Scribe-i18n that could be added to this PR. I noticed them when reviewing #625. You can see the details here, with the Scribe-i18n changes being the first point. You'd be welcome to do any of those minor changes, but just communicate to @angrezichatterbox if you plan on doing any of them 😊

@angrezichatterbox

Copy link
Copy Markdown
Member

Thanks so much for the full work here for the Android app, @prince-0408! @angrezichatterbox, can you take a first look here?

Will take a look into it today

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

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants