Skip to content

Commit

Permalink
Portuguese translation. Thanks to Fabio Papoila
Browse files Browse the repository at this point in the history
  • Loading branch information
AndreyPavlenko committed Dec 10, 2023
1 parent 7d02c31 commit 302e655
Show file tree
Hide file tree
Showing 6 changed files with 406 additions and 3 deletions.
2 changes: 1 addition & 1 deletion build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ subprojects {
targetSdkVersion SDK_TARGET_VERSION
vectorDrawables.useSupportLibrary = true
testInstrumentationRunner "androidx.test.runner.AndroidJUnitRunner"
resConfigs 'en', 'ru', 'it', 'tr', 'de'
resConfigs 'en', 'ru', 'it', 'tr', 'de', 'pt'

ndk {
abiFilters = ABI_FILTERS
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ public interface MainActivityPrefs
int LOCALE_IT = 2;
int LOCALE_TR = 3;
int LOCALE_DE = 4;
int LOCALE_PT = 5;
Pref<IntSupplier> THEME_MAIN = Pref.i("THEME_MAIN", THEME_DARK);
Pref<BooleanSupplier> HIDE_BARS = Pref.b("HIDE_BARS", false);
Pref<BooleanSupplier> FULLSCREEN = Pref.b("FULLSCREEN", false);
Expand Down Expand Up @@ -67,6 +68,7 @@ public interface MainActivityPrefs
case "it" -> LOCALE_IT;
case "tr" -> LOCALE_TR;
case "de" -> LOCALE_DE;
case "pt" -> LOCALE_PT;
default -> LOCALE_EN;
});

Expand Down Expand Up @@ -242,6 +244,7 @@ default Locale getLocalePref() {
case LOCALE_IT -> Locale.ITALIAN;
case LOCALE_TR -> new Locale("tr");
case LOCALE_DE -> new Locale("de");
case LOCALE_PT -> new Locale("pt");
default -> Locale.ENGLISH;
};
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
import static me.aap.fermata.ui.activity.MainActivityPrefs.LOCALE_DE;
import static me.aap.fermata.ui.activity.MainActivityPrefs.LOCALE_EN;
import static me.aap.fermata.ui.activity.MainActivityPrefs.LOCALE_IT;
import static me.aap.fermata.ui.activity.MainActivityPrefs.LOCALE_PT;
import static me.aap.fermata.ui.activity.MainActivityPrefs.LOCALE_RU;
import static me.aap.fermata.ui.activity.MainActivityPrefs.LOCALE_TR;
import static me.aap.fermata.ui.activity.MainActivityPrefs.VOICE_CONTROL_LANG;
Expand Down Expand Up @@ -279,8 +280,8 @@ private PreferenceViewAdapter createAdapter(MainActivityDelegate a) {
o.title = R.string.lang;
o.subtitle = R.string.string_format;
o.values = new int[]{R.string.lang_en, R.string.lang_de, R.string.lang_it, R.string.lang_ru,
R.string.lang_tr};
o.valuesMap = new int[]{LOCALE_EN, LOCALE_DE, LOCALE_IT, LOCALE_RU, LOCALE_TR};
R.string.lang_tr, R.string.lang_pt};
o.valuesMap = new int[]{LOCALE_EN, LOCALE_DE, LOCALE_IT, LOCALE_RU, LOCALE_TR, LOCALE_PT};
o.formatSubtitle = true;
o.removeDefault = false;
});
Expand Down
Loading

0 comments on commit 302e655

Please sign in to comment.