package defpackage;

import android.content.Context;
import android.content.res.Configuration;
import android.os.LocaleList;
import androidx.media3.container.NalUnitUtil;
import com.strmr.ps.data.local.AppDatabase;
import java.util.LinkedHashMap;
import java.util.Locale;
import kotlin.Metadata;

/* JADX INFO: loaded from: classes3.dex */
@Metadata(d1 = {"\u0000\n\n\u0002\u0018\u0002\n\u0002\u0010\u0000\n\u0000\bÆ\u0002\u0018\u00002\u00020\u0001¨\u0006\u0002"}, d2 = {"Lhf5;", "", "app_sideloadRelease"}, k = 1, mv = {2, 0, 0}, xi = NalUnitUtil.H265_NAL_UNIT_TYPE_UNSPECIFIED)
public final class hf5 {
    public static final LinkedHashMap a = wo5.g(new q07("en", "English"), new q07("cs", "Čeština"), new q07("de", "Deutsch"), new q07("es", "Español"), new q07("fr", "Français"), new q07("he", "עברית"), new q07("hi", "हिन्दी"), new q07("it", "Italiano"), new q07("nl", "Nederlands"), new q07("pt", "Português"), new q07("tr", "Türkçe"));

    public static Context a(Context context) {
        Locale locale = new Locale(d(context));
        Locale.setDefault(locale);
        Configuration configuration = new Configuration(context.getResources().getConfiguration());
        configuration.setLocale(locale);
        configuration.setLocales(new LocaleList(locale));
        Context contextCreateConfigurationContext = context.createConfigurationContext(configuration);
        cr4.f(contextCreateConfigurationContext, "createConfigurationContext(...)");
        return contextCreateConfigurationContext;
    }

    public static void b(Context context, AppDatabase appDatabase, qq3 qq3Var) {
        cr4.g(appDatabase, "database");
        Context applicationContext = context.getApplicationContext();
        m12 m12Var = sc2.a;
        wj0.c(bk1.a(m02.c), null, null, new gf5(appDatabase, applicationContext, qq3Var, null), 3);
    }

    public static String c(Context context) {
        cr4.g(context, "context");
        return d(context);
    }

    public static String d(Context context) {
        String string = context.getSharedPreferences("strmr_locale_prefs", 0).getString("app_language", "en");
        return string == null ? "en" : string;
    }

    public static boolean e(Context context, String str) {
        cr4.g(str, "languageCode");
        if (d(context).equals(str)) {
            return false;
        }
        context.getSharedPreferences("strmr_locale_prefs", 0).edit().putString("app_language", str).apply();
        return true;
    }
}
