依赖库
MultiLanguages                  : 'com.github.getActivity:MultiLanguages:8.0
implementation rootProject.ext.dependencies.MultiLanguages
1.通用方法
这里有更新context的资源和更新application的资源
 /**
     * 设置 App 的语种
     *
     * @return              语种是否发生改变了
     */
    public static boolean setAppLanguage(Context context, Locale newLocale) {
        LanguagesConfig.setAppLanguage(context, newLocale);
        if (LanguagesUtils.getLocale(context).equals(newLocale)) {
            return false;
        }
        Locale oldLocale = LanguagesUtils.getLocale(context);
        // 更新 Context 的语种
        LanguagesUtils.updateLanguages(context.getResources(), newLocale);
        if (context != sApplication) {
            // 更新 Application 的语种
            LanguagesUtils.updateLanguages(sApplication.getResources(), newLocale);
        }
        LanguagesUtils.setDefaultLocale(context);
        return true;
    }
   /**
     * 更新 Resources 语种
     */
    static void updateLanguages(Resources resources, Locale locale) {
        Configuration config = resources.getConfiguration();
        setLocale(config, locale);
        resources.updateConfiguration(config, resources.getDisplayMetrics());
    }
2.更新后刷新当前界面
object LanguageUtil {
    fun setAppLanguage(activity: Activity, newLocale: Locale) {
        // 设置新的语言
        MultiLanguages.setAppLanguage(activity, newLocale)
        
        // 重新启动当前的 Activity
        restartActivity(activity)
    }
    private fun restartActivity(activity: Activity) {
        val intent = activity.intent
        activity.finish()
        activity.startActivity(intent)
        activity.overridePendingTransition(0, 0) // 去掉过渡动画
    }
}