修改,中英文问题(默认加载系统语言)

This commit is contained in:
18401019693 2023-04-24 17:31:28 +08:00
parent abe71808fb
commit 097528f97a
3 changed files with 11 additions and 56 deletions

View File

@ -55,7 +55,12 @@ public class IMLoginManager extends BaseCacheManager {
} }
public Locale getLocaleLanguage() { public Locale getLocaleLanguage() {
if (!getBoolean(KEY_LANGUAGE, false)) { Locale locale = context.getResources().getConfiguration().locale;
String language = locale.getLanguage();
if (language.contains("HK") || language.contains("hk") || language.contains("TW") || language.contains("tw")) {
language = "zh";
}
if (!getBoolean(KEY_LANGUAGE, !TextUtils.equals(language, "zh"))) {
return Locale.SIMPLIFIED_CHINESE; return Locale.SIMPLIFIED_CHINESE;
} else { } else {
return new Locale("en", "rUS"); return new Locale("en", "rUS");

View File

@ -26,55 +26,5 @@ ext {
isGooglePlay : true, isGooglePlay : true,
// //
isUploadLog : true isUploadLog : true
] ]
} }

View File

@ -19,7 +19,6 @@ import com.yunbao.common.utils.Bus;
import com.yunbao.common.utils.DialogUitl; import com.yunbao.common.utils.DialogUitl;
import com.yunbao.common.utils.MD5Util; import com.yunbao.common.utils.MD5Util;
import com.yunbao.common.utils.ToastUtil; import com.yunbao.common.utils.ToastUtil;
import com.yunbao.common.utils.WordUtil;
import com.yunbao.live.R; import com.yunbao.live.R;
import com.yunbao.live.event.LiveAudienceEvent; import com.yunbao.live.event.LiveAudienceEvent;
import com.yunbao.live.http.LiveHttpConsts; import com.yunbao.live.http.LiveHttpConsts;
@ -49,6 +48,7 @@ public class LiveRoomCheckLivePresenter {
* @param stream * @param stream
*/ */
public LiveRoomCheckLivePresenter(Context context, String liveUid, String stream, NewActionListener actionListener) { public LiveRoomCheckLivePresenter(Context context, String liveUid, String stream, NewActionListener actionListener) {
mContext = context;
LiveNetManager.get(context) LiveNetManager.get(context)
.checkLive(liveUid, stream, new CheckLiveCallBack() { .checkLive(liveUid, stream, new CheckLiveCallBack() {
@Override @Override
@ -60,7 +60,7 @@ public class LiveRoomCheckLivePresenter {
@Override @Override
public void forwardPwdRoom(CheckLiveModel model) { public void forwardPwdRoom(CheckLiveModel model) {
DialogUitl.showSimpleInputDialog(context,mContext.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() { DialogUitl.showSimpleInputDialog(context, context.getString(R.string.live_input_password), DialogUitl.INPUT_TYPE_NUMBER_PASSWORD, new DialogUitl.SimpleCallback2() {
@Override @Override
public void onCancelClick() { public void onCancelClick() {
if (mContext instanceof Activity) { if (mContext instanceof Activity) {