Internationalization: string resources + Dutch translation; v0.3.0
All checks were successful
Build APK / build (push) Successful in 5m55s
All checks were successful
Build APK / build (push) Successful in 5m55s
Move all user-facing strings into res/values/strings.xml (English base) and add res/values-nl/strings.xml (Dutch). Composables use stringResource; coroutine-set and non-composable strings (ViewModel, PaperlessClient) resolve via Context.getString. Mark app_name translatable=false. Bump to 0.3.0. Fixes #5 Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -115,9 +115,11 @@ class ScanViewModel(app: Application) : AndroidViewModel(app) {
|
||||
val s = settings.value
|
||||
val token = settingsRepo.getToken()
|
||||
if (s.paperlessUrl.isBlank() || token.isNullOrBlank()) {
|
||||
return PaperlessClient.Result.Failure("Paperless isn't set up yet (URL + token).")
|
||||
return PaperlessClient.Result.Failure(
|
||||
getApplication<Application>().getString(R.string.err_paperless_not_setup)
|
||||
)
|
||||
}
|
||||
return PaperlessClient(s.paperlessUrl, token).upload(pdf, title)
|
||||
return PaperlessClient(s.paperlessUrl, token, getApplication<Application>()).upload(pdf, title)
|
||||
}
|
||||
|
||||
// --- Settings pass-throughs (SettingsScreen) ---
|
||||
@@ -133,9 +135,11 @@ class ScanViewModel(app: Application) : AndroidViewModel(app) {
|
||||
|
||||
suspend fun testPaperless(url: String, token: String): PaperlessClient.Result {
|
||||
if (url.isBlank() || token.isBlank()) {
|
||||
return PaperlessClient.Result.Failure("Enter a URL and token first.")
|
||||
return PaperlessClient.Result.Failure(
|
||||
getApplication<Application>().getString(R.string.err_enter_url_token)
|
||||
)
|
||||
}
|
||||
return PaperlessClient(url.trim(), token.trim()).testConnection()
|
||||
return PaperlessClient(url.trim(), token.trim(), getApplication<Application>()).testConnection()
|
||||
}
|
||||
|
||||
fun clearSession() {
|
||||
|
||||
Reference in New Issue
Block a user