diff --git a/Assets/Scripts/Localization/LocalizationManager.cs b/Assets/Scripts/Localization/LocalizationManager.cs index 14b8d39..e884671 100644 --- a/Assets/Scripts/Localization/LocalizationManager.cs +++ b/Assets/Scripts/Localization/LocalizationManager.cs @@ -478,6 +478,12 @@ public class LocalizationManager : MonoBehaviour { "厂区位置规划完成", new[] { "厂区位置规划完成", "Area Planning Complete", "Planification de la zone terminée", "Планирование зоны завершено" } }, { "规划完成", new[] { "规划完成", "Planning Complete", "Planification terminée", "Планирование завершено" } }, { "左键可重新改变厂区规划位置 右键取消厂区规划功能", new[] { "左键可重新改变厂区规划位置 右键取消厂区规划功能", "Left click to replan area position, right click to cancel", "Clic gauche pour replanifier, clic droit pour annuler", "ЛКМ — перепланировать, ПКМ — отменить" } }, + { "开始测距", new[] { "开始测距", "Start Measuring", "Commencer la mesure", "Начать измерение" } }, + { "结束测距", new[] { "结束测距", "Stop Measuring", "Arrêter la mesure", "Остановить измерение" } }, + { "左Ctrl+鼠标左键可重新改变厂区规划位置 右键取消厂区规划功能", new[] { "左Ctrl+鼠标左键可重新改变厂区规划位置 右键取消厂区规划功能", "Ctrl+Left click to replan area position, right click to cancel", "Ctrl+Clic gauche pour replanifier, clic droit pour annuler", "Ctrl+ЛКМ — перепланировать, ПКМ — отменить" } }, + { "{0}与{1}边界间距为{2}M,小于200M", new[] { "{0}与{1}边界间距为{2}M,小于200M", "Distance between {0} and {1} boundary is {2}M, less than 200M", "Distance entre {0} et {1} : {2}M, inférieure à 200M", "Расстояние между {0} и {1}: {2}м, менее 200м" } }, + { "{0}与{1}边界间距为{2}M,小于100M", new[] { "{0}与{1}边界间距为{2}M,小于100M", "Distance between {0} and {1} boundary is {2}M, less than 100M", "Distance entre {0} et {1} : {2}M, inférieure à 100M", "Расстояние между {0} и {1}: {2}м, менее 100м" } }, + { "{0}距离水源距离为{1}M,超出100M", new[] { "{0}距离水源距离为{1}M,超出100M", "{0} distance to water source is {1}M, exceeds 100M", "Distance de {0} à la source d'eau : {1}M, supérieure à 100M", "Расстояние от {0} до источника воды {1}м, более 100м" } }, }; [SerializeField] private int language; diff --git a/Assets/Scripts/ThisProjectTool/EditorAppraiser.cs b/Assets/Scripts/ThisProjectTool/EditorAppraiser.cs index cb00e59..b97c7b3 100644 --- a/Assets/Scripts/ThisProjectTool/EditorAppraiser.cs +++ b/Assets/Scripts/ThisProjectTool/EditorAppraiser.cs @@ -450,14 +450,14 @@ public class EditorAppraiser { if (distance < 200) { - return $"{allPlanedAreas[i].AreaName}与{allPlanedAreas[j].AreaName}边界间距为{(distance).ToString("0.0")}M,小于200M"; + return LocalizationManager.Format("{0}与{1}边界间距为{2}M,小于200M", allPlanedAreas[i].AreaName, allPlanedAreas[j].AreaName, distance.ToString("0.0")); } } else //其他厂区间距限制在100M { if (distance < 100) { - return $"{allPlanedAreas[i].AreaName}与{allPlanedAreas[j].AreaName}边界间距为{(distance).ToString("0.0")}M,小于100M"; + return LocalizationManager.Format("{0}与{1}边界间距为{2}M,小于100M", allPlanedAreas[i].AreaName, allPlanedAreas[j].AreaName, distance.ToString("0.0")); } } } @@ -475,7 +475,7 @@ public class EditorAppraiser float distance= GetXiXiaoToWaterDistance(new List() { xixiaoPos }); if (distance > 100) - return $"{AreaNameEnum.洗消场.ToString()}距离水源距离为{distance.ToString("0.0")}M,超出100M"; + return LocalizationManager.Format("{0}距离水源距离为{1}M,超出100M", AreaNameEnum.洗消场.ToString(), distance.ToString("0.0")); return ""; } diff --git a/Assets/Scripts/ZFramwork/Extend/MyToggleButton.cs b/Assets/Scripts/ZFramwork/Extend/MyToggleButton.cs index d081d3c..0407602 100644 --- a/Assets/Scripts/ZFramwork/Extend/MyToggleButton.cs +++ b/Assets/Scripts/ZFramwork/Extend/MyToggleButton.cs @@ -24,11 +24,11 @@ public class MyToggleButton : Selectable, IPointerClickHandler { if (isOn) { - acticveStr.text = isOnActiveStr; + acticveStr.text = LocalizationManager.Get(isOnActiveStr); } else { - acticveStr.text = notOnActiveStr; + acticveStr.text = LocalizationManager.Get(notOnActiveStr); } } valueChange?.Invoke(isOn); @@ -39,10 +39,22 @@ public class MyToggleButton : Selectable, IPointerClickHandler } } - // Start is called before the first frame update + // Start is called before the first update protected override void Start() { IsOn = isOn; + LocalizationManager.LanguageChanged += OnLanguageChanged; + } + + private void OnLanguageChanged() + { + if (acticveStr != null) + acticveStr.text = LocalizationManager.Get(isOn ? isOnActiveStr : notOnActiveStr); + } + + protected override void OnDestroy() + { + LocalizationManager.LanguageChanged -= OnLanguageChanged; } public void OnPointerClick(PointerEventData eventData)