Skip to content

Commit

Permalink
localize string resources
Browse files Browse the repository at this point in the history
  • Loading branch information
EricoMartin committed Oct 30, 2021
1 parent 0bc05bf commit fe46ccc
Show file tree
Hide file tree
Showing 12 changed files with 328 additions and 277 deletions.
23 changes: 10 additions & 13 deletions app/src/main/java/com/zurichat/app/ui/login/LoginViewModel.kt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
package com.zurichat.app.ui.login

import android.app.Application
import androidx.lifecycle.*
import com.zurichat.app.R
import androidx.lifecycle.LiveData
import androidx.lifecycle.MutableLiveData
import androidx.lifecycle.ViewModel
import androidx.lifecycle.viewModelScope
import com.zurichat.app.data.repository.UserRepository
import com.zurichat.app.models.*
import com.zurichat.app.ui.login.password.confirm.ConfirmPasswordData
Expand All @@ -11,13 +12,13 @@ import com.zurichat.app.ui.login.password.resetuserpass.ResetUserPasswordRespons
import com.zurichat.app.util.Result
import dagger.hilt.android.lifecycle.HiltViewModel
import kotlinx.coroutines.CoroutineExceptionHandler
import kotlinx.coroutines.Dispatchers
import kotlinx.coroutines.launch
import timber.log.Timber
import javax.inject.Inject
import kotlinx.coroutines.Dispatchers

@HiltViewModel
class LoginViewModel @Inject constructor(private val repository: UserRepository) : AndroidViewModel(Application()) {
class LoginViewModel @Inject constructor(private val repository: UserRepository) : ViewModel() {


private val _loginResponse = MutableLiveData<Result<LoginResponse>>()
Expand Down Expand Up @@ -74,8 +75,7 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository)
_logoutResponse.postValue(Result.Success(it))
}
}else {
_logoutResponse.postValue(Result.Error(Exception(getApplication<Application>().resources.getString(
R.string.err_occured_try_again))))
_logoutResponse.postValue(Result.Error(Exception("Error occurred please try again ")))
}
}
}
Expand All @@ -92,8 +92,7 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository)
}

} else {
_resetCodeResponse.postValue(Result.Error(Exception(getApplication<Application>().resources.getString(
R.string.err_occured_try_again))))
_resetCodeResponse.postValue(Result.Error(Exception("Error occurred please try again ")))
}

}
Expand All @@ -112,8 +111,7 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository)

} else {
_updatePassResponse.postValue(Result
.Error(Exception(getApplication<Application>().resources.getString(
R.string.err_occured_try_again))))
.Error(Exception("Error occurred please try again ")))
}

}
Expand All @@ -130,8 +128,7 @@ class LoginViewModel @Inject constructor(private val repository: UserRepository)
_passwordReset.postValue(Result.Success(it))
}
}else{
_passwordReset.postValue(Result.Error(Exception(getApplication<Application>().resources.getString(
R.string.err_msg))))
_passwordReset.postValue(Result.Error(Exception("ERROR MESSAGE")))
}
}

Expand Down
2 changes: 1 addition & 1 deletion app/src/main/res/menu/home_menu.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
android:visible="true" />-->
<item
android:id="@+id/switch_workspace"
android:title="Switch Organisation"
android:title="@string/switch_organisation"
android:visible="true" />
<!-- <item
android:id="@+id/create_organisation"
Expand Down
6 changes: 6 additions & 0 deletions app/src/main/res/values-ar/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -322,4 +322,10 @@
<string name = "click_delete"> انقر للحذف </string>
<string name = "backup_dialog"> مربع حوار النسخ الاحتياطي </string>
<string name = "backup_google"> نسخ Google احتياطيًا </string>
<string name = "privacy"> الخصوصية </string>
<string name = "storage_n_data"> التخزين والبيانات </string>
<string name = "chat_setting"> إعدادات الدردشة </string>
<string name = "notice_n_sounds"> الإخطار والأصوات </string>
<string name = "logout_"> تسجيل الخروج </string>
<string name="switch_organisation">منظمة التبديل</string>
</resources>
520 changes: 263 additions & 257 deletions app/src/main/res/values-de/strings.xml

Large diffs are not rendered by default.

