localize Scribe-Server API messages for Android (#112)#624
Conversation
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.
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:
Note Scribe uses Conventional Comments in reviews to make sure that communication is as clear as possible. |
Maintainer ChecklistThe 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 :)
|
|
Thanks so much for the full work here for the Android app, @prince-0408! @angrezichatterbox, can you take a first look here? |
|
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 :) |
|
@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 😊 |
Will take a look into it today |
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
app/src/main/assets/i18n): Updated pointer to commita6ae352onscribe-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: AddedformatStringWithParams()to resolve{placeholder}tokens in localization templates outside Composable contexts (e.g. ViewModels).DynamicDbHelper.kt: Now catches and re-throwsSQLiteExceptionso ViewModels can handle database-specific errors and display localized messages.3. Localized Messages & UI
DataDownloadViewModel.kt&ConjugateDataDownloadViewModel.kt— localized all 7 Toast messages:i18n.app.download.error.networki18n.app.download.error.databasei18n.app.download.error.serveri18n.app.download.error.timeouti18n.app.download.menu_ui.download_data.already_up_to_datei18n.app.download.menu_ui.download_data.generic_already_up_to_datei18n.app.download.menu_ui.download_data.download_successSelectLanguageScreen.kt: Localized the download confirmation dialog warning and source language button.DataDownloadScreen.kt&ConjugateDownloadDataScreen.kt: Localized the "Update all" button.