From 3b1cbd2f2cf211b804784bef33de85b8a889677e Mon Sep 17 00:00:00 2001 From: Allan Wang Date: Wed, 8 Nov 2017 22:15:03 -0500 Subject: Translations Italian (#98) * Add translations * Update dependencies * Show lint output * Fix type inference * Add annotation --- .../kotlin/ca/allanwang/kau/utils/ColorUtils.kt | 5 +- .../kotlin/ca/allanwang/kau/utils/ContextUtils.kt | 2 +- .../main/res-public/values-it/strings_commons.xml | 71 ++++++++++++++++++++++ 3 files changed, 75 insertions(+), 3 deletions(-) create mode 100644 core/src/main/res-public/values-it/strings_commons.xml (limited to 'core/src/main') diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt index 8537185..16d1d01 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ColorUtils.kt @@ -1,5 +1,6 @@ package ca.allanwang.kau.utils +import android.annotation.SuppressLint import android.content.Context import android.content.res.ColorStateList import android.graphics.Color @@ -9,7 +10,6 @@ import android.os.Build import android.support.annotation.ColorInt import android.support.annotation.FloatRange import android.support.annotation.IntRange -import android.support.v4.content.ContextCompat import android.support.v4.graphics.drawable.DrawableCompat import android.support.v7.widget.AppCompatEditText import android.support.v7.widget.Toolbar @@ -225,6 +225,7 @@ fun Context.textColorStateList(@ColorInt color: Int): ColorStateList { return ColorStateList(states, colors) } +@SuppressLint("RestrictedApi") fun EditText.tint(@ColorInt color: Int) { val editTextColorStateList = context.textColorStateList(color) if (this is AppCompatEditText) { @@ -247,7 +248,7 @@ fun EditText.tintCursor(@ColorInt color: Int) { val fCursorDrawable = clazz.getDeclaredField("mCursorDrawable") fCursorDrawable.isAccessible = true val drawables: Array = Array(2, { - val drawable = ContextCompat.getDrawable(context, mCursorDrawableRes) + val drawable = context.drawable(mCursorDrawableRes) drawable.setColorFilter(color, PorterDuff.Mode.SRC_IN) drawable }) diff --git a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt index 0664dc6..545a3f0 100644 --- a/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt +++ b/core/src/main/kotlin/ca/allanwang/kau/utils/ContextUtils.kt @@ -121,7 +121,7 @@ inline fun Context.color(@ColorRes id: Int): Int = ContextCompat.getColor(this, inline fun Context.integer(@IntegerRes id: Int): Int = resources.getInteger(id) inline fun Context.dimen(@DimenRes id: Int): Float = resources.getDimension(id) inline fun Context.dimenPixelSize(@DimenRes id: Int): Int = resources.getDimensionPixelSize(id) -inline fun Context.drawable(@DrawableRes id: Int): Drawable = ContextCompat.getDrawable(this, id) +inline fun Context.drawable(@DrawableRes id: Int): Drawable = ContextCompat.getDrawable(this, id) ?: throw KauException("Drawable with id $id not found") inline fun Context.drawable(@DrawableRes id: Int, fallback: Drawable?): Drawable? = if (id > 0) drawable(id) else fallback inline fun Context.interpolator(@InterpolatorRes id: Int) = AnimationUtils.loadInterpolator(this, id) inline fun Context.animation(@AnimRes id: Int) = AnimationUtils.loadAnimation(this, id) diff --git a/core/src/main/res-public/values-it/strings_commons.xml b/core/src/main/res-public/values-it/strings_commons.xml new file mode 100644 index 0000000..054fcf9 --- /dev/null +++ b/core/src/main/res-public/values-it/strings_commons.xml @@ -0,0 +1,71 @@ + + + + + Info sull\'app + Informazioni su %s + Aggiungi Account + Indietro + Annulla + Novità + Chiudi + Contattaci + Copia + Personalizzato + Scuro + Predefinito + Non mostrare più + Fatto + Errore + Esci + Confermi di voler uscire? + Confermi di voler uscire da %s? + Vetro + Tutto chiaro + Ottimo + Nascondi + Chiaro + Accedi + Disconnetti + Confermi di voler disconnettere %s? + Gestisci Account + Forse + Menu + No + Nessun risultato trovato + Nulla + OK + Play Store + Recensisci + Segnala un malfunzionamento + Cerca + Invia feedback + Invia tramite + Impostazioni + Condividi + Testo copiato negli appunti. + Grazie + Uh Oh + Attenzione + + %d giorno + %d giorni + + + %d ora + %d ore + + + %d minuto + %d minuti + + + %d secondo + %d secondi + + + Permesso negato + -- cgit v1.2.3