[8.2.8][i18n] 所有吐司 中文抽取

This commit is contained in:
xinfengkun
2025-11-12 19:35:55 +08:00
parent 08a5352df5
commit 8f6e8de77e
119 changed files with 1217 additions and 430 deletions

View File

@@ -11,6 +11,7 @@ import androidx.viewpager.widget.ViewPager
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.CountDownTimer
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.biz.R
import com.mogo.och.common.module.biz.media.data.MediaItem
import com.mogo.och.biz.media.video.MediaLoopPlayView.Companion.IMAGE_COUNT_DOWN_SECONDS
import com.mogo.och.biz.media.video.MediaLoopPlayView.Companion.TAG
@@ -361,7 +362,8 @@ class AdvancePagerAdapter(context: Context, viewPager: ViewPager) : PagerAdapter
if (mNewDataList.isNotEmpty()) {
setMediaData(mNewDataList)
mNewDataList.clear()
ToastUtils.showShort("宣传视频数据已更新")
// ToastUtils.showShort("宣传视频数据已更新")
ToastUtils.showShort(R.string.module_och_promotional_video_updated)
MediaPlayLogger.printInfoLog("playNextItemView, 宣传视频数据已更新")
return
}

View File

@@ -91,7 +91,8 @@ class ReportErrorPointView : WindowRelativeLayout,
tv_report_error_point_reason.onClick {
val checkDataList = errorPointItemAdapter.getCheckDataList()
if (checkDataList.isEmpty()) {
ToastUtils.showShort("请选择问题类型")
// ToastUtils.showShort("请选择问题类型")
ToastUtils.showShort(R.string.module_mogo_core_function_devatools_choose_issue_type)
return@onClick
}
tv_report_error_point_reason_cancel.isEnabled = false

View File

@@ -5,6 +5,7 @@ import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.data.BaseData
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.biz.R
import com.mogo.och.biz.routing.bean.PointError
import com.mogo.och.biz.routing.bean.QueryPointErrorReasonsRsp
import com.mogo.och.biz.routing.bean.SaveGrayContrailErrorReasons
@@ -89,7 +90,8 @@ class ReportErrorPointViewModel : ViewModel() {
object : OchCommonServiceCallback<BaseData> {
override fun onSuccess(data: BaseData?) {
if (data != null && data.code == 0){
ToastUtils.showShort("提交成功")
// ToastUtils.showShort("提交成功")
ToastUtils.showShort(R.string.module_och_submit_successfully)
viewCallback?.submitErrorReasons()
}
}

View File

@@ -11,6 +11,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.util.GsonUtils
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.biz.R
import com.mogo.och.biz.routing.bean.GrayLineBean
import com.mogo.och.biz.routing.bean.QueryGrayContrailListRsp
import com.mogo.och.biz.routing.bean.QuerySitesReasons
@@ -109,7 +110,8 @@ class RoutingSelectModel : ViewModel() {
"queryRoutingGrayLineList onFail: code=$code, msg=$msg"
)
OchChainLogManager.writeChainLogRouting("[查询灰度路线]","[查询灰度路线] 请求fail, code=$code, msg=$msg, sn=${SharedPrefsMgr.getInstance().sn}")
ToastUtils.showShort("查询灰度线路列表异常, 请稍后重试, code=$code")
// ToastUtils.showShort("查询灰度线路列表异常, 请稍后重试, code=$code")
ToastUtils.showShort(R.string.module_och_query_routing_gray_line_list_fail, code)
viewCallback?.onQueryRoutingGrayLineListFailed(msg ?: "查询灰度线路列表异常, 请稍后重试")
}
@@ -191,7 +193,8 @@ class RoutingSelectModel : ViewModel() {
val grayId = data.taskId
val stationList = data.stationList
if (grayLineBean == null || contrailBean == null || stationList.size < 2) {
ToastUtils.showShort("灰度线路或轨迹信息异常,请稍后再试")
// ToastUtils.showShort("灰度线路或轨迹信息异常,请稍后再试")
ToastUtils.showShort(R.string.module_och_query_routing_gray_line_error)
OchChainLogManager.writeChainLogRouting("[开始任务]","[开始任务] 灰度线路或轨迹信息异常,请稍后再试")
return
}

View File

@@ -96,7 +96,8 @@ class RoutingSelectView: ConstraintLayout, SwtichRoutingViewCallback, InputTextC
RoutingItemAdapter.LineItemClickListener {
override fun onItemClick(data: GrayLineBean) {
if(data.contrailId==null||data.contrailId!!<=0L){
ToastUtils.showShort("请设置轨迹信息")
// ToastUtils.showShort("请设置轨迹信息")
ToastUtils.showShort(R.string.module_och_please_set_trajectory_info)
}
OchChainLogManager.writeChainLogRouting("[选择灰度任务]","[选择灰度任务] 当前选择 ${data} ")
resetStatus()
@@ -255,7 +256,8 @@ class RoutingSelectView: ConstraintLayout, SwtichRoutingViewCallback, InputTextC
mRoutingLineList.clear()
mRoutingLineList.addAll(data)
mChooseLineListAdapter.notifyDataSetChanged()
ToastUtils.showShort("刷新成功")
// ToastUtils.showShort("刷新成功")
ToastUtils.showShort(R.string.module_och_please_refresh_success)
} else {
showEmptyView()
}

View File

@@ -226,7 +226,8 @@ class TaskRunningView : ConstraintLayout, TaskRunningModel.SwtichLineViewCallbac
* 服务完成
*/
override fun onSubmitEndTaskSuccess() {
ToastUtils.showLong("结束任务成功")
// ToastUtils.showLong("结束任务成功")
ToastUtils.showLong(R.string.module_och_task_finish_success)
RoutingServiceManager.invokeCallback(false)
// 移除高德导航计算距离
AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi()

View File

@@ -271,7 +271,8 @@ class TaxiRunningView: ConstraintLayout, TaxiRunningModel.RoutingRuningCallback,
}
override fun onSubmitEndTaskSuccess() {
ToastUtils.showLong("结束任务成功")
// ToastUtils.showLong("结束任务成功")
ToastUtils.showLong(R.string.module_och_task_finish_success)
RoutingServiceManager.invokeCallback(false)
// 移除高德导航计算距离
AmapNaviToDestinationModel.getInstance(context).destroyAmaNavi()

View File

@@ -8,6 +8,7 @@ import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.function.call.autopilot.CallerAutoPilotControlManager
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bridge.R
import com.mogo.och.bridge.autopilot.OCHAdasAbilityManager
import com.mogo.och.bridge.autopilot.autopilot.bean.SessionWithTime
import com.mogo.och.bridge.autopilot.line.LineManager
@@ -52,7 +53,8 @@ object OchAutoPilotManager {
clearGlobalSessionId("检测session 自带的时间 ${currentTimeMillis}_${sessionInfo.setTime}_${sessionInfo.sessionId}")
return true
}else{
ToastUtils.showLong("自驾启动中,请勿重复点击")
// ToastUtils.showLong("自驾启动中,请勿重复点击")
ToastUtils.showLong(R.string.module_och_autopilot_starting_not_click)
OchAutopilotAnalytics.triggerCanStartAutopilotBySessionId(globalSessionId.get())
return false
}

View File

@@ -23,6 +23,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.bridge.R
import com.mogo.och.common.module.constant.OchCommonConst
import com.mogo.och.bridge.autopilot.OCHAdasAbilityManager
import com.mogo.och.bridge.autopilot.autopilot.OchAutoPilotManager
@@ -456,7 +457,8 @@ object LineManager : CallerBase<ILineCallback>() {
}
CallerLogger.d(TAG, "${parameters?.wayLatLons}\n${parameters?.blackLatLons}")
if (parameters == null) {
ToastUtils.showShort("未设置起始或终点站点")
// ToastUtils.showShort("未设置起始或终点站点")
ToastUtils.showShort(R.string.module_och_not_stat_and_end_point)
}
return parameters
}
@@ -533,13 +535,15 @@ object LineManager : CallerBase<ILineCallback>() {
fun startAutopilot() {
if (startStation == null || endStation == null) {
ToastUtils.showShort("未设置起始或终点站点")
// ToastUtils.showShort("未设置起始或终点站点")
ToastUtils.showShort(R.string.module_och_not_stat_and_end_point)
return
}
startStation?.let {
if (!it.isLeaving) {
ToastUtils.showShort("请滑动出发后再启动自驾")
// ToastUtils.showShort("请滑动出发后再启动自驾")
ToastUtils.showShort(R.string.module_och_please_slide_hint)
return
}
}
@@ -555,14 +559,16 @@ object LineManager : CallerBase<ILineCallback>() {
//1、判断轨迹url是否可用
if (_contraiInfo == null) {
ToastUtils.showLong("无发布轨迹, 请发布后重试")
// ToastUtils.showLong("无发布轨迹, 请发布后重试")
ToastUtils.showLong(R.string.module_taxi_no_publication_trajectory)
return
} else {
if (FunctionBuildConfig.isPassStartAutopilotCommand
&& TextUtils.isEmpty(_contraiInfo!!.csvFileUrl)
&& TextUtils.isEmpty(_contraiInfo!!.csvFileMd5)
) {
ToastUtils.showLong("无发布轨迹, 请发布后重试")
// ToastUtils.showLong("无发布轨迹, 请发布后重试")
ToastUtils.showLong(R.string.module_taxi_no_publication_trajectory)
e(
TAG, "isPassStartAutopilotCommand = " +
FunctionBuildConfig.isPassStartAutopilotCommand
@@ -685,7 +691,8 @@ object LineManager : CallerBase<ILineCallback>() {
} else {
// 地盘有但是和och出不一样
// todo 需要och 重新出发轨迹下载操作
ToastUtils.showShort("${autopilotIdFromFsm}_${teleOrderId}_自动驾驶id不同请排查")
// ToastUtils.showShort("${autopilotIdFromFsm}_${teleOrderId}_自动驾驶id不同请排查")
ToastUtils.showShort(R.string.module_och_autopilot_id_diff, autopilotIdFromFsm, teleOrderId)
OchChainLogManager.writeChainLogAutopilot(
"自驾Id",
"${autopilotIdFromFsm}_${teleOrderId}_自动驾驶id不同请排查"

View File

@@ -12,6 +12,7 @@ import com.mogo.eagle.core.function.main.MainPresenter
import com.mogo.eagle.core.utilcode.mogo.permissions.PermissionsDialogUtils
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.R
import com.mogo.och.common.module.utils.PermissionUtil
open class BaseBluetoothManager {
@@ -48,7 +49,8 @@ open class BaseBluetoothManager {
return BluetoothState.OFF
}
}
ToastUtils.showShort("设备无蓝牙硬件")
// ToastUtils.showShort("设备无蓝牙硬件")
ToastUtils.showShort(R.string.module_och_not_bluetooth)
return BluetoothState.NONE
}

View File

@@ -12,6 +12,7 @@ import android.bluetooth.BluetoothProfile
import android.util.Log
import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.mogo.och.common.module.R
import com.mogo.och.common.module.manager.logchainanalytic.OchChainLogManager
import com.mogo.och.common.module.utils.RxUtils
import io.reactivex.disposables.Disposable
@@ -190,7 +191,8 @@ class OchBluetoothGattCallback(device: BluetoothDevice) : BluetoothGattCallback(
return null
}
val service = mBluetoothGatt!!.getService(uuid)
if (service == null) ToastUtils.showShort("没有找到服务UUID=$uuid")
// if (service == null) ToastUtils.showShort("没有找到服务UUID=$uuid")
if (service == null) ToastUtils.showShort(R.string.module_och_bluetooth_not_find_uuid, "$uuid")
return service
}
@@ -223,7 +225,8 @@ class OchBluetoothGattCallback(device: BluetoothDevice) : BluetoothGattCallback(
fun connectGattAndSend(data: String) {
RxUtils.disposeSubscribe(timeoutCLose)
if(isConnected){
ToastUtils.showShort("已连接成功")
// ToastUtils.showShort("已连接成功")
ToastUtils.showShort(R.string.module_och_bluetooth_connected)
OchChainLogManager.writeChainLogWriteOff("司机端核销成功","已连接成功")
waitSendData[data] = BleManager.UUID_CHAR_WRITE
sendData()

View File

@@ -43,7 +43,8 @@ class DebugViewWatchDogFragment :
actv_password_submit.setOnClickListener {
val text = acet_close.text
if(text==null||text.isEmpty()){
ToastCharterUtils.showToastShort("请输入密码")
// ToastCharterUtils.showToastShort("请输入密码")
ToastCharterUtils.showToastShort(R.string.module_och_input_pwd)
}else{
if(text.toString() == "123987"){
dismissAllowingStateLoss()
@@ -52,7 +53,8 @@ class DebugViewWatchDogFragment :
}
ToggleDebugView.toggleDebugView.toggle(requireContext())
}else{
ToastCharterUtils.showToastShort("请输入正确密码")
// ToastCharterUtils.showToastShort("请输入正确密码")
ToastCharterUtils.showToastShort(R.string.module_och_input_pwd_error)
}
}
}

View File

@@ -9,6 +9,8 @@ import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger.i
import com.mogo.eagle.core.utilcode.util.NetworkUtils
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.och.common.module.R
import com.mogo.och.common.module.utils.PermissionUtil
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import io.reactivex.Observable
@@ -36,9 +38,11 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
return@observable
}
if (newValue) {
ToastCharterUtils.showToastLong("长链接状态恢复")
// ToastCharterUtils.showToastLong("长链接状态恢复")
ToastCharterUtils.showToastLong(R.string.module_och_long_link_status_restored)
} else {
ToastCharterUtils.showToastLong("长链接异常,请开启相应权限或者查看网络")
// ToastCharterUtils.showToastLong("长链接异常,请开启相应权限或者查看网络")
ToastCharterUtils.showToastLong(R.string.module_och_long_link_error)
}
}
@@ -82,13 +86,16 @@ object AbnormalFactorsLoopManager : IMogoStatusChangedListener {
//长链接状态 socketStatus
var toastStr = ""
if (!locationStatusPermsStatus) toastStr += "定位服务异常 "
if (!networkStatus) toastStr += " 网络异常 "
// if (!locationStatusPermsStatus) toastStr += "定位服务异常 "
if (!locationStatusPermsStatus) toastStr += StringUtils.getString(R.string.module_och_location_service_error)
// if (!networkStatus) toastStr += " 网络异常 "
if (!networkStatus) toastStr += StringUtils.getString(R.string.module_och_network_service_error)
i(TAG, "abnormal_factors_Str = $toastStr")
if (!FunctionBuildConfig.isDemoMode && toastStr !== "") {
ToastCharterUtils.showToastLong(toastStr + "请开启相应权限或者查看网络")
// ToastCharterUtils.showToastLong(toastStr + "请开启相应权限或者查看网络")
ToastCharterUtils.showToastLong(R.string.module_och_please_open_permission, toastStr)
}
}

View File

@@ -13,6 +13,7 @@ import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.permissions.PermissionsDialogUtils
import com.mogo.eagle.core.utilcode.util.ActivityUtils
import com.mogo.och.common.module.R
import com.mogo.och.common.module.utils.PermissionUtil
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils
import com.mogo.tts.base.zhi.AsrTextBean
@@ -165,7 +166,8 @@ object ZhiStateManager : ZhiRecordWinUi {
return
}
if (!isFastClick()) {
ToastCharterUtils.showToastShort("请稍后唤醒")
// ToastCharterUtils.showToastShort("请稍后唤醒")
ToastCharterUtils.showToastShort(R.string.module_och_please_wait_wake_up)
return
}
if (PermissionUtil.checkPermission(AbsMogoApplication.getApp(), Manifest.permission.RECORD_AUDIO)) {

View File

@@ -26,6 +26,7 @@ import com.mogo.commons.AbsMogoApplication;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import com.mogo.och.common.module.R;
import com.mogo.och.common.module.utils.PermissionUtil;
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils;
@@ -175,14 +176,16 @@ public class AmapNaviToDestinationModel implements AMapNaviListener {
}
}
if (!NetworkUtils.isConnected(AbsMogoApplication.getApp()) || result.getErrorCode() == 2) {
ToastCharterUtils.showToastShort("网络异常,请重试");
// ToastCharterUtils.showToastShort("网络异常,请重试");
ToastCharterUtils.showToastShort(R.string.module_och_network_error_retry);
if (mNaviChangedCallback != null) {
mNaviChangedCallback.reInitNaviAmap(isPlay, false);
}
return;
}
if (!PermissionUtil.isLocServiceEnable(AbsMogoApplication.getApp()) || !PermissionUtil.checkPermission(AbsMogoApplication.getApp(), new String[]{Manifest.permission.ACCESS_FINE_LOCATION})) {
ToastCharterUtils.showToastShort("请开启车机定位后重试");
// ToastCharterUtils.showToastShort("请开启车机定位后重试");
ToastCharterUtils.showToastShort(R.string.module_och_open_location_permission_retry);
if (mNaviChangedCallback != null) {
mNaviChangedCallback.reInitNaviAmap(isPlay, false);
}

View File

@@ -4,6 +4,7 @@ import android.content.Context;
import com.mogo.commons.debug.DebugConfig;
import com.mogo.eagle.core.utilcode.util.NetworkUtils;
import com.mogo.och.common.module.R;
import com.mogo.och.common.module.wigets.toast.ToastCharterUtils;
public class ToastUtilsOch {
@@ -36,7 +37,8 @@ public class ToastUtilsOch {
public static void toastRequestError(Context context,String failMsg){
if (!NetworkUtils.isConnected(context)) {
ToastCharterUtils.showToastShort("网络异常,请稍后重试");
// ToastCharterUtils.showToastShort("网络异常,请稍后重试");
ToastCharterUtils.showToastShort(R.string.module_och_network_error_retry1);
}else {
ToastCharterUtils.showToastShort(failMsg);
}

View File

@@ -23,7 +23,8 @@ class CommonFeedbackDialog : BaseFloatDialog, LifecycleObserver {
private var listener:Listener?=null
private var mRunnable:Runnable= Runnable {
ToastUtils.showLong("超时未响应,请求失败")
// ToastUtils.showLong("超时未响应,请求失败")
ToastUtils.showLong(R.string.module_och_timeout)
}
constructor(builder: Builder, context: Context) : super(context) {

View File

@@ -30,6 +30,22 @@ object ToastCharterUtils {
}, UiThreadHandler.MODE.QUEUE)
}
@JvmStatic
fun showToastLong(@StringRes resId: Int) {
val string = StringUtils.getString(resId)
string?.let {
showToastLong(it)
}
}
@JvmStatic
fun showToastLong(@StringRes resId: Int, vararg args: Any?) {
val string = StringUtils.getString(resId, args)
string?.let {
showToastLong(it)
}
}
@JvmStatic
fun showToastShort(toastText: String?){
CallerLogger.d(SceneConstant.M_OCHCOMMON + TAG,"showToastShort吐司内容${toastText}")
@@ -60,6 +76,12 @@ object ToastCharterUtils {
}
fun showCharterLongToast(@StringRes resId: Int) {
val string = StringUtils.getString(resId)
string?.let {
showCharterLongToast(it)
}
}
fun showCharterLongToast(toastText: String) {
val context = ActivityUtils.getTopActivity()
val marker = ToastCharterView(context)