多语言切换

This commit is contained in:
18401019693 2023-04-19 16:38:56 +08:00
parent 1dce512d27
commit 5dcdd3fc5f
4 changed files with 8 additions and 7 deletions

View File

@ -245,7 +245,7 @@ public class WebViewActivity extends AbsActivity {
} }
public static void forward(Context context, String url) { public static void forward(Context context, String url) {
forward(context, url+ "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"), true); forward(context, url, true);
} }
@Override @Override

View File

@ -24,6 +24,7 @@ import androidx.annotation.RequiresApi;
import com.alibaba.fastjson.JSON; import com.alibaba.fastjson.JSON;
import com.yunbao.common.CommonAppConfig; import com.yunbao.common.CommonAppConfig;
import com.yunbao.common.CommonAppContext;
import com.yunbao.common.Constants; import com.yunbao.common.Constants;
import com.yunbao.common.HtmlConfig; import com.yunbao.common.HtmlConfig;
import com.yunbao.common.R; import com.yunbao.common.R;
@ -293,7 +294,7 @@ public class WebViewActivityMedal extends AbsActivity {
url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken(); url += "&uid=" + CommonAppConfig.getInstance().getUid() + "&token=" + CommonAppConfig.getInstance().getToken();
} }
Intent intent = new Intent(context, WebViewActivityMedal.class); Intent intent = new Intent(context, WebViewActivityMedal.class);
intent.putExtra(Constants.URL, url); intent.putExtra(Constants.URL, url+ "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
context.startActivity(intent); context.startActivity(intent);
} }

View File

@ -320,12 +320,12 @@ public class RewardActivity extends AbsActivity {
} }
Intent intent = new Intent(context, RewardActivity.class); Intent intent = new Intent(context, RewardActivity.class);
Log.i("tag", url); Log.i("tag", url);
intent.putExtra(Constants.URL, url); intent.putExtra(Constants.URL, url+ "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
context.startActivity(intent); context.startActivity(intent);
} }
public static void forward(Context context, String url) { public static void forward(Context context, String url) {
forward(context, url+ "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"), true); forward(context, url, true);
} }
@Override @Override

View File

@ -282,7 +282,7 @@ public class ZhuangBanActivity extends AbsActivity {
} }
Intent intent = new Intent(context, ZhuangBanActivity.class); Intent intent = new Intent(context, ZhuangBanActivity.class);
Log.i("tag1212", url); Log.i("tag1212", url);
intent.putExtra(Constants.URL, url); intent.putExtra(Constants.URL, url+ "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"));
if (url.contains("Noble/index.html") || url.contains("Grade/index.html")) { if (url.contains("Noble/index.html") || url.contains("Grade/index.html")) {
intent.putExtra("title", ""); intent.putExtra("title", "");
} }
@ -290,7 +290,7 @@ public class ZhuangBanActivity extends AbsActivity {
} }
public static void forward(Context context, String url) { public static void forward(Context context, String url) {
forward(context, url+ "&isZh=" + ((IMLoginManager.get(CommonAppContext.sInstance.getBaseContext()).getLocaleLanguage() == Locale.SIMPLIFIED_CHINESE) ? "1" : "0"), true); forward(context, url, true);
} }
@Override @Override
@ -310,7 +310,7 @@ public class ZhuangBanActivity extends AbsActivity {
/** /**
* 复制到剪贴板 * 复制到剪贴板
*/ */
private void copy(String content) { private void copy(String content) {
ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE); ClipboardManager cm = (ClipboardManager) getSystemService(CLIPBOARD_SERVICE);
ClipData clipData = ClipData.newPlainText("text", content); ClipData clipData = ClipData.newPlainText("text", content);
cm.setPrimaryClip(clipData); cm.setPrimaryClip(clipData);