mirror of
https://github.com/austinried/subtracks.git
synced 2026-11-10 15:11:58 +01:00
address review: localize connection errors, tighten i18n guard, drop dead resources
- AddSourceViewModel resolves SubsonicException.uiMessage too, so malformed/ HTTP/truncated responses show localized text instead of the raw parser message; add a regression test. - StringResourcesTest now requires an 'other' quantity in every plural and asserts exact placeholder (index and conversion) equality, both of which could previously pass while crashing getQuantityString at runtime. - Map the pre-enum song_downloads.error sentences back to their DownloadError so existing failed rows keep their specific message. - Localize the media-session star/unstar button label. - Remove 12 unreferenced resources (queue name, filter year, sync_failed, and the unused codec_* strings; codec labels stay in AudioEncoding). - Make buildTree's fallback arguments required; only tests used the defaults.
This commit is contained in:
@@ -146,7 +146,7 @@ Resource names are `snake_case`. They were derived once from the old Flutter ARB
|
||||
|
||||
Per-app language selection (Android 13+) is generated by AGP: `androidResources.generateLocaleConfig = true` with `res/resources.properties` supplying the default locale. `StringResourcesTest` guards the translations: every locale resource must exist in the default with the same kind and no placeholder the default lacks, which is what caught a duplicated `{value}` in the Thai ARB during migration.
|
||||
|
||||
Text produced below the UI is typed, not free-form English. Repositories, `SyncManager` and playback report a `UiMessage` (a string-resource id plus format args) through `showMessage`, and the UI resolves it in the current locale; `SyncStatus.Failed` carries one too. Subsonic and playback failures set a localized `UiMessage` on the exception (the raw message stays as the developer detail/log text), and the download progress notification is formatted from resources. Persisted download failures are also typed: `SongDownload.error` is a `DownloadError` enum mapped to `@StringRes` and stored by name (unknown legacy values degrade to `DownloadError.Failed`), so `SongInfoDialog` resolves it in the current locale. The remaining non-localized strings are internal invariants and log tags that are never shown.
|
||||
Text produced below the UI is typed, not free-form English. Repositories, `SyncManager` and playback report a `UiMessage` (a string-resource id plus format args) through `showMessage`, and the UI resolves it in the current locale; `SyncStatus.Failed` carries one too. Subsonic and playback failures set a localized `UiMessage` on the exception (the raw message stays as the developer detail/log text), and the download progress notification is formatted from resources. Persisted download failures are also typed: `SongDownload.error` is a `DownloadError` enum mapped to `@StringRes` and stored by name (rows written before the enum are mapped back to their error, and anything unrecognized degrades to `DownloadError.Failed`), so `SongInfoDialog` resolves it in the current locale. The remaining non-localized strings are internal invariants and log tags that are never shown.
|
||||
|
||||
## Security and privacy
|
||||
|
||||
|
||||
Reference in New Issue
Block a user