6 changes: 6 additions & 0 deletions app/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -321,4 +321,10 @@
<string name = "click_delete"> haga clic para eliminar </string>
<string name = "backup_dialog"> Cuadro de diálogo de copia de seguridad </string>
<string name = "backup_google"> Copia de seguridad de Google </string>
<string name = "privacy"> Privacidad </string>
<string name = "storage_n_data"> Almacenamiento y datos </string>
<string name = "chat_setting"> Configuración de chat </string>
<string name = "notice_n_sounds"> Notificación y sonidos </string>
<string name = "logout_"> Cerrar sesión </string>
<string name="switch_organisation">Cambiar de organización</string>
</resources>
8 changes: 7 additions & 1 deletion app/src/main/res/values-fr/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,7 @@
<string name="out_of">sur</string>
<string name="selected">sélectionné</string>
<string name="err_loading_data">Erreur lors du chargement des données depuis le serveur</string>
<string name="user_no_org">L\'utilisateur n\'a pas d'organisation</string>
<string name="user_no_org">L\'utilisateur n\'a pas d\'organisation</string>
<string name="orgz">Organisation(s)</string>
<string name="invite_by_email">Inviter par e-mail</string>
<string name="add_one_email">Vous devez ajouter au moins un e-mail</string>
Expand All @@ -322,4 +322,10 @@
<string name="backup_dialog">Boîte de dialogue de sauvegarde</string>
<string name="backup_google">Sauvegarder Google</string>
<string name="vibrate">vibrer</string>
<string name="privacy">Confidentialité</string>
<string name="storage_n_data">Stockage et données</string>
<string name="chat_setting">Paramètres de discussion</string>
<string name="notice_n_sounds">Notification et sons</string>
<string name="logout_">Déconnexion</string>
<string name="switch_organisation">Changer d\'organisation</string>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values-it/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -320,4 +320,10 @@
<string name="backup_dialog">Finestra di backup</string>
<string name="backup_google">Esegui il backup di Google</string>
<string name="vibrate">vibrare</string>
<string name="privacy">Privacy</string>
<string name="storage_n_data">Memoria e dati</string>
<string name="chat_setting">Impostazioni chat</string>
<string name="notice_n_sounds">Notifiche e suoni</string>
<string name="logout_">Disconnetti</string>
<string name="switch_organisation">Cambia organizzazione</string>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values-iw/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,10 @@
<string name="backup_google">גבה את Google</string>
<string name="zuri_dms_team_tolstoy">TitZuri DMs: Team Tolstoy - Kotlin Java Mobile</string>
<string name="action_video_call">שיחת וידאו</string>
<string name="privacy">פרטיות</string>
<string name="storage_n_data">אחסון ונתונים</string>
<string name="chat_setting">הגדרות צ\'אט</string>
<string name="notice_n_sounds">הודעות וצלילים</string>
<string name="logout_">צא</string>
<string name="switch_organisation">החלף ארגון</string>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values-pt/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -323,4 +323,10 @@
<string name = "backup_google"> Backup do Google </string>
<string name="vibrate">vibrar</string>
<string name="current_org_id">ID da organização atual</string>
<string name = "privacy"> Privacidade </string>
<string name = "storage_n_data"> Armazenamento e dados </string>
<string name = "chat_setting"> Configurações de bate-papo </string>
<string name = "notice_n_sounds"> Notificação e sons </string>
<string name = "logout_"> Sair </string>
<string name="switch_organisation">Mudar de organização</string>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values-zh/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -324,4 +324,10 @@
<string name="backup_dialog">备份对话框</string>
<string name="backup_google">备份谷歌</string>
<string name="hello_blank_fragment">没有网络连接</string>
<string name="privacy">隐私</string>
<string name="storage_n_data">存储和数据</string>
<string name="chat_setting">聊天设置</string>
<string name="notice_n_sounds">通知和声音</string>
<string name="logout_">注销</string>
<string name="switch_organisation">切换组织</string>
</resources>
6 changes: 6 additions & 0 deletions app/src/main/res/values/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -374,4 +374,10 @@
<string name="backup_dialog">Back up Dialog</string>
<string name="backup_google">Back up Google</string>
<string name="lbl_terms_and_conditions"><u>terms and conditions</u></string>
<string name="privacy">Privacy</string>
<string name="storage_n_data">Storage and Data</string>
<string name="chat_setting">Chat Settings</string>
<string name="notice_n_sounds">Notification and Sounds</string>
<string name="logout_">Log out</string>
<string name="switch_organisation">Switch Organisation</string>
</resources>
10 changes: 5 additions & 5 deletions app/src/main/res/xml/settings_preferences.xml
Original file line number Diff line number Diff line change
Expand Up @@ -4,26 +4,26 @@
app:fragment="com.zurichat.app.ui.settings.fragments.ChatFragment"
app:icon="@drawable/ic_chat"
app:key="chat_header"
app:title="Chat Settings"
app:title="@string/chat_setting"
/>

<Preference
app:fragment="com.zurichat.app.ui.settings.SettingsActivity$PrivacyAndSecurityFragment"
app:icon="@drawable/ic_lock"
app:key="security_header"
app:title="Privacy" />
app:title="@string/privacy" />

<Preference
app:fragment="com.zurichat.app.ui.settings.SettingsActivity$StorageAndDataFragment"
app:icon="@drawable/ic_folder"
app:key="storage_header"
app:title="Storage and Data" />
app:title="@string/storage_n_data" />

<Preference
app:fragment="com.zurichat.app.ui.settings.SettingsActivity$NotificationAndSounds"
app:icon="@drawable/ic_alarm"
app:key="notification_header"
app:title="Notification and Sounds" />
app:title="@string/notice_n_sounds" />

<Preference
app:fragment="com.zurichat.app.ui.settings.SettingsActivity$LanguagesFragment"
Expand All @@ -34,6 +34,6 @@
app:fragment="com.zurichat.app.ui.settings.dialogs.LogoutDialogFragment"
app:icon="@drawable/ic_logout"
app:key="logout_header"
app:title="Log out"/>
app:title="@string/logout_"/>

</PreferenceScreen>

0 comments on commit fe46ccc

Please sign in to comment.