From 257ed6b5bb606a8a77c4d0274edd291d21867a60 Mon Sep 17 00:00:00 2001 From: Simon Hagen Date: Tue, 18 Nov 2025 16:06:08 +0100 Subject: [PATCH] [MWA-5224] Erweiterung der Demo-App um weitere Sprachen --- .../metaplugindemo/MainActivity.kt | 17 +++++++++++------ app/src/main/res/values-de/strings.xml | 6 ++++++ app/src/main/res/values-es/strings.xml | 6 ++++++ app/src/main/res/values-fr/strings.xml | 6 ++++++ app/src/main/res/values-it/strings.xml | 6 ++++++ app/src/main/res/values-nl/strings.xml | 6 ++++++ app/src/main/res/values-pl/strings.xml | 6 ++++++ app/src/main/res/values-ro/strings.xml | 6 ++++++ app/src/main/res/values-tr/strings.xml | 6 ++++++ app/src/main/res/values/strings.xml | 6 ++++++ 10 files changed, 65 insertions(+), 6 deletions(-) diff --git a/app/src/main/java/de/webidsolutions/metaplugindemo/MainActivity.kt b/app/src/main/java/de/webidsolutions/metaplugindemo/MainActivity.kt index caef0b4..f2580af 100644 --- a/app/src/main/java/de/webidsolutions/metaplugindemo/MainActivity.kt +++ b/app/src/main/java/de/webidsolutions/metaplugindemo/MainActivity.kt @@ -184,6 +184,8 @@ internal class MainActivity : ComponentActivity return { result -> if (result.errorResult == EApiResult.SUCCESS) { + writeLog(getString(R.string.verification_successful)) + var verifyActionIdResult = result.result try { when (themingChoice) { ThemingChoice.XML -> { @@ -205,30 +207,32 @@ internal class MainActivity : ComponentActivity } } catch (e: WebIdMobileAppSdkException) { e.printStackTrace() - showResult(e.message.toString()) + showResult(getString(R.string.start_failed) + e.message.toString()) } } else { val metaPluginVerifyError = result.errorResult - showResult(metaPluginVerifyError.toString()) + showResult(getString(R.string.verification_failed) + metaPluginVerifyError.toString()) } } } private fun onPluginResultCallback(activityResult: ActivityResult) { + val metaPluginActivityResult = activityResult var result: String? try { // Get data and handle potential null case // If data is null, plugin was interrupted - val data: Intent = activityResult.data ?: throw WebIdPluginInterruptedException() + val data: Intent = metaPluginActivityResult.data ?: throw WebIdPluginInterruptedException() // Retrieve the plugin result and handle any errors val pluginResult: ProductPluginResult<*> = getProductPluginResult( - data, activityResult.resultCode + data, metaPluginActivityResult.resultCode ) val resultInfo: String? = pluginResult.info val failReason: ProductPluginErrorResult<*>? = pluginResult.error // Successful plugin execution if (failReason == null) { - result = "Success" + writeLog(getString(R.string.product_journey_finished_successfully) + "\n") + result = getString(R.string.success) if (resultInfo != null) { result += " $resultInfo" // your code to handle the successful plugin execution @@ -236,6 +240,7 @@ internal class MainActivity : ComponentActivity showResult(result) } else { // failure case + writeLog(getString(R.string.product_journey_finished_with_failure)) if (failReason.specificResult != null) { val specificResult: IEPluginError? = failReason.specificResult as IEPluginError? @@ -272,7 +277,7 @@ internal class MainActivity : ComponentActivity } } catch (e: WebIdPluginInterruptedException) { // Handle interruption in your preferred way - showResult("Plugin interrupted: ${e.message}") + writeLog(getString(R.string.product_journey_finished_with_failure) + "\n" + e.toString()) } } diff --git a/app/src/main/res/values-de/strings.xml b/app/src/main/res/values-de/strings.xml index 4556aae..f106df5 100644 --- a/app/src/main/res/values-de/strings.xml +++ b/app/src/main/res/values-de/strings.xml @@ -9,6 +9,12 @@ Core SDK erfolgreich erstellt Validiere Vorgangsnummer… Fehler: Die Vorgangsnummer (Action-ID) wurde in der Datei „MainActivity.kt“ nicht auf eine 9-stellige Zahlenfolge gesetzt. + Überprüfung erfolgreich + Überprüfung fehlgeschlagen: + Start fehlgeschlagen:\n + Die Product Journey wurde erfolgreich abgeschlossen + Die Product Journey endete mit Misserfolg: + "Erfolg: " Theme auswählen: Theme mit Compose Theme mit XML diff --git a/app/src/main/res/values-es/strings.xml b/app/src/main/res/values-es/strings.xml index f27b794..9b0d5d8 100644 --- a/app/src/main/res/values-es/strings.xml +++ b/app/src/main/res/values-es/strings.xml @@ -9,6 +9,12 @@ Core SDK creado correctamente Validar número de operación… Error: El número de operación («action-ID») no se ha establecido en una secuencia numérica de 9 dígitos en el archivo «MainActivity.kt». + Verificación correcta + Verificación fallida: + Inicio fallido:\n + La Product Journey se ha completado correctamente + La Product Journey terminó con un error: + "Éxito: " Elige un tema Theming with Compose Theming with XML diff --git a/app/src/main/res/values-fr/strings.xml b/app/src/main/res/values-fr/strings.xml index fc630f1..204f161 100644 --- a/app/src/main/res/values-fr/strings.xml +++ b/app/src/main/res/values-fr/strings.xml @@ -9,6 +9,12 @@ Core SDK créé avec succès Valider le numéro d\'opération… Erreur : le numéro d\'opération (ActionID) n\'a pas été défini sur une séquence de 9 chiffres dans le fichier « MainActivity.kt ». + Vérification réussie + Échec de la vérification : + Échec du démarrage :\n + La Product Journey a été terminée avec succès + La Product Journey s’est terminée par une erreur : + "Succès : " Choisir le thème Theming with Compose Theming with XML diff --git a/app/src/main/res/values-it/strings.xml b/app/src/main/res/values-it/strings.xml index 2b4fcb2..14c1bb6 100644 --- a/app/src/main/res/values-it/strings.xml +++ b/app/src/main/res/values-it/strings.xml @@ -9,6 +9,12 @@ Core SDK creato con successo Convalida numero operazione… Errore: il numero dell\'operazione (ActionID) non è stato impostato su una sequenza di 9 cifre nel file “MainActivity.kt”. + Verifica riuscita + Verifica non riuscita: + Avvio non riuscito:\n + La Product Journey è stata completata con successo + La Product Journey si è conclusa con un errore: + "Successo: " Scegli il tema Theming with Compose Theming with XML diff --git a/app/src/main/res/values-nl/strings.xml b/app/src/main/res/values-nl/strings.xml index 6a0f530..38b0ea2 100644 --- a/app/src/main/res/values-nl/strings.xml +++ b/app/src/main/res/values-nl/strings.xml @@ -9,6 +9,12 @@ Core SDK succesvol aangemaakt Valideer transactienummer… Fout: het actienummer (ActionID) is in het bestand “MainActivity.kt” niet ingesteld op een reeks van 9 cijfers. + Verificatie geslaagd + Verificatie mislukt: + Start mislukt:\n + De Product Journey is met succes voltooid + De Product Journey is met een fout beëindigd: + "Success: " Thema kiezen Theming with Compose Theming with XML diff --git a/app/src/main/res/values-pl/strings.xml b/app/src/main/res/values-pl/strings.xml index 42c8822..22324c7 100644 --- a/app/src/main/res/values-pl/strings.xml +++ b/app/src/main/res/values-pl/strings.xml @@ -9,6 +9,12 @@ Core SDK utworzony pomyślnie Zatwierdź numer operacji… Błąd: Numer operacji (Action-ID) nie został ustawiony na 9-cyfrową sekwencję cyfr w pliku „MainActivity.kt”. + Weryfikacja zakończona sukcesem + Weryfikacja nie powiodła się: + Uruchomienie nie powiodło się:\n + Product Journey została pomyślnie zakończona + Product Journey zakończyła się błędem: + "Sukces: " Wybierz motyw Theming with Compose Theming with XML diff --git a/app/src/main/res/values-ro/strings.xml b/app/src/main/res/values-ro/strings.xml index ae99d76..4dcaa11 100644 --- a/app/src/main/res/values-ro/strings.xml +++ b/app/src/main/res/values-ro/strings.xml @@ -9,6 +9,12 @@ Core SDK creat cu succes Validați numărul operațiunii… Eroare: Numărul operațiunii („Action-ID”) nu a fost setat la o secvență de 9 cifre în fișierul „MainActivity.kt”. + Verificare reușită + Verificarea a eșuat: + Start eșuat:\n + Product Journey a fost finalizată cu succes + Product Journey s-a încheiat cu eroare: + "Succes: " Alege tema Theming with Compose Theming with XML diff --git a/app/src/main/res/values-tr/strings.xml b/app/src/main/res/values-tr/strings.xml index 24306c9..ddc9568 100644 --- a/app/src/main/res/values-tr/strings.xml +++ b/app/src/main/res/values-tr/strings.xml @@ -9,6 +9,12 @@ Core SDK başarıyla oluşturuldu İşlem numarasını doğrula… Hata: İşlem numarası (Action-ID) “MainActivity.kt” dosyasında 9 basamaklı bir sayı dizisi olarak ayarlanmamıştır. + Doğrulama başarılı + Doğrulama başarısız: + Başlatma Başarısız:\n + Product Journey başarıyla tamamlandı + Product Journey bir hatayla sonuçlandı: + "Success: " Tema seç Theming with Compose Theming with XML diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index bb41dc5..78441f4 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -8,6 +8,12 @@ Core SDK creation successful Validate Action-ID… Failure: The transaction number (Action-ID) was not set to 9-digit number string in MainActivity.kt file. + Verification successful + Verification failed: + Start Failed:\n + Product Journey finished successfully + Product journey finished with failure: + "Success: " Choose A Theme: Theming with Compose Theming with XML