Skip to content

Commit

Permalink
Merge pull request #1569 from novasamatech/rc/8.1.0
Browse files Browse the repository at this point in the history
Rc/8.1.0
  • Loading branch information
valentunn authored Jul 4, 2024
2 parents 76e9f00 + c48a31a commit e2a3f1b
Show file tree
Hide file tree
Showing 18 changed files with 9,740 additions and 46 deletions.
4 changes: 2 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
buildscript {
ext {
// App version
versionName = '8.0.2'
versionCode = 140
versionName = '8.1.0'
versionCode = 141

applicationId = "io.novafoundation.nova"
releaseApplicationSuffix = "market"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class PreferencesImpl(

override fun getCurrentLanguage(): Language? {
return if (sharedPreferences.contains(PREFS_SELECTED_LANGUAGE)) {
Language(sharedPreferences.getString(PREFS_SELECTED_LANGUAGE, "")!!)
Language(iso639Code = sharedPreferences.getString(PREFS_SELECTED_LANGUAGE, "")!!)
} else {
null
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,20 +49,21 @@ class ContextManager private constructor(
private fun updateResources(context: Context): Context {
val prefs = PreferencesImpl(context.getSharedPreferences(SHARED_PREFERENCES_FILE, Context.MODE_PRIVATE))

val currentLanguage = if (prefs.getCurrentLanguage() == null) {
val currentLanguage = prefs.getCurrentLanguage()
val currentLanguageCode = if (currentLanguage == null) {
val currentLocale = Locale.getDefault()
if (languagesHolder.getLanguages().map { it.iso639Code }.contains(currentLocale.language)) {
currentLocale.language
} else {
languagesHolder.getDefaultLanguage().iso639Code
}
} else {
prefs.getCurrentLanguage()!!.iso639Code
currentLanguage.iso639Code
}

prefs.saveCurrentLanguage(currentLanguage)
prefs.saveCurrentLanguage(currentLanguageCode)

val locale = mapLanguageToLocale(currentLanguage)
val locale = mapLanguageToLocale(currentLanguageCode)
Locale.setDefault(locale)

val configuration = context.resources.configuration
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -8,22 +8,28 @@ class LanguagesHolder {

companion object {

private val ENGLISH = Language("en")
private val CHINESE = Language("zh")
private val ITALIAN = Language("it")
private val PORTUGUESE = Language("pt")
private val RUSSIAN = Language("ru")
private val SPANISH = Language("es")
private val TURKISH = Language("tr")

private val availableLanguages = mutableListOf(ENGLISH, CHINESE, ITALIAN, PORTUGUESE, RUSSIAN, SPANISH, TURKISH)
private val ENGLISH = Language("en", "ENGLISH")
private val CHINESE = Language("zh", "CHINESE")
private val ITALIAN = Language("it", "ITALIAN")
private val PORTUGUESE = Language("pt", "PORTUGUESE")
private val RUSSIAN = Language("ru", "RUSSIAN")
private val SPANISH = Language("es", "SPANISH")
private val TURKISH = Language("tr", "TURKISH")
private val FRENCH = Language("fr", "FRENCH")
private val INDONESIAN = Language("in", "INDONESIAN")
private val POLISH = Language("pl", "POLISH")
private val JAPANESE = Language("ja", "JAPANESE")
private val VIETNAMESE = Language("vi", "VIETNAMESE")
private val KOREAN = Language("ko", "KOREAN")
}

fun getDefaultLanguage(): Language {
return ENGLISH
}

fun getLanguages(): List<Language> {
return availableLanguages
val defaultLanguage = listOf(getDefaultLanguage())
val otherLanguages = listOf(CHINESE, FRENCH, INDONESIAN, ITALIAN, JAPANESE, KOREAN, POLISH, PORTUGUESE, RUSSIAN, SPANISH, TURKISH, VIETNAMESE)
return defaultLanguage + otherLanguages.sortedBy { it.name }
}
}
4 changes: 2 additions & 2 deletions common/src/main/res/values-es/strings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@
<string name="account_invalid_derivation_path_title">Ruta de derivación inválida</string>
<string name="account_json_file">Archivo JSON</string>
<string name="account_ledger_generic_import_start_step_1">Asegúrate de que <font color="#FFFFFF">Generic app esté instalada</font> en tu dispositivo Ledger usando la aplicación Ledger Live</string>
<string name="account_ledger_generic_import_start_step_2"><font color="#FFFFFF">Open the Generic app</font> on your Ledger device</string>
<string name="account_ledger_generic_import_start_step_2"><font color="#FFFFFF">Abre la aplicación Generic</font> en tu dispositivo Ledger</string>
<string name="account_ledger_import_fill_description">Asegúrate de que la aplicación de Red está instalada en tu dispositivo Ledger usando la aplicación Ledger Live. Abre la aplicación de red en tu dispositivo Ledger.</string>
<string name="account_ledger_import_fill_disabled_hint">Agrega al menos una cuenta</string>
<string name="account_ledger_import_fill_title">Añade cuentas a tu cartera</string>
Expand Down Expand Up @@ -113,7 +113,7 @@
<string name="account_parity_signer_sign_title">Firmar con %s</string>
<string name="account_polkadot_vault">Polkadot Vault</string>
<string name="account_polkadot_vault_import_start_empty_derivation_hint">Preste atención, el nombre de la ruta de derivación debe estar vacío</string>
<string name="account_polkadot_vault_import_start_step_1"><font color="#FFFFFF">Open Polkadot Vault</font> application on your smartphone</string>
<string name="account_polkadot_vault_import_start_step_1"><font color="#FFFFFF">Abre la aplicación Polkadot Vault</font> en tu teléfono inteligente</string>
<string name="account_polkadot_vault_import_start_step_2"><font color="#FFFFFF">Vaya a la pestaña \"Conjuntos de claves\".</font> Seleccione su conjunto de claves, Red y luego la cuenta que desea agregar a Nova Wallet.</string>
<string name="account_polkadot_vault_import_start_step_3">Polkadot Vault le proporcionará un <font color="#FFFFFF">código QR para escanear</font></string>
<string name="account_private_key">Clave privada</string>
Expand Down
Loading

0 comments on commit e2a3f1b

Please sign in to comment.