[Modify]整理中文

This commit is contained in:
wushaocheng
2023-05-04 21:27:44 +08:00
parent bcf486e630
commit c66b314102
152 changed files with 758 additions and 610 deletions

View File

@@ -1328,13 +1328,13 @@ public final class IMNetEaseManager {
if (second == CUSTOM_MSG_LUCKY_SEA_GIFT_ROOM_NOTIFY) {
addMessages(msg);
noticeRoomEvent(msg, RoomEvent.LUCKY_SEA_GIFT_ROOM_NOTIFY);
}else if(second == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_NOTIFY){
} else if (second == CUSTOM_MSG_LUCKY_SEA_GIFT_SERVER_NOTIFY) {
addMessages(msg);
noticeRoomEvent(msg, RoomEvent.LUCKY_SEA_GIFT_SERVER_NOTIFY);
}
break;
case ROOM_FREE_GIFT:
if(second == ROOM_FREE_GIFT_CHANGE){
if (second == ROOM_FREE_GIFT_CHANGE) {
RoomFreeGiftAttachment freeGiftAttachment = (RoomFreeGiftAttachment) attachment;
RoomFreeGiftMsgBean bean = freeGiftAttachment.getRoomFreeGiftMsgInfo();
EventBus.getDefault().post(new UpdateKnapFreeGiftDataEvent(bean));
@@ -1919,7 +1919,7 @@ public final class IMNetEaseManager {
chatRoomMessage.setNIMAntiSpamOption(antiSpamOption);
if (AntiSpamUtil.checkLocalAntiSpam(chatRoomMessage)) {
EventBus.getDefault().post(new AntiSpamEvent());
return Single.error(new AntiSpamHitException("檢測到敏感詞,需要過濾,不能發送"));
return Single.error(new AntiSpamHitException(ResUtil.getString(R.string.sensitive_word_detected)));
} else {
return sendChatRoomMessage(chatRoomMessage, false);
}
@@ -2057,7 +2057,7 @@ public final class IMNetEaseManager {
@Override
public void onFailed(int code) {
e.onError(new Exception("錯誤碼: " + code));
e.onError(new Exception(ResUtil.getString(R.string.error_code) + code));
}
@Override
@@ -2170,9 +2170,9 @@ public final class IMNetEaseManager {
@Override
public void onFailed(int i) {
if (i == 417) {
SingleToastUtil.showToast("重復操作~");
SingleToastUtil.showToast(ResUtil.getString(R.string.repetitive_operation));
} else {
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), "操作失敗,請重試");
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), ResUtil.getString(R.string.please_try_again));
}
if (callBack != null) {
callBack.onFail(i, "");
@@ -2181,7 +2181,7 @@ public final class IMNetEaseManager {
@Override
public void onException(Throwable throwable) {
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), "操作失敗,請重試");
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), ResUtil.getString(R.string.please_try_again));
if (callBack != null) {
callBack.onFail(-1, throwable.getMessage());
}
@@ -2211,9 +2211,9 @@ public final class IMNetEaseManager {
@Override
public void onFailed(int i) {
if (i == 417) {
SingleToastUtil.showToast(mark ? "對方已經是管理員了" : "移除管理員成功");
SingleToastUtil.showToast(mark ? ResUtil.getString(R.string.already_the_administrator) : ResUtil.getString(R.string.succeeded_in_removing_an_administrator));
} else {
SingleToastUtil.showToast("操作失敗,請重試");
SingleToastUtil.showToast(ResUtil.getString(R.string.please_try_again));
}
if (callBack != null) {
callBack.onFail(i, "");
@@ -2222,7 +2222,7 @@ public final class IMNetEaseManager {
@Override
public void onException(Throwable throwable) {
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), "操作失敗,請重試");
SingleToastUtil.showToast(BasicConfig.INSTANCE.getAppContext(), ResUtil.getString(R.string.please_try_again));
if (callBack != null) {
callBack.onFail(-1, throwable.getMessage());
}
@@ -2246,7 +2246,7 @@ public final class IMNetEaseManager {
@Override
public void onSuccess(Entry<String, String> stringStringEntry) {
if (callBack != null)
callBack.onSuccess("下麥成功");
callBack.onSuccess(ResUtil.getString(R.string.successful_harvest));
//下麥接口
GiftValueMrg.get().requestDownMic(micPosition, downMicUid);
@@ -2256,14 +2256,14 @@ public final class IMNetEaseManager {
@Override
public void onFailed(int i) {
if (callBack != null) {
callBack.onFail(-1, "下麥失敗");
callBack.onFail(-1, ResUtil.getString(R.string.failure_to_harvest_wheat));
}
}
@Override
public void onException(Throwable throwable) {
if (callBack != null) {
callBack.onFail(-1, "下麥異常:" + throwable.getMessage());
callBack.onFail(-1, ResUtil.getString(R.string.abnormal_wheat_harvest) + throwable.getMessage());
}
}
});
@@ -2287,9 +2287,9 @@ public final class IMNetEaseManager {
if (result.exception != null)
e.onError(result.exception);
else if (result.code != BaseMvpModel.RESULT_OK)
e.onError(new Throwable("錯誤碼: " + result.code));
e.onError(new Throwable(ResUtil.getString(R.string.error_code) + result.code));
else {
e.onSuccess("下麥回調成功");
e.onSuccess(ResUtil.getString(R.string.the_wheat_callback_succeeded));
}
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread())
.doOnSuccess(s -> GiftValueMrg.get().requestDownMic(micPosition, downMicUid));
@@ -2341,9 +2341,9 @@ public final class IMNetEaseManager {
if (result.exception != null)
e.onError(result.exception);
else if (result.code != BaseMvpModel.RESULT_OK)
e.onError(new Exception("錯誤碼: " + result.code));
e.onError(new Exception(ResUtil.getString(R.string.error_code) + result.code));
else {
e.onSuccess("黑名單處理回調成功");
e.onSuccess(ResUtil.getString(R.string.the_blacklist_processing_callback_succeeded));
}
}).subscribeOn(Schedulers.io()).observeOn(AndroidSchedulers.mainThread());
}
@@ -2367,12 +2367,12 @@ public final class IMNetEaseManager {
.setCallback(new RequestCallback<Void>() {
@Override
public void onSuccess(Void param) {
e.onSuccess("踢人出房間回調成功");
e.onSuccess(ResUtil.getString(R.string.kick_out_of_room_callback_successful));
}
@Override
public void onFailed(int code) {
e.onError(new Exception("錯誤碼: " + code));
e.onError(new Exception(ResUtil.getString(R.string.error_code) + code));
}
@Override
@@ -2537,7 +2537,7 @@ public final class IMNetEaseManager {
String level = (String) NobleUtil.getResource(NobleResourceType.KEY_LEVEL, roomQueueInfo.mChatRoomMember);
String name = NobleUtil.getNobleName(level);
if (!NobleUtil.canKickMicroOrNot(level)) {
return Single.error(new Exception(name + "不能被踢下麥"));
return Single.error(new Exception(name + ResUtil.getString(R.string.get_kicked_off_the_mic)));
}
}
return sendChatRoomMessage(message, false);
@@ -2663,7 +2663,7 @@ public final class IMNetEaseManager {
@Override
public void onFailed(int code) {
e.onError(new Exception("錯誤碼: " + code));
e.onError(new Exception(ResUtil.getString(R.string.error_code) + code));
}
@Override
@@ -2778,7 +2778,7 @@ public final class IMNetEaseManager {
@Override
public void onFailed(int code) {
e.onError(new Exception("錯誤碼: " + code));
e.onError(new Exception(ResUtil.getString(R.string.error_code) + code));
}
@Override
@@ -2806,7 +2806,7 @@ public final class IMNetEaseManager {
@Override
public void onFailed(int code) {
e.onError(new Exception("錯誤碼: " + code));
e.onError(new Exception(ResUtil.getString(R.string.error_code) + code));
}
@Override
@@ -2901,10 +2901,10 @@ public final class IMNetEaseManager {
}
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
inAppSharingRoomInfo.setInfo(currentRoomInfo);
inAppSharingRoomInfo.setTitle(String.format("我想邀請你進入:%1$s, 和我一起愉快的玩耍~",
inAppSharingRoomInfo.setTitle(String.format(ResUtil.getString(R.string.like_to_invite_you_in),
currentRoomInfo.getTitle()));
inAppSharingRoomInfo.setAvatar(currentRoomInfo.getAvatar() != null ? currentRoomInfo.getAvatar() : "");
inAppSharingRoomInfo.setActionName("立即進入");
inAppSharingRoomInfo.setActionName(ResUtil.getString(R.string.immediate_access));
inAppSharingRoomInfo.setRouterType(RouterType.ROOM);
inAppSharingRoomInfo.setRouterValue(String.valueOf(currentRoomInfo.getUid()));
InAppSharingRoomAttachment attachment = new InAppSharingRoomAttachment();
@@ -2936,10 +2936,10 @@ public final class IMNetEaseManager {
InAppSharingFamilyInfo inAppSharingFamilyInfo = new InAppSharingFamilyInfo();
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
inAppSharingFamilyInfo.setInfo(temp);
inAppSharingFamilyInfo.setTitle(String.format("我想邀請你加入:%1$s, 和我一起愉快的玩耍~",
inAppSharingFamilyInfo.setTitle(String.format(ResUtil.getString(R.string.like_to_invite_you_in),
temp.getFamilyName()));
inAppSharingFamilyInfo.setAvatar(temp.getFamilyIcon() != null ? temp.getFamilyIcon() : "");
inAppSharingFamilyInfo.setActionName("立即加入");
inAppSharingFamilyInfo.setActionName(ResUtil.getString(R.string.immediate_access));
inAppSharingFamilyInfo.setRouterType(RouterType.FAMILY);
inAppSharingFamilyInfo.setRouterValue(temp.getFamilyId());
InAppSharingFamilyAttachment attachment = new InAppSharingFamilyAttachment();
@@ -2967,13 +2967,13 @@ public final class IMNetEaseManager {
String showTitle;
if (detailInfo.isInWorld() && currentMember != null) {
String worldName = TextUtils.isEmpty(detailInfo.getName()) ? "" : detailInfo.getName();
showTitle = "作為" + worldName + "的第" + currentMember.getMemberNo() + "位成員,世界那麼大,我想帶你一起去看看~";
showTitle = ResUtil.getString(R.string.as_what) + "" + worldName + "" + ResUtil.getString(R.string.control_of) + currentMember.getMemberNo() + ResUtil.getString(R.string.want_to_take_you_to_see);
} else {
showTitle = "世界那麼大,我想帶你一起去看看~";
showTitle = ResUtil.getString(R.string.the_world_is_so_big);
}
inAppSharingMiniWorldInfo.setTitle(showTitle);
inAppSharingMiniWorldInfo.setAvatar(TextUtils.isEmpty(detailInfo.getIcon()) ? "" : detailInfo.getIcon());
inAppSharingMiniWorldInfo.setActionName("立即加入");
inAppSharingMiniWorldInfo.setActionName(ResUtil.getString(R.string.join_immediately));
inAppSharingMiniWorldInfo.setRouterType(RouterType.MINI_WORLD_DETAIL);
inAppSharingMiniWorldInfo.setRouterValue(String.valueOf(detailInfo.getId()));
InAppSharingMiniWorldAttachment attachment = new InAppSharingMiniWorldAttachment();
@@ -2999,10 +2999,10 @@ public final class IMNetEaseManager {
InAppSharingTeamInfo inAppSharingTeamInfo = new InAppSharingTeamInfo();
UserInfo userInfo = UserModel.get().getCacheLoginUserInfo();
inAppSharingTeamInfo.setInfo(teamInfo);
inAppSharingTeamInfo.setTitle(String.format("我想邀請你加入:%1$s, 和我一起愉快的玩耍~",
inAppSharingTeamInfo.setTitle(String.format(ResUtil.getString(R.string.like_to_invite_you_in),
teamInfo.getName()));
inAppSharingTeamInfo.setAvatar(userInfo != null ? userInfo.getAvatar() : "");
inAppSharingTeamInfo.setActionName("立即加入");
inAppSharingTeamInfo.setActionName(ResUtil.getString(R.string.join_immediately));
inAppSharingTeamInfo.setRouterType(RouterType.TEAM);
inAppSharingTeamInfo.setRouterValue(teamInfo.getId());
InAppSharingTeamAttachment attachment = new InAppSharingTeamAttachment();

View File

@@ -1,5 +1,8 @@
package com.yizhuan.xchat_android_core.treasurefairy
import com.yizhuan.xchat_android_core.R
import com.yizhuan.xchat_android_library.utils.ResUtil
data class ExchangeGiftInfo(
val expendNum: Int = 0,
val itemId: Long = 0,
@@ -18,7 +21,7 @@ data class ExchangeGiftInfo(
fun getPrizeName(): String {
return if (rewardType == "gift") {
"${rewardName}(${rewardShowValue})"
"${rewardName}(${rewardShowValue}${ResUtil.getString(R.string.diamond)})"
} else {
"${rewardName}(${rewardNum}${rewardUnit})"
}
@@ -26,7 +29,7 @@ data class ExchangeGiftInfo(
fun getPrizeUnit(): String {
return if (rewardType == "gift") {
"${rewardShowValue}"
"${rewardShowValue}${ResUtil.getString(R.string.diamond)}"
} else {
"${rewardNum}${rewardUnit}"
}

View File

@@ -9,6 +9,7 @@ import com.netease.nimlib.sdk.chatroom.constant.MemberQueryType;
import com.netease.nimlib.sdk.chatroom.constant.MemberType;
import com.netease.nimlib.sdk.chatroom.model.ChatRoomMember;
import com.orhanobut.logger.Logger;
import com.yizhuan.xchat_android_core.R;
import com.yizhuan.xchat_android_core.auth.AuthModel;
import com.yizhuan.xchat_android_core.bean.RoomQueueInfo;
import com.yizhuan.xchat_android_core.bean.response.ServiceResult;
@@ -24,6 +25,7 @@ import com.yizhuan.xchat_android_core.utils.net.RxHelper;
import com.yizhuan.xchat_android_library.net.rxnet.RxNet;
import com.yizhuan.xchat_android_library.net.rxnet.callback.CallBack;
import com.yizhuan.xchat_android_library.utils.ListUtils;
import com.yizhuan.xchat_android_library.utils.ResUtil;
import com.yizhuan.xchat_android_library.utils.SingleToastUtil;
import java.util.List;
@@ -89,7 +91,7 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
.setCallback(new RequestCallbackWrapper<Void>() {
@Override
public void onResult(int i, Void aVoid, Throwable throwable) {
Logger.i("%1$s房間更新麥序%2$s成功", roomId, key);
Logger.i(ResUtil.getString(R.string.the_room_is_updated_with_wheat), roomId, key);
}
});
}
@@ -164,7 +166,7 @@ public class HomePartyModel extends RoomBaseModel implements IHomePartyModel {
String resource = (String) NobleUtil.getResource(NobleResourceType.KEY_LEVEL, roomQueueInfo.mChatRoomMember);
if (!TextUtils.isEmpty(resource)) {
if (!NobleUtil.canKickMicroOrNot(Integer.valueOf(resource))) {
String tips = "不能禁麥" + NobleUtil.getNobleName(Integer.valueOf(resource)) + "陛下哦";
String tips = ResUtil.getString(R.string.wheat_cannot_be_banned) + NobleUtil.getNobleName(Integer.valueOf(resource)) + ResUtil.getString(R.string.your_majesty);
SingleToastUtil.showToastShort(tips);
return Single.error(new Throwable(tips));
}

View File

@@ -167,7 +167,7 @@ public class ShareModel extends BaseModel implements IShareModel {
try {
ClipboardManager cm = (ClipboardManager) getContext().getSystemService(Context.CLIPBOARD_SERVICE);
cm.setPrimaryClip(ClipData.newPlainText("text", siteUrl));
emitter.onSuccess("已複製");
emitter.onSuccess(ResUtil.getString(R.string.have_copy));
} catch (Exception e) {
Logger.info("copyText", String.valueOf(e));
emitter.onError(new Throwable(String.valueOf(e)));

View File

@@ -666,4 +666,30 @@
<string name="wechat_share_content">Find and join the best groups,talk with strangers</string>
<string name="data_parsing_exception">數據解析異常</string>
<string name="parameter_error">參數錯誤</string>
<string name="sensitive_word_detected">檢測到敏感詞,需要過濾,不能發送</string>
<string name="error_code">錯誤碼:\u3000</string>
<string name="repetitive_operation">重復操作~</string>
<string name="please_try_again">操作失敗,請重試</string>
<string name="already_the_administrator">對方已經是管理員了</string>
<string name="succeeded_in_removing_an_administrator">移除管理員成功</string>
<string name="failure_to_harvest_wheat">下麥失敗</string>
<string name="abnormal_wheat_harvest">下麥異常:</string>
<string name="successful_harvest">下麥成功</string>
<string name="the_wheat_callback_succeeded">下麥回調成功</string>
<string name="the_blacklist_processing_callback_succeeded">黑名單處理回調成功</string>
<string name="kick_out_of_room_callback_successful">踢人出房間回調成功</string>
<string name="get_kicked_off_the_mic">不能被踢下麥</string>
<string name="like_to_invite_you_in">我想邀請你進入:%1$s, 和我一起愉快的玩耍~</string>
<string name="immediate_access">立即進入</string>
<string name="as_what">作為</string>
<string name="control_of">的第</string>
<string name="want_to_take_you_to_see">位成員,世界那麼大,我想帶你一起去看看~</string>
<string name="the_world_is_so_big">世界那麼大,我想帶你一起去看看~</string>
<string name="join_immediately">立即加入</string>
<string name="the_room_is_updated_with_wheat">%1$s房間更新麥序%2$s成功</string>
<string name="wheat_cannot_be_banned">不能禁麥</string>
<string name="your_majesty">陛下哦</string>
<string name="have_copy">已複製</string>
<string name="diamond"></string>
</resources>