2
0
mirror of https://github.com/TeamNewPipe/NewPipe synced 2025-08-22 01:58:16 +00:00

Add link for future reference

This commit is contained in:
Isira Seneviratne 2025-07-20 05:03:20 +05:30
parent 893a227ab1
commit b8f9c125cd

View File

@ -437,11 +437,13 @@ public final class Localization {
return context.getResources().getQuantityString(pluralId, safeCount, formattedCount);
}
// Starting with pull request #12093, NewPipe exclusively uses Android's
// public per-app language APIs to read and set the UI language for NewPipe.
// The following code will migrate any existing custom app language in SharedPreferences to
// use the public per-app language APIs instead.
// For reference, see
// https://android-developers.googleblog.com/2022/11/per-app-language-preferences-part-1.html
public static void migrateAppLanguageSettingIfNecessary(@NonNull final Context context) {
// Starting with pull request #12093, NewPipe exclusively uses Android's
// public per-app language APIs to read and set the UI language for NewPipe.
// The following code will migrate any existing custom app language in SharedPreferences to
// use the public per-app language APIs instead.
final SharedPreferences sp = PreferenceManager.getDefaultSharedPreferences(context);
final String appLanguageKey = context.getString(R.string.app_language_key);
final String appLanguageValue = sp.getString(appLanguageKey, null);