[8.2.8][i18n] mogo-core-function-map、mogo-core-function-patch、mogo-core-function-startup 中文抽取

This commit is contained in:
xinfengkun
2025-11-24 19:12:22 +08:00
parent 8f9d60eeb5
commit ab6a5a92d6
13 changed files with 153 additions and 58 deletions

View File

@@ -12,7 +12,9 @@ import com.mogo.eagle.core.function.api.autopilot.IMoGoPlanningRottingListener;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationGCJ02ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerChassisLocationWGS84ListenerManager;
import com.mogo.eagle.core.function.call.autopilot.CallerPlanningRottingListenerManager;
import com.mogo.eagle.core.function.map.R;
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger;
import com.mogo.eagle.core.utilcode.util.StringUtils;
import com.mogo.eagle.core.utilcode.util.ThreadUtils;
import java.util.ArrayList;
@@ -78,7 +80,8 @@ public class MogoTrajectoryOverlayManager implements IMoGoPlanningRottingListene
return new Pair(true, "success");
}
trackEvent("drawTrajectoryOverlayOnce", "执行结果(result=false, msg=全局轨迹未就绪或为空)");
return new Pair(false, "全局轨迹未就绪或为空");
// return new Pair(false, "全局轨迹未就绪或为空");
return new Pair(false, StringUtils.getString(R.string.module_core_global_trajectory_not_ready_or_empty));
}
}

View File

@@ -7,6 +7,7 @@ import android.widget.ImageView
import android.widget.TextView
import androidx.constraintlayout.widget.ConstraintLayout
import com.mogo.eagle.core.function.map.R
import com.mogo.eagle.core.utilcode.util.StringUtils
class V2XMarkerView @JvmOverloads constructor(
context: Context,
@@ -30,19 +31,23 @@ class V2XMarkerView @JvmOverloads constructor(
when (poiType) {
"10006" -> {
iconView.setBackgroundResource(R.drawable.icon_small_v2x_road_construction)
contentView.text = "道路施工"
// contentView.text = "道路施工"
contentView.text = StringUtils.getString(R.string.module_core_road_construction)
}
"10007" -> {
iconView.setBackgroundResource(R.drawable.icon_v2x_road_congestion)
contentView.text = "道路拥堵"
// contentView.text = "道路拥堵"
contentView.text = StringUtils.getString(R.string.module_core_road_congestion)
}
"10032" -> {
iconView.setBackgroundResource(R.drawable.icon_v2x_road_accidents)
contentView.text = "道路事故"
// contentView.text = "道路事故"
contentView.text = StringUtils.getString(R.string.module_core_road_accident)
}
"10025" -> {
iconView.setBackgroundResource(R.drawable.icon_v2x_obstacle)
contentView.text = "障碍车辆"
// contentView.text = "障碍车辆"
contentView.text = StringUtils.getString(R.string.module_core_obstacle_vehicle)
}
// "10031" -> {
// iconView.setBackgroundResource(R.drawable.icon_small_v2x_road_construction)

View File

@@ -19,6 +19,7 @@ import com.mogo.eagle.core.function.call.autopilot.CallerPlanningActionsListener
import com.mogo.eagle.core.function.call.map.CallerMapRoadListenerManager
import com.mogo.eagle.core.function.map.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ThreadUtils
import com.shuyu.gsyvideoplayer.GSYVideoManager
import com.shuyu.gsyvideoplayer.builder.GSYVideoOptionBuilder
@@ -276,9 +277,12 @@ class DecisionLayout @JvmOverloads constructor(
when (type) {
0 -> {
decContent1.text = "停车等待"
decContent2.text = "变道出站"
decContent3.text = "直行出站"
// decContent1.text = "停车等待"
decContent1.text = StringUtils.getString(R.string.module_core_park_and_wait)
// decContent2.text = "变道出站"
decContent2.text = StringUtils.getString(R.string.module_core_lane_change_and_exit)
// decContent3.text = "直行出站"
decContent3.text = StringUtils.getString(R.string.module_core_straight_ahead_and_exit)
gsyVideoPlay(getRawPath(R.raw.wujuece))
gsyVideoPlay2(getRawPath(R.raw.zuohuandao))
@@ -286,9 +290,12 @@ class DecisionLayout @JvmOverloads constructor(
}
1 -> {
decContent1.text = "车道保持"
decContent2.text = "进站停车"
decContent3.text = "向右变道"
// decContent1.text = "车道保持"
decContent1.text = StringUtils.getString(R.string.module_core_lane_keeping)
// decContent2.text = "进站停车"
decContent2.text = StringUtils.getString(R.string.module_core_enter_station_and_park)
// decContent3.text = "向右变道"
decContent3.text = StringUtils.getString(R.string.module_core_change_lane_to_right)
gsyVideoPlay(getRawPath(R.raw.zhixing))
gsyVideoPlay2(getRawPath(R.raw.youhuandao))
@@ -296,9 +303,12 @@ class DecisionLayout @JvmOverloads constructor(
}
2 -> {
decContent1.text = "向左变道"
decContent2.text = "车道保持"
decContent3.text = "向右变道"
// decContent1.text = "向左变道"
decContent1.text = StringUtils.getString(R.string.module_core_change_lane_to_left)
// decContent2.text = "车道保持"
decContent2.text = StringUtils.getString(R.string.module_core_lane_keeping)
// decContent3.text = "向右变道"
decContent3.text = StringUtils.getString(R.string.module_core_change_lane_to_right)
gsyVideoPlay(getRawPath(R.raw.zuohuandao))
gsyVideoPlay2(getRawPath(R.raw.zhixing))
@@ -306,9 +316,12 @@ class DecisionLayout @JvmOverloads constructor(
}
3 -> {
decContent1.text = "车道保持"
decContent2.text = "向左变道"
decContent3.text = "向右变道"
// decContent1.text = "车道保持"
decContent1.text = StringUtils.getString(R.string.module_core_lane_keeping)
// decContent2.text = "向左变道"
decContent2.text = StringUtils.getString(R.string.module_core_change_lane_to_left)
// decContent3.text = "向右变道"
decContent3.text = StringUtils.getString(R.string.module_core_change_lane_to_right)
gsyVideoPlay(getRawPath(R.raw.zhixing))
gsyVideoPlay2(getRawPath(R.raw.zuohuandao))
@@ -316,9 +329,12 @@ class DecisionLayout @JvmOverloads constructor(
}
4 -> {
decContent1.text = "向左变道"
decContent2.text = "向右变道"
decContent3.text = "车道保持"
// decContent1.text = "向左变道"
decContent1.text = StringUtils.getString(R.string.module_core_change_lane_to_left)
// decContent2.text = "向右变道"
decContent2.text = StringUtils.getString(R.string.module_core_change_lane_to_right)
// decContent3.text = "车道保持"
decContent3.text = StringUtils.getString(R.string.module_core_lane_keeping)
gsyVideoPlay(getRawPath(R.raw.zuohuandao))
gsyVideoPlay2(getRawPath(R.raw.youhuandao))
@@ -326,9 +342,12 @@ class DecisionLayout @JvmOverloads constructor(
}
5 -> {
decContent1.text = "车道保持"
decContent2.text = "向左变道绕障"
decContent3.text = "向右变道绕障"
// decContent1.text = "车道保持"
decContent1.text = StringUtils.getString(R.string.module_core_lane_keeping)
// decContent2.text = "向左变道绕障"
decContent2.text = StringUtils.getString(R.string.module_core_change_lane_to_left_to_avoid_obstacle)
// decContent3.text = "向右变道绕障"
decContent3.text = StringUtils.getString(R.string.module_core_change_lane_to_right_to_avoid_obstacle)
gsyVideoPlay(getRawPath(R.raw.zhixing))
gsyVideoPlay2(getRawPath(R.raw.zuobizhang))
@@ -336,9 +355,12 @@ class DecisionLayout @JvmOverloads constructor(
}
6 -> {
decContent1.text = "向左变道绕障"
decContent2.text = "向右变道绕障"
decContent3.text = "车道保持"
// decContent1.text = "向左变道绕障"
decContent1.text = StringUtils.getString(R.string.module_core_change_lane_to_left_to_avoid_obstacle)
// decContent2.text = "向右变道绕障"
decContent2.text = StringUtils.getString(R.string.module_core_change_lane_to_right_to_avoid_obstacle)
// decContent3.text = "车道保持"
decContent3.text = StringUtils.getString(R.string.module_core_lane_keeping)
gsyVideoPlay(getRawPath(R.raw.zuobizhang))
gsyVideoPlay2(getRawPath(R.raw.youbizhang))
@@ -346,9 +368,12 @@ class DecisionLayout @JvmOverloads constructor(
}
7 -> {
decContent1.text = "直行通过路口"
decContent2.text = "左转通过路口"
decContent3.text = "右转通过路口"
// decContent1.text = "直行通过路口"
decContent1.text = StringUtils.getString(R.string.module_core_go_straight_through_intersection)
// decContent2.text = "左转通过路口"
decContent2.text = StringUtils.getString(R.string.module_core_turn_left_through_intersection)
// decContent3.text = "右转通过路口"
decContent3.text = StringUtils.getString(R.string.module_core_turn_right_through_intersection)
gsyVideoPlay(getRawPath(R.raw.zhixing))
gsyVideoPlay2(getRawPath(R.raw.lukouzuozhuan))
@@ -356,9 +381,12 @@ class DecisionLayout @JvmOverloads constructor(
}
8 -> {
decContent1.text = "左转通过路口"
decContent2.text = "直行通过路口"
decContent3.text = "右转通过路口"
// decContent1.text = "左转通过路口"
decContent1.text = StringUtils.getString(R.string.module_core_turn_left_through_intersection)
// decContent2.text = "直行通过路口"
decContent2.text = StringUtils.getString(R.string.module_core_go_straight_through_intersection)
// decContent3.text = "右转通过路口"
decContent3.text = StringUtils.getString(R.string.module_core_turn_right_through_intersection)
gsyVideoPlay(getRawPath(R.raw.lukouzuozhuan))
gsyVideoPlay2(getRawPath(R.raw.lukouzhixing))
@@ -366,9 +394,12 @@ class DecisionLayout @JvmOverloads constructor(
}
9 -> {
decContent1.text = "左转通过路口"
decContent2.text = "右转通过路口"
decContent3.text = "直行通过路口"
// decContent1.text = "左转通过路口"
decContent1.text = StringUtils.getString(R.string.module_core_turn_left_through_intersection)
// decContent2.text = "右转通过路口"
decContent2.text = StringUtils.getString(R.string.module_core_turn_right_through_intersection)
// decContent3.text = "直行通过路口"
decContent3.text = StringUtils.getString(R.string.module_core_go_straight_through_intersection)
gsyVideoPlay(getRawPath(R.raw.lukouzuozhuan))
gsyVideoPlay2(getRawPath(R.raw.lukouyouzhuan))

View File

@@ -161,7 +161,8 @@ class RoadCrossRoamView @JvmOverloads constructor(
lvRoadCrossRoamTip.visibility = View.GONE
ivZhiRoadRoamSet.visibility = View.GONE
ivZhiRoadRoamView.visibility = View.GONE
tvRoadRoamTitle.text = "为您全面扫描潜在风险"
// tvRoadRoamTitle.text = "为您全面扫描潜在风险"
tvRoadRoamTitle.text = StringUtils.getString(R.string.module_core_comprehensively_scan_potential_risks_for_you)
animScale = true
}
}

View File

@@ -62,6 +62,7 @@ import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant.Companion.M_MAP
import com.mogo.eagle.core.utilcode.util.CoordinateUtils
import com.mogo.eagle.core.utilcode.util.LocationUtils
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.UiThreadHandler
import com.mogo.eagle.core.widget.media.video.TextureVideoViewOutlineProvider
import me.jessyan.autosize.utils.AutoSizeUtils
@@ -904,10 +905,12 @@ class TravelRealityView @JvmOverloads constructor(
icon(BitmapDescriptorFactory.fromResource(R.drawable.mogo_shigu_nor))
})
eventBean.resId = R.drawable.mogo_shigu_nor
eventBean.title = "交通事故"
// eventBean.title = "交通事故"
eventBean.title = StringUtils.getString(R.string.module_core_traffic_accident)
roadEvents.add(eventBean)
if (!eventDrawMap.containsKey("800003")) {
eventDrawMap["800003"] = EventDrawBean(R.drawable.mogo_shigu_nor, "交通事故")
// eventDrawMap["800003"] = EventDrawBean(R.drawable.mogo_shigu_nor, "交通事故")
eventDrawMap["800003"] = EventDrawBean(R.drawable.mogo_shigu_nor, StringUtils.getString(R.string.module_core_traffic_accident))
}
}
@@ -919,11 +922,13 @@ class TravelRealityView @JvmOverloads constructor(
icon(BitmapDescriptorFactory.fromResource(R.drawable.mogo_shigong_image))
})
eventBean.resId = R.drawable.mogo_shigong_image
eventBean.title = "道路施工"
// eventBean.title = "道路施工"
eventBean.title = StringUtils.getString(R.string.module_core_road_construction)
roadEvents.add(eventBean)
if (!eventDrawMap.containsKey("800002")) {
eventDrawMap["800002"] =
EventDrawBean(R.drawable.mogo_shigong_image, "道路施工")
// EventDrawBean(R.drawable.mogo_shigong_image, "道路施工")
EventDrawBean(R.drawable.mogo_shigong_image, StringUtils.getString(R.string.module_core_road_construction))
}
}
@@ -944,10 +949,12 @@ class TravelRealityView @JvmOverloads constructor(
icon(BitmapDescriptorFactory.fromResource(R.drawable.mogo_jingzhi_nor))
})
eventBean.resId = R.drawable.mogo_jingzhi_nor
eventBean.title = "静止事件"
// eventBean.title = "静止事件"
eventBean.title = StringUtils.getString(R.string.module_core_stationary_event)
roadEvents.add(eventBean)
if (!eventDrawMap.containsKey("800004")) {
eventDrawMap["800004"] = EventDrawBean(R.drawable.mogo_jingzhi_nor, "静止事件")
// eventDrawMap["800004"] = EventDrawBean(R.drawable.mogo_jingzhi_nor, "静止事件")
eventDrawMap["800004"] = EventDrawBean(R.drawable.mogo_jingzhi_nor, StringUtils.getString(R.string.module_core_stationary_event))
}
}
@@ -997,7 +1004,8 @@ class TravelRealityView @JvmOverloads constructor(
deviceInfoBean.lat,
deviceInfoBean.lon
),
"全息路口",
// "全息路口",
StringUtils.getString(R.string.module_core_holographic_intersection),
deviceInfoBean.orientation
)
)
@@ -1181,7 +1189,8 @@ class TravelRealityView @JvmOverloads constructor(
}
if (deviceInPaths.isNotEmpty()) {
listener?.onDraw(
arrayListOf(EventDrawBean(R.drawable.mogo_quanxi_lukou, "全息路口")),
// arrayListOf(EventDrawBean(R.drawable.mogo_quanxi_lukou, "全息路口")),
arrayListOf(EventDrawBean(R.drawable.mogo_quanxi_lukou, StringUtils.getString(R.string.module_core_holographic_intersection))),
false
)
}

View File

@@ -39,11 +39,12 @@
app:map_index="2"
/>
<!-- android:text="AIP 规划与决策"-->
<TextView
android:id="@+id/tvDecTitle"
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_36"
android:text="AIP 规划与决策"
android:text="@string/module_core_aip_planning_decision_making"
android:textColor="#394047"
android:textSize="24dp"
android:textStyle="bold"

View File

@@ -6,10 +6,11 @@
android:layout_height="match_parent"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<!-- android:text="Prediction 预测"-->
<TextView
android:layout_width="wrap_content"
android:layout_height="@dimen/dp_36"
android:text="Prediction 预测"
android:text="@string/module_core_prediction"
android:textColor="#394047"
android:textSize="@dimen/dp_24"
android:textStyle="bold"

View File

@@ -39,11 +39,12 @@
app:map_index="2"
/>
<!-- android:text="AIP 规划与决策"-->
<TextView
android:id="@+id/tvDecTitle"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="AIP 规划与决策"
android:text="@string/module_core_aip_planning_decision_making"
android:textColor="#394047"
android:textSize="32dp"
app:layout_constraintStart_toStartOf="parent"

View File

@@ -6,10 +6,11 @@
android:layout_height="match_parent"
tools:parentTag="androidx.constraintlayout.widget.ConstraintLayout">
<!-- android:text="Prediction 预测"-->
<TextView
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:text="Prediction 预测"
android:text="@string/module_core_prediction"
android:textColor="#394047"
android:textSize="@dimen/dp_32"
app:layout_constraintStart_toStartOf="parent"

View File

@@ -18,11 +18,12 @@
android:visibility="visible"
/>
<!-- android:text="道路施工"-->
<TextView
android:id="@+id/tvContent"
android:layout_width="wrap_content"
android:layout_height="35dp"
android:text="道路施工"
android:text="@string/module_core_road_construction"
android:textStyle="bold"
app:layout_constraintEnd_toEndOf="parent"
app:layout_constraintTop_toTopOf="parent"

View File

@@ -24,24 +24,28 @@ internal object PatchManager {
fun applyPatch(ctx: Context, patch: File, newApk: File): Boolean {
val oldApkPath = ctx.packageManager.getPackageInfo(ctx.packageName, 0).applicationInfo.sourceDir
if (TextUtils.isEmpty(oldApkPath)) {
throw AssertionError("旧的apk文件的文件路径为空.")
// throw AssertionError("旧的apk文件的文件路径为空.")
throw AssertionError(StringUtils.getString(R.string.module_core_file_path_old_apk_empty))
}
val oldApk = File(oldApkPath)
Log.d(TAG, "applyPatch -- 1 --:oldApk -> ${oldApk.absolutePath}, patch: -> ${patch.absolutePath}, newApk: ${newApk.absolutePath}")
if (!oldApk.exists()) {
throw AssertionError("旧的apk文件不存在, 文件所在路径:${oldApk.absolutePath}")
// throw AssertionError("旧的apk文件不存在, 文件所在路径:${oldApk.absolutePath}")
throw AssertionError("${StringUtils.getString(R.string.module_core_old_apk_file_does_not_exist)}${oldApk.absolutePath}")
}
Log.d(TAG, "applyPatch -- 2 --")
if (!patch.exists()) {
throw AssertionError("差分包文件不存在,文件所在路径:${patch.absolutePath}")
// throw AssertionError("差分包文件不存在,文件所在路径:${patch.absolutePath}")
throw AssertionError("${StringUtils.getString(R.string.module_core_differential_package_file_does_not_exist)}${patch.absolutePath}")
}
Log.d(TAG, "applyPatch -- 3 --")
val newApkParent = newApk.parentFile
if (newApkParent != null && !newApkParent.exists()) {
val ret = newApkParent.mkdirs()
if (!ret) {
throw AssertionError("新包创建父目录失败")
// throw AssertionError("新包创建父目录失败")
throw AssertionError(StringUtils.getString(R.string.module_core_new_package_create_parent_dir_failed))
}
}
Log.d(TAG, "applyPatch -- 4 --")
@@ -49,7 +53,8 @@ internal object PatchManager {
newApk.delete()
}
if (newApkParent == null) {
throw AssertionError("新包父目录为空")
// throw AssertionError("新包父目录为空")
throw AssertionError(StringUtils.getString(R.string.module_core_new_package_parent_dir_null))
}
Log.d(TAG, "applyPatch -- 5 --")
val tempFilePath = File(ctx.getExternalFilesDir(null), "temp/temp.patch")
@@ -61,7 +66,8 @@ internal object PatchManager {
val result = ApkPatch.patch(oldApk.absolutePath, patch.absolutePath, newApk.absolutePath, 4 * 1024 * 1024, "", 4)
Log.d(TAG, "applyPatch -- end ---: result: $result")
if (result != 0) {
throw AssertionError("文件合成失败")
// throw AssertionError("文件合成失败")
throw AssertionError(StringUtils.getString(R.string.module_core_file_merge_failed))
}
return true
}

View File

@@ -9,8 +9,10 @@ import com.mogo.eagle.core.data.constants.MogoServicePaths
import com.mogo.eagle.core.data.deva.chain.ChainConstant
import com.mogo.eagle.core.function.api.cloud.IMoGoCertProvider
import com.mogo.eagle.core.function.call.cloud.CallerCloudListenerManager
import com.mogo.eagle.core.function.startup.R
import com.mogo.eagle.core.utilcode.mogo.logger.CallerLogger
import com.mogo.eagle.core.utilcode.mogo.logger.scene.SceneConstant
import com.mogo.eagle.core.utilcode.util.StringUtils
import com.mogo.eagle.core.utilcode.util.ThreadPoolService
import com.zhjt.service.chain.ChainLog
import java.util.concurrent.atomic.AtomicBoolean
@@ -52,7 +54,8 @@ class CertFileManager : IMoGoCertProvider {
return@let
}
if (certStatus.get()) {
onError?.invoke("正在下载证书,请稍后再试")
// onError?.invoke("正在下载证书,请稍后再试")
onError?.invoke(StringUtils.getString(R.string.module_core_certificate_downloading_please_try_later))
return@let
}
// 安全校验
@@ -98,7 +101,8 @@ class CertFileManager : IMoGoCertProvider {
certStatus.set(false)
crtFileErrorMsg = "$errorCode - $errorMsg"
CallerCloudListenerManager.invokeCloudCrtError(errorMsg)
onError?.invoke("证书下载失败, code:$errorCode, msg:$errorMsg")
// onError?.invoke("证书下载失败, code:$errorCode, msg:$errorMsg")
onError?.invoke("${StringUtils.getString(R.string.module_core_certificate_download_failed)}, code:$errorCode, msg:$errorMsg")
}
})
}
@@ -107,7 +111,8 @@ class CertFileManager : IMoGoCertProvider {
}
}
} else {
onError?.invoke("当前环境id:${FunctionBuildConfig.urlJson.secureProductId} 不支持密钥下载")
// onError?.invoke("当前环境id:${FunctionBuildConfig.urlJson.secureProductId} 不支持密钥下载")
onError?.invoke(StringUtils.getString(R.string.module_core_current_environment_does_not_support_key_download,FunctionBuildConfig.urlJson.secureProductId))
}
}