Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions app/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -97,10 +97,6 @@ android {
androidTest.assets.srcDirs += files("$projectDir/schemas".toString())
}

androidResources {
generateLocaleConfig = true
}

buildFeatures {
viewBinding true
buildConfig true
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,7 @@
package org.schabi.newpipe.settings;

import android.content.Context;
import android.content.Intent;
import android.net.Uri;
import android.os.Build;
import android.os.Bundle;
import android.provider.Settings;
import android.util.Log;
import android.widget.Toast;

Expand All @@ -23,7 +19,6 @@
import org.schabi.newpipe.util.image.PreferredImageQuality;

import java.io.IOException;
import java.util.Locale;

public class ContentSettingsFragment extends BasePreferenceFragment {
private String youtubeRestrictedModeEnabledKey;
Expand All @@ -40,26 +35,6 @@ public void onCreatePreferences(final Bundle savedInstanceState, final String ro

private void setupAppLanguagePreferences() {
final Preference appLanguagePref = requirePreference(R.string.app_language_key);
// Android 13+ allows to set app specific languages
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
appLanguagePref.setVisible(false);

final Preference newAppLanguagePref =
requirePreference(R.string.app_language_android_13_and_up_key);
newAppLanguagePref.setSummaryProvider(preference -> {
final Locale loc = AppCompatDelegate.getApplicationLocales().get(0);
return loc != null ? loc.getDisplayName() : getString(R.string.systems_language);
});
newAppLanguagePref.setOnPreferenceClickListener(preference -> {
final Intent intent = new Intent(Settings.ACTION_APP_LOCALE_SETTINGS)
.setData(Uri.fromParts("package", requireContext().getPackageName(), null));
startActivity(intent);
return true;
});
newAppLanguagePref.setVisible(true);
return;
}

appLanguagePref.setOnPreferenceChangeListener((preference, newValue) -> {
final String language = (String) newValue;
final String systemLang = getString(R.string.default_localization_key);
Expand Down
5 changes: 0 additions & 5 deletions app/src/main/java/org/schabi/newpipe/util/Localization.java
Original file line number Diff line number Diff line change
Expand Up @@ -447,11 +447,6 @@ public static void migrateAppLanguageSettingIfNecessary(@NonNull final Context c
final String appLanguageKey = context.getString(R.string.app_language_key);
final String appLanguageValue = sp.getString(appLanguageKey, null);
if (appLanguageValue != null) {
// The app language key is used on Android versions < 33
// for more info, see ContentSettingsFragment
if (Build.VERSION.SDK_INT >= Build.VERSION_CODES.TIRAMISU) {
sp.edit().remove(appLanguageKey).apply();
}
final String appLanguageDefaultValue =
context.getString(R.string.default_localization_key);
if (!appLanguageValue.equals(appLanguageDefaultValue)) {
Expand Down
1 change: 0 additions & 1 deletion app/src/main/res/resources.properties

This file was deleted.

1 change: 0 additions & 1 deletion app/src/main/res/values/settings_keys.xml
Original file line number Diff line number Diff line change
Expand Up @@ -356,7 +356,6 @@
<string name="playback_skip_silence_key">playback_skip_silence_key</string>

<string name="app_language_key">app_language_key</string>
<string name="app_language_android_13_and_up_key">app_language_android_13_and_up_key</string>

<string name="feed_update_threshold_key">feed_update_threshold_key</string>
<string name="feed_update_threshold_default_value">300</string>
Expand Down
7 changes: 0 additions & 7 deletions app/src/main/res/xml/content_settings.xml
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,6 @@
app:iconSpaceReserved="false"
app:useSimpleSummaryProvider="true" />

<Preference
android:key="@string/app_language_android_13_and_up_key"
android:title="@string/app_language_title"
app:isPreferenceVisible="false"
app:singleLineTitle="false"
app:iconSpaceReserved="false" />

<ListPreference
android:defaultValue="@string/default_localization_key"
android:entries="@array/language_names"
Expand Down