Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/hotfix/483-translations-not-bein…
Browse files Browse the repository at this point in the history
…g-applied-correctly' into hotfix/483-translations-not-being-applied-correctly
  • Loading branch information
wax911 committed Jul 22, 2022
2 parents 95164c7 + 3ac550d commit e10cd6d
Showing 1 changed file with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -1,13 +1,17 @@
package com.mxt.anitrend.base.custom.pager;

import android.content.Context;
import android.content.res.Configuration;
import android.os.Bundle;

import androidx.annotation.ArrayRes;
import androidx.fragment.app.Fragment;
import androidx.fragment.app.FragmentManager;
import androidx.fragment.app.FragmentStatePagerAdapter;

import com.mxt.anitrend.extension.KoinExt;
import com.mxt.anitrend.util.Settings;

import java.util.Locale;

/**
Expand All @@ -27,7 +31,9 @@ public BaseStatePageAdapter(FragmentManager fragmentManager, Context context) {
}

public void setPagerTitles(@ArrayRes int mTitleRes) {
mTitles = context.getResources().getStringArray(mTitleRes);
Configuration configuration = new Configuration(context.getResources().getConfiguration());
configuration.setLocale(new Locale(KoinExt.get(Settings.class).getUserLanguage()));
mTitles = context.createConfigurationContext(configuration).getResources().getStringArray(mTitleRes);
}

public String[] getPagerTitles() {
Expand Down

0 comments on commit e10cd6d

Please sign in to comment.