[8.2.8][i18n] mogo-core-data mogo-core-function-call mogo-core-function-network mogo-core-utils OCH/common 中文抽取

This commit is contained in:
xinfengkun
2025-11-27 16:13:53 +08:00
parent 64a4f00a73
commit 573ae14aa6
17 changed files with 197 additions and 73 deletions

View File

@@ -22,6 +22,7 @@ import com.mogo.eagle.core.utilcode.kotlin.lifeCycleScope
import com.mogo.eagle.core.utilcode.mogo.AppIdentityModeUtils
import com.mogo.eagle.core.utilcode.mogo.logger.Logger
import com.mogo.eagle.core.utilcode.util.AppStateManager
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ToastUtils
import com.zhjt.mogo.adas.common.power.PowerUnitChannel
import com.zhjt.mogo.adas.data.Adas
@@ -109,24 +110,31 @@ object CallerAutoPilotControlManager {
var isPlayTTS = true
if (exceptionValue != 0) {
if (isShowTip) {
val sb = StringBuilder("请检查车辆")
// val sb = StringBuilder("请检查车辆")
val sb = StringBuilder(StringUtils.getString(R.string.module_core_check_vehicle))
if ((exceptionValue and 1) != 0) {
sb.append("FSM$")
// sb.append("FSM$")
sb.append(StringUtils.getString(R.string.module_core_fsm)).append("$")
}
if ((exceptionValue and (1 shl 1)) != 0) {
sb.append("方向盘$")
// sb.append("方向盘$")
sb.append(StringUtils.getString(R.string.module_core_chassis_steering)).append("$")
}
if (((exceptionValue and (1 shl 2)) != 0)) {
sb.append("油门$")
// sb.append("油门$")
sb.append(StringUtils.getString(R.string.module_core_chassis_throttle)).append("$")
}
if ((exceptionValue and (1 shl 3)) != 0) {
sb.append("刹车$")
// sb.append("刹车$")
sb.append(StringUtils.getString(R.string.module_core_chassis_brake)).append("$")
}
if ((exceptionValue and (1 shl 4)) != 0) {
sb.append("双闪$")
// sb.append("双闪$")
sb.append(StringUtils.getString(R.string.module_core_chassis_hazard_lights)).append("$")
}
if ((exceptionValue and (1 shl 5)) != 0) {
sb.append("档位$")
// sb.append("档位$")
sb.append(StringUtils.getString(R.string.module_core_chassis_gear)).append("$")
}
if ((exceptionValue and (1 shl 6)) != 0) {
if (!sb.contains("$")) {
@@ -141,7 +149,8 @@ object CallerAutoPilotControlManager {
if ((exceptionValue and (1 shl 7)) != 0 || ((exceptionValue and (1 shl 8)) != 0)) {
if (!sb.contains("$")) {
sb.setLength(0)
sb.append("轨迹未就绪,请稍后重试")
// sb.append("轨迹未就绪,请稍后重试")
sb.append(StringUtils.getString(R.string.module_core_trajectory_not_ready))
}
}

View File

@@ -5,9 +5,11 @@ import chassis.VehicleStateOuterClass
import com.google.protobuf.TextFormat
import com.mogo.commons.AbsMogoApplication
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotActionsListener
import com.mogo.eagle.core.function.call.R
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_D_C
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.zhjt.mogo.adas.data.bean.LaunchConditionData
import com.zhjt.mogo.adas.data.bean.UnableLaunchReason
import org.json.JSONException
@@ -58,7 +60,8 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
UnableLaunchReason.UnableType.DISCONNECTED,
object : ArrayList<String>() {
init {
add("未连接自动驾驶系统")
// add("未连接自动驾驶系统")
add(StringUtils.getString(R.string.module_core_ununited_ipc))
}
}
)
@@ -97,28 +100,32 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
)
}
//制动踏板
var temp = "未知"
// var temp = "未知"
var temp = StringUtils.getString(R.string.module_core_unknown)
if (chassisStates!!.hasBrakeSystemStates()) {
val brake = chassisStates!!.brakeSystemStates.brakePedalResponsePosition
temp = brake.toString()
}
chassisStatesObject.put("brake", temp)
//油门踏板
temp = "未知"
// temp = "未知"
temp = StringUtils.getString(R.string.module_core_unknown)
if (chassisStates!!.hasDrivingSystemStates()) {
val throttle = chassisStates!!.drivingSystemStates.throttleResponsePosition
temp = throttle.toString()
}
chassisStatesObject.put("throttle", temp)
//档位
temp = "未知"
// temp = "未知"
temp = StringUtils.getString(R.string.module_core_unknown)
if (chassisStates!!.hasGearSystemStates()) {
val gear = chassisStates!!.gearSystemStates.gearPosition
temp = gear.name
}
chassisStatesObject.put("gear", temp)
//方向盘
temp = "未知"
// temp = "未知"
temp = StringUtils.getString(R.string.module_core_unknown)
if (chassisStates!!.hasSteerSystemStates()) {
val steerSystemStates = chassisStates!!.steerSystemStates
if (steerSystemStates.hasSteeringWheelAngle()) {
@@ -128,7 +135,8 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
}
chassisStatesObject.put("steering", temp)
//车灯
temp = "未知"
// temp = "未知"
temp = StringUtils.getString(R.string.module_core_unknown)
if (chassisStates!!.hasBcmSystemStates()) {
val bcm = chassisStates!!.bcmSystemStates
temp = bcm.turnLightState.name
@@ -150,35 +158,40 @@ object CallerAutopilotActionsListenerManager : CallerBase<IMoGoAutopilotActionsL
}
try {
//制动踏板
var temp = "未知"
// var temp = "未知"
var temp = StringUtils.getString(R.string.module_core_unknown)
if (vehicleState!!.hasBrake()) {
val brake = vehicleState!!.brake
temp = brake.toString()
}
vehicleStateObject.put("brake", temp)
//油门踏板
temp = "未知"
// temp = "未知"
temp = StringUtils.getString(R.string.module_core_unknown)
if (vehicleState!!.hasThrottle()) {
val throttle = vehicleState!!.throttle
temp = throttle.toString()
}
vehicleStateObject.put("throttle", temp)
//档位
temp = "未知"
// temp = "未知"
temp = StringUtils.getString(R.string.module_core_unknown)
if (vehicleState!!.hasGear()) {
val gear = vehicleState!!.gear
temp = gear.name
}
vehicleStateObject.put("gear", temp)
//方向盘
temp = "未知"
// temp = "未知"
temp = StringUtils.getString(R.string.module_core_unknown)
if (vehicleState!!.hasSteering()) {
val steering = vehicleState!!.steering
temp = steering.toString()
}
vehicleStateObject.put("steering", temp)
//车灯
temp = "未知"
// temp = "未知"
temp = StringUtils.getString(R.string.module_core_unknown)
if (vehicleState!!.hasLight()) {
val light = vehicleState!!.light
temp = light.name

View File

@@ -2,7 +2,9 @@ package com.mogo.eagle.core.function.call.autopilot
import com.mogo.eagle.core.data.config.FunctionBuildConfig
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotCarConfigListener
import com.mogo.eagle.core.function.call.R
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.utilcode.util.StringUtils
import mogo.telematics.pad.MessagePad
/**
@@ -13,7 +15,11 @@ object CallerAutopilotCarConfigListenerManager : CallerBase<IMoGoAutopilotCarCon
private var mCarConfigResp: MessagePad.CarConfigResp? = null
@Volatile
private var certFileMsg = "未开启认证"
private var certFileMsg = ""
init {
certFileMsg = StringUtils.getString(R.string.module_core_authentication_not_enabled)
}
override fun doSomeAfterAddListener(tag: String, listener: IMoGoAutopilotCarConfigListener) {
mCarConfigResp?.let {

View File

@@ -5,9 +5,11 @@ import com.mogo.eagle.core.data.msgbox.FSMMsg
import com.mogo.eagle.core.data.msgbox.MsgBoxBean
import com.mogo.eagle.core.data.msgbox.MsgBoxType
import com.mogo.eagle.core.function.api.autopilot.IMoGoAutopilotStatisticsListener
import com.mogo.eagle.core.function.call.R
import com.mogo.eagle.core.function.call.base.CallerBase
import com.mogo.eagle.core.function.call.msgbox.CallerMsgBoxManager
import com.mogo.eagle.core.function.call.trace.CallerTrace
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.zhjt.mogo.adas.data.bean.AutopilotStatistics
import kotlin.properties.Delegates
@@ -22,7 +24,8 @@ object CallerAutopilotStatisticsListenerManager : CallerBase<IMoGoAutopilotStati
MsgBoxType.FSM,
FSMMsg(
0,
"自动驾驶启动失败",
// "自动驾驶启动失败",
StringUtils.getString(R.string.module_core_autonomous_driving_startup_failed),
(it.failedMessage?.msg?:""),
System.currentTimeMillis()
)