10
0

[MWA-5224] Erweiterung der Demo-App um weitere Sprachen

This commit is contained in:
Simon Hagen 2025-11-07 10:52:39 +01:00
parent 84b52bef47
commit 40d7cb0e7b
14 changed files with 143 additions and 21 deletions

View File

@ -8,6 +8,7 @@
android:label="@string/app_name" android:label="@string/app_name"
android:roundIcon="@mipmap/ic_launcher_round" android:roundIcon="@mipmap/ic_launcher_round"
android:supportsRtl="true" android:supportsRtl="true"
android:localeConfig="@xml/locales_config"
android:theme="@style/Theme.MetaPluginDemo"> android:theme="@style/Theme.MetaPluginDemo">
<activity <activity
android:name="de.webidsolutions.metaplugindemo.MainActivity" android:name="de.webidsolutions.metaplugindemo.MainActivity"

View File

@ -79,7 +79,7 @@ internal class MainActivity : AppCompatActivity() {
startButton = findViewById(R.id.startButton) startButton = findViewById(R.id.startButton)
startButton.setOnClickListener { startButton.setOnClickListener {
clearLog() clearLog()
writeLog("Starting…") writeLog(getString(R.string.starting))
createCoreSdk() createCoreSdk()
} }
} }
@ -90,7 +90,7 @@ internal class MainActivity : AppCompatActivity() {
* Creates the Core SDK from the existing credentials. * Creates the Core SDK from the existing credentials.
*/ */
private fun createCoreSdk() { private fun createCoreSdk() {
writeLog("Creating the Core SDK…") writeLog(getString(R.string.creating_core_sdk))
// should be provided to you -> currently just using demo credentials // should be provided to you -> currently just using demo credentials
val selectedUri: URI = chosenEnvironment.uri val selectedUri: URI = chosenEnvironment.uri
@ -103,7 +103,7 @@ internal class MainActivity : AppCompatActivity() {
*chosenEnvironment.shaPins *chosenEnvironment.shaPins
) )
writeLog("Core SDK creation successful") writeLog(getString(R.string.core_sdk_creation_successful))
validateActionId() validateActionId()
val selectProductPlugins = getSelectedPlugins() val selectProductPlugins = getSelectedPlugins()
@ -124,7 +124,7 @@ internal class MainActivity : AppCompatActivity() {
* Validates the WebID actionID * Validates the WebID actionID
*/ */
private fun validateActionId() { private fun validateActionId() {
writeLog("Validate Action-ID…") writeLog(getString(R.string.validate_action_id))
try { try {
parseInt(actionId) parseInt(actionId)
@ -132,7 +132,7 @@ internal class MainActivity : AppCompatActivity() {
throw NumberFormatException() throw NumberFormatException()
} }
} catch (e: NumberFormatException) { } catch (e: NumberFormatException) {
writeLog("Failure: action id was not set to 9-digit number string in MainActivity.kt file") writeLog(getString(R.string.action_id_not_valid))
} }
} }

View File

@ -13,7 +13,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="13dp" android:layout_marginLeft="13dp"
android:layout_marginTop="13dp" android:layout_marginTop="13dp"
android:text="Choose Plugins To Add:" android:text="@string/choose_plugins"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toTopOf="parent" /> app:layout_constraintTop_toTopOf="parent" />
@ -24,7 +24,7 @@
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
android:layout_marginTop="13dp" android:layout_marginTop="13dp"
android:text="AutoIdOnServer" android:text="@string/autoid"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/tv_plugins_header" /> app:layout_constraintTop_toBottomOf="@+id/tv_plugins_header" />
@ -33,7 +33,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
android:text="PayOnServer" android:text="@string/accountid"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cb_plugin_auto_id_on_server" /> app:layout_constraintTop_toBottomOf="@+id/cb_plugin_auto_id_on_server" />
@ -42,7 +42,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
android:text="EidOnServer" android:text="@string/eid"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cb_plugin_pay_on_server" /> app:layout_constraintTop_toBottomOf="@+id/cb_plugin_pay_on_server" />
@ -51,7 +51,7 @@
android:layout_width="wrap_content" android:layout_width="wrap_content"
android:layout_height="wrap_content" android:layout_height="wrap_content"
android:layout_marginLeft="30dp" android:layout_marginLeft="30dp"
android:text="VideoId" android:text="@string/videoid"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@+id/cb_plugin_eid_on_server" /> app:layout_constraintTop_toBottomOf="@+id/cb_plugin_eid_on_server" />
@ -71,13 +71,13 @@
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
android:layout_marginStart="@dimen/grid_margin" android:layout_marginStart="@dimen/grid_margin"
android:layout_marginEnd="@dimen/grid_margin"
android:layout_marginTop="@dimen/grid_margin" android:layout_marginTop="@dimen/grid_margin"
android:layout_marginEnd="@dimen/grid_margin"
android:layout_marginBottom="@dimen/grid_margin" android:layout_marginBottom="@dimen/grid_margin"
app:layout_constraintBottom_toTopOf="@id/startButton" app:layout_constraintBottom_toTopOf="@id/startButton"
app:layout_constraintTop_toBottomOf="@id/logHeadline"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent"> app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/logHeadline">
<LinearLayout <LinearLayout
android:layout_width="match_parent" android:layout_width="match_parent"
@ -98,12 +98,12 @@
android:id="@+id/startButton" android:id="@+id/startButton"
android:layout_width="match_parent" android:layout_width="match_parent"
android:layout_height="@dimen/button_height" android:layout_height="@dimen/button_height"
android:text="@string/start_button"
android:backgroundTint="@color/colorBlueWebid"
android:textColor="@color/white"
android:layout_marginBottom="@dimen/grid_margin"
android:layout_marginEnd="@dimen/grid_margin"
android:layout_marginStart="@dimen/grid_margin" android:layout_marginStart="@dimen/grid_margin"
android:layout_marginEnd="@dimen/grid_margin"
android:layout_marginBottom="@dimen/grid_margin"
android:backgroundTint="@color/colorBlueWebid"
android:text="@string/start_button"
android:textColor="@color/white"
app:layout_constraintBottom_toBottomOf="parent" app:layout_constraintBottom_toBottomOf="parent"
app:layout_constraintEnd_toEndOf="parent" app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintStart_toStartOf="parent" /> app:layout_constraintStart_toStartOf="parent" />

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="start_button">Starte Meta Plugin</string>
<string name="log_headline">Log:</string>
<string name="log_placeholder">Noch keine Einträge…</string>
<string name="choose_plugins">Plugins auswählen:</string>
<string name="creating_core_sdk">Core SDK wird erstellt…</string>
<string name="starting">Meta Plugin wird gestartet…</string>
<string name="core_sdk_creation_successful">Core SDK erfolgreich erstellt</string>
<string name="validate_action_id">Validiere Vorgangsnummer…</string>
<string name="action_id_not_valid">Fehler: Die Vorgangsnummer (Action-ID) wurde in der Datei „MainActivity.kt“ nicht auf eine 9-stellige Zahlenfolge gesetzt.</string>
</resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="start_button">Iniciar Meta Plugin</string>
<string name="log_headline">Registro:</string>
<string name="log_placeholder">Aún nada…</string>
<string name="choose_plugins">Seleccionar plugins:</string>
<string name="creating_core_sdk">Creando Core SDK…</string>
<string name="starting">Iniciando Meta Plugin…</string>
<string name="core_sdk_creation_successful">Core SDK creado correctamente</string>
<string name="validate_action_id">Validar número de operación…</string>
<string name="action_id_not_valid">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».</string>
</resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="start_button">Démarrer Meta Plugin</string>
<string name="log_headline">Journal :</string>
<string name="log_placeholder">Rien pour linstant…</string>
<string name="choose_plugins">Sélectionner les plugins :</string>
<string name="creating_core_sdk">Création de Core SDK…</string>
<string name="starting">Démarrage de Meta Plugin…</string>
<string name="core_sdk_creation_successful">Core SDK créé avec succès</string>
<string name="validate_action_id">Valider le numéro d\'opération…</string>
<string name="action_id_not_valid">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 ».</string>
</resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="start_button">Avvia Meta Plugin</string>
<string name="log_headline">Registro:</string>
<string name="log_placeholder">Ancora nulla…</string>
<string name="choose_plugins">Selezionare i plugin:</string>
<string name="creating_core_sdk">Creazione di Core SDK…</string>
<string name="starting">Avvio di Meta Plugin…</string>
<string name="core_sdk_creation_successful">Core SDK creato con successo</string>
<string name="validate_action_id">Convalida numero operazione…</string>
<string name="action_id_not_valid">Errore: il numero dell\'operazione (ActionID) non è stato impostato su una sequenza di 9 cifre nel file “MainActivity.kt”.</string>
</resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="start_button">Start Meta Plugin</string>
<string name="log_headline">Log:</string>
<string name="log_placeholder">Nog niets…</string>
<string name="choose_plugins">Plug-ins selecteren:</string>
<string name="creating_core_sdk">Core SDK wordt gemaakt…</string>
<string name="starting">Meta Plugin wordt gestart…</string>
<string name="core_sdk_creation_successful">Core SDK succesvol aangemaakt</string>
<string name="validate_action_id">Valideer transactienummer…</string>
<string name="action_id_not_valid">Fout: het actienummer (ActionID) is in het bestand “MainActivity.kt” niet ingesteld op een reeks van 9 cijfers.</string>
</resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="start_button">Uruchom Meta-Plugin</string>
<string name="log_headline">Dziennik:</string>
<string name="log_placeholder">Na razie nic…</string>
<string name="choose_plugins">Wybierz wtyczki:</string>
<string name="creating_core_sdk">Tworzenie Core SDK…</string>
<string name="starting">Uruchamianie Meta Plugin…</string>
<string name="core_sdk_creation_successful">Core SDK utworzony pomyślnie</string>
<string name="validate_action_id">Zatwierdź numer operacji…</string>
<string name="action_id_not_valid">Błąd: Numer operacji (Action-ID) nie został ustawiony na 9-cyfrową sekwencję cyfr w pliku „MainActivity.kt”.</string>
</resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="start_button">Pornește Meta Plugin</string>
<string name="log_headline">Jurnal:</string>
<string name="log_placeholder">Încă nimic…</string>
<string name="choose_plugins">Selectarea pluginurilor:</string>
<string name="creating_core_sdk">Se creează Core SDK…</string>
<string name="starting">Se pornește Meta Plugin…</string>
<string name="core_sdk_creation_successful">Core SDK creat cu succes</string>
<string name="validate_action_id">Validați numărul operațiunii…</string>
<string name="action_id_not_valid">Eroare: Numărul operațiunii („Action-ID”) nu a fost setat la o secvență de 9 cifre în fișierul „MainActivity.kt”.</string>
</resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="start_button">Meta Plugin\'i başlat</string>
<string name="log_headline">Günlük :</string>
<string name="log_placeholder">Henüz bir şey yok…</string>
<string name="choose_plugins">Eklentileri seçin:</string>
<string name="creating_core_sdk">Core SDK oluşturuluyor…</string>
<string name="starting">Meta Plugin başlatılıyor…</string>
<string name="core_sdk_creation_successful">Core SDK başarıyla oluşturuldu</string>
<string name="validate_action_id">İşlem numarasını doğrula…</string>
<string name="action_id_not_valid">Hata: İşlem numarası (Action-ID) “MainActivity.kt” dosyasında 9 basamaklı bir sayı dizisi olarak ayarlanmamıştır.</string>
</resources>

View File

@ -0,0 +1,8 @@
<?xml version="1.0" encoding="utf-8"?>
<resources>
<string name="app_name" translatable="false">MetaPluginDemo</string>
<string name="autoid" translatable="false">AutoID</string>
<string name="accountid" translatable="false">AccountID</string>
<string name="eid" translatable="false">eID</string>
<string name="videoid" translatable="false">VideoID</string>
</resources>

View File

@ -1,6 +1,11 @@
<resources> <resources>
<string name="app_name">MetaPluginDemo</string>
<string name="start_button">Start Meta Plugin</string> <string name="start_button">Start Meta Plugin</string>
<string name="log_headline">Log:</string> <string name="log_headline">Log:</string>
<string name="log_placeholder">Nothing yet…</string> <string name="log_placeholder">Nothing yet…</string>
<string name="choose_plugins">Choose Plugins To Add:</string>
<string name="creating_core_sdk">Creating the Core SDK…</string>
<string name="starting">Starting Meta Plugin…</string>
<string name="core_sdk_creation_successful">Core SDK creation successful</string>
<string name="validate_action_id">Validate Action-ID…</string>
<string name="action_id_not_valid">Failure: The transaction number (Action-ID) was not set to 9-digit number string in MainActivity.kt file.</string>
</resources> </resources>

View File

@ -0,0 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<locale-config xmlns:android="http://schemas.android.com/apk/res/android">
<locale android:name="en"/>
<locale android:name="de"/>
<locale android:name="fr"/>
<locale android:name="es"/>
<locale android:name="it"/>
<locale android:name="nl"/>
<locale android:name="pl"/>
<locale android:name="ro"/>
<locale android:name="tr"/>
</locale-config>