From 5d8be079c25c9e820c3bb1e96178f816d10ad681 Mon Sep 17 00:00:00 2001 From: lishuo Date: Fri, 3 Dec 2021 18:19:24 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B1=89=E5=8C=96=E5=BE=AE=E8=B0=83?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UI/Prefab/Match/CompetitonPanel.prefab | 2 +- .../Match/Mobile/CompetitonPanel.prefab | 10 +++--- Assets/Resources/UI/language.json | 32 ++++++++++++------- Assets/Scripts/Apis/ApiBase.cs | 5 +-- Assets/Scripts/UI/Prefab/Device/DeviceView.cs | 2 +- .../UI/Prefab/Panel/EditUserController.cs | 2 +- .../UI/Prefab/ResultList/LocalRouteItem.cs | 6 ++-- .../Scripts/UI/Prefab/ResultList/RouteItem.cs | 16 +++++----- .../UI/Prefab/Rower/RowerDeviceView.cs | 2 +- 9 files changed, 44 insertions(+), 33 deletions(-) diff --git a/Assets/Resources/UI/Prefab/Match/CompetitonPanel.prefab b/Assets/Resources/UI/Prefab/Match/CompetitonPanel.prefab index d4814124..434ff1ec 100644 --- a/Assets/Resources/UI/Prefab/Match/CompetitonPanel.prefab +++ b/Assets/Resources/UI/Prefab/Match/CompetitonPanel.prefab @@ -1907,7 +1907,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: mType: 2 - Tooltips: RideNow + Tooltips: Ride Now --- !u!1 &4545746281496939300 GameObject: m_ObjectHideFlags: 0 diff --git a/Assets/Resources/UI/Prefab/Match/Mobile/CompetitonPanel.prefab b/Assets/Resources/UI/Prefab/Match/Mobile/CompetitonPanel.prefab index 816b0fe7..ae9e3340 100644 --- a/Assets/Resources/UI/Prefab/Match/Mobile/CompetitonPanel.prefab +++ b/Assets/Resources/UI/Prefab/Match/Mobile/CompetitonPanel.prefab @@ -1893,7 +1893,7 @@ MonoBehaviour: m_Name: m_EditorClassIdentifier: mType: 2 - Tooltips: RideNow + Tooltips: Ride Now --- !u!1 &4545746281496939300 GameObject: m_ObjectHideFlags: 0 @@ -4991,7 +4991,7 @@ GameObject: m_Icon: {fileID: 0} m_NavMeshLayer: 0 m_StaticEditorFlags: 0 - m_IsActive: 0 + m_IsActive: 1 --- !u!224 &6558498178561756610 RectTransform: m_ObjectHideFlags: 0 @@ -6528,8 +6528,8 @@ RectTransform: m_LocalEulerAnglesHint: {x: 0, y: 0, z: 0} m_AnchorMin: {x: 0, y: 1} m_AnchorMax: {x: 0, y: 1} - m_AnchoredPosition: {x: 393.5, y: -115.4} - m_SizeDelta: {x: 51, y: 14} + m_AnchoredPosition: {x: 391.5, y: -115.399994} + m_SizeDelta: {x: 54.99997, y: 14} m_Pivot: {x: 0.5, y: 0.5} --- !u!222 &927843223585017441 CanvasRenderer: @@ -6568,7 +6568,7 @@ MonoBehaviour: m_Alignment: 0 m_AlignByGeometry: 0 m_RichText: 1 - m_HorizontalOverflow: 0 + m_HorizontalOverflow: 1 m_VerticalOverflow: 0 m_LineSpacing: 1 m_Text: Get Ready diff --git a/Assets/Resources/UI/language.json b/Assets/Resources/UI/language.json index 8a872454..7fd630fc 100644 --- a/Assets/Resources/UI/language.json +++ b/Assets/Resources/UI/language.json @@ -14,7 +14,7 @@ "Current Slope": "当前坡度", "join this route !": "加入路线!", "New Shadow": "添加", - "Name": "名字", + "Name": "姓名", "No Shadow Here": "无数据", "Cancel": "取消", "Enter text...": "请输入关键字", @@ -66,7 +66,7 @@ "Join Now": "报名", "ROUTES": "线路", "MATCH": "赛事", - "Found Nothing": "wushuju", + "Found Nothing": "无数据", "Toast": "Toast", "Riders": "骑手", "Altitude": "海拔", @@ -75,8 +75,8 @@ "Heart Rate": "心率", "Speed": "速度", "Name/ID": "名称", - "No": "否", - "Yes": "是", + "No": "取消", + "Yes": "确认", "Enter": "进入", "Cancel Apply": "取消报名", "Cancel Reserve": "取消报名", @@ -132,7 +132,7 @@ "Wheel Diameter": "轮径", "Please enter your WD": "请输入您的轮径", "DELIVERY INFO": "收货信息", - "Please enter your name": "请输入您的收货信息", + "Please enter your name": "请输入您的姓名", "Phone number": "手机号", "Please enter your phone number": "请输入您的手机号", "Address": "地址", @@ -172,12 +172,12 @@ "Not started": "未开始", "In play": "进行中", "Done": "结束", - "Join In": "报名", + "Join In": "已报名", "Race Name": "赛事名称", "Total Rides": "总计骑行次数", "Total Riding Time": "总计骑行时间", "times": "次", - "hours": "h", + "hours": "H", "KCAL": "KCAL", "M": "M", "KM": "KM", @@ -194,7 +194,7 @@ "SIGN UP": "注册", "Verification Code": "验证码", "Verify": "获取验证码", - "Repeat Password": "重复输入密码", + "Repeat Password": "确认密码", "LOGIN": "登录", "Forgot password?": "忘记密码?", "Previous": "上一步", @@ -212,7 +212,7 @@ "Start for Registration": "报名开始时间", "Deadline for Registration": "报名截止时间", "WATTS": "功率", - "Choose Your Account": "选择一个账号", + "Choose Your Account": "登录记录", "Are you a new to Powerfun?": "新用户?", "Account Infomation": "账号信息", "You're almost done.": "马上完成", @@ -274,7 +274,12 @@ "Upload": "上传", "Upload the local record?": "上传本地记录?", "Delete the local record?": "删除本地记录?", - "Registered": "已报名" + "Registered": "已报名", + "Cycling Equipment": "骑行设备", + "Mileage": "里程", + "Times": "骑行次数", + "Rank": "排名", + "Connecting...": "连接中" }, "en": { "HOT ROUTES": "HOT ROUTES", @@ -542,6 +547,11 @@ "Upload": "Upload", "Upload the local record?": "Upload the local record?", "Delete the local record?": "Delete the local record?", - "Registered": "Registered" + "Registered": "Registered", + "Cycling Equipment": "Cycling Equipment", + "Mileage": "Mileage", + "Times": "Times", + "Rank": "Rank", + "Connecting...": "Connecting..." } } \ No newline at end of file diff --git a/Assets/Scripts/Apis/ApiBase.cs b/Assets/Scripts/Apis/ApiBase.cs index 945f0fc2..3e6b0b25 100644 --- a/Assets/Scripts/Apis/ApiBase.cs +++ b/Assets/Scripts/Apis/ApiBase.cs @@ -295,7 +295,8 @@ namespace Assets.Scripts.Apis //} var request = (HttpWebRequest)WebRequest.Create(ConfigHelper.Host + url); request.UserAgent = httpClient.DefaultRequestHeaders.UserAgent.ToString(); - request.Headers.Add("Language", "en"); + request.Headers.Add("Language", App.GetLocalLanguage()); + request.CookieContainer = new CookieContainer(); foreach (Cookie item in cookies) { @@ -556,7 +557,7 @@ namespace Assets.Scripts.Apis request.Method = "POST"; request.UserAgent = httpClient.DefaultRequestHeaders.UserAgent.ToString(); request.Accept = "application/json"; - request.Headers.Add("Language", "en"); + request.Headers.Add("Language", App.GetLocalLanguage()); request.CookieContainer = new CookieContainer(); foreach (Cookie item in cookies) { diff --git a/Assets/Scripts/UI/Prefab/Device/DeviceView.cs b/Assets/Scripts/UI/Prefab/Device/DeviceView.cs index d41ec6e7..d2daa431 100644 --- a/Assets/Scripts/UI/Prefab/Device/DeviceView.cs +++ b/Assets/Scripts/UI/Prefab/Device/DeviceView.cs @@ -327,7 +327,7 @@ public class DeviceView : MonoBehaviour mPairButton.SetActive(true); searchState.gameObject.SetActive(true); #endif - searchState.text = "Connecting..."; + searchState.text = App.GetLocalString("Connecting..."); } diff --git a/Assets/Scripts/UI/Prefab/Panel/EditUserController.cs b/Assets/Scripts/UI/Prefab/Panel/EditUserController.cs index a246e460..a210cc60 100644 --- a/Assets/Scripts/UI/Prefab/Panel/EditUserController.cs +++ b/Assets/Scripts/UI/Prefab/Panel/EditUserController.cs @@ -387,7 +387,7 @@ public class EditUserController : PFUIPanel, INativeOnMobileImageSelect user.Nickname = mNickName.Text; user.Country = UIManager.Instance.loginRegOptions.GetCountryName(mConutryDropdown.SelectedIndex); var errorList = new List(); - if (string.IsNullOrEmpty(mNickName.Text)) errorList.Add(new { Field = "Nickname", ErrMsg = "请填写昵称" }); + if (string.IsNullOrEmpty(mNickName.Text)) errorList.Add(new { Field = "NickName", ErrMsg = "请填写昵称" }); if (string.IsNullOrEmpty(mFTP.Text)) errorList.Add(new { Field = "FTP", ErrMsg = "请填写FTP" }); if (string.IsNullOrEmpty(mHeight.Text)) errorList.Add(new { Field = "Height", ErrMsg = "请填写身高" }); if (string.IsNullOrEmpty(mWeight.Text)) errorList.Add(new { Field = "Weight", ErrMsg = "请填写体重" }); diff --git a/Assets/Scripts/UI/Prefab/ResultList/LocalRouteItem.cs b/Assets/Scripts/UI/Prefab/ResultList/LocalRouteItem.cs index 9a99da2d..6b706c3e 100644 --- a/Assets/Scripts/UI/Prefab/ResultList/LocalRouteItem.cs +++ b/Assets/Scripts/UI/Prefab/ResultList/LocalRouteItem.cs @@ -79,9 +79,9 @@ public class LocalRouteItem : MonoBehaviour, IPointerExitHandler, IPointerEnterH Name.text = record.RouteName; Time.text = record.StartTime.ToString("HH:mm:ss dd-MM-yyyy"); - RidingTime.text = $"Riding time:{Helper.FormatTicks(record.Ticks)}"; - RidingDistance.text = $"Mileage:{record.EndDistance.ToString("#0.00")}KM"; - Device.text = $"Cycling equipment:{record.ManufacturerName}"; + RidingTime.text = $"{App.GetLocalString("Riding time")}:{Helper.FormatTicks(record.Ticks)}"; + RidingDistance.text = $"{App.GetLocalString("Mileage")}:{record.EndDistance.ToString("#0.00")}KM"; + Device.text = $"{App.GetLocalString("Cycling equipment")}:{record.ManufacturerName}"; } else { diff --git a/Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs b/Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs index 9ad0054e..0e770316 100644 --- a/Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs +++ b/Assets/Scripts/UI/Prefab/ResultList/RouteItem.cs @@ -91,9 +91,9 @@ public class RouteItem : MonoBehaviour { Utils.DisplayImage(raw, result.Cover, true); } - row1.Find("Time").GetComponent().text = $"Rowing time:{TimeSpan.FromSeconds(result.TotalTime).ToString()}"; - row1.Find("Distance").GetComponent().text = $"Distance:{result.TotalDistance}M"; - row2.Find("Device").GetComponent().text = $"Rowing equipment:{result.ManufacturerName}"; + row1.Find("Time").GetComponent().text = $"{App.GetLocalString("Rowing time")}:{TimeSpan.FromSeconds(result.TotalTime).ToString()}"; + row1.Find("Distance").GetComponent().text = $"{App.GetLocalString("Distance")}:{result.TotalDistance}M"; + row2.Find("Device").GetComponent().text = $"{App.GetLocalString("Rowing equipment")}:{result.ManufacturerName}"; left.Find("Progress").gameObject.SetActive(false); left.Find("Main/Name").GetComponent().text = $"{result.CreateTime.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")} Free Rowing"; left.Find("Main/Time").GetComponent().text = $"{result.StartTime.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")} ~ {result.CreateTime.ToLocalTime().ToString("yyyy-MM-dd HH:mm:ss")}"; @@ -136,12 +136,12 @@ public class RouteItem : MonoBehaviour left.Find("Main").Find("Name").GetComponent().text = result.RouteName; left.Find("Main").Find("Time").GetComponent().text = result.CreateTime.ToString("HH:mm:ss dd-MM-yyyy"); - row1.Find("Time").GetComponent().text = $"Riding Time:{result.TrainingTime}"; - row1.Find("Distance").GetComponent().text = $"Mileage:{result.EndDistance.ToString("#0.00")}KM"; - row1.Find("Times").GetComponent().text = $"Times:{result.Count}"; + row1.Find("Time").GetComponent().text = $"{App.GetLocalString("Riding Time")}:{result.TrainingTime}"; + row1.Find("Distance").GetComponent().text = $"{App.GetLocalString("Mileage")}:{result.EndDistance.ToString("#0.00")}KM"; + row1.Find("Times").GetComponent().text = $"{App.GetLocalString("Times")}:{result.Count}"; if (index == 0) { - row1.Find("Rank").GetComponent().text = $"Rank:{result.Ranking}"; + row1.Find("Rank").GetComponent().text = $"{App.GetLocalString("Rank")}:{result.Ranking}"; } else { @@ -149,7 +149,7 @@ public class RouteItem : MonoBehaviour } left.Find("Progress").Find("Image").GetComponent().fillAmount = (float)result.Progress; left.Find("Progress").Find("Value").GetComponent().text = (result.Progress * 100).ToString("#0"); - row2.Find("Device").GetComponent().text = $"Cycling Equipment:{result.ManufacturerName}"; + row2.Find("Device").GetComponent().text = $"{App.GetLocalString("Cycling Equipment")}:{result.ManufacturerName}"; if (index == 0) { right = transform.Find("Right"); diff --git a/Assets/Scripts/UI/Prefab/Rower/RowerDeviceView.cs b/Assets/Scripts/UI/Prefab/Rower/RowerDeviceView.cs index 1c7661ab..112680cf 100644 --- a/Assets/Scripts/UI/Prefab/Rower/RowerDeviceView.cs +++ b/Assets/Scripts/UI/Prefab/Rower/RowerDeviceView.cs @@ -296,7 +296,7 @@ public class RowerDeviceView : MonoBehaviour mPairButton.SetActive(true); searchState.gameObject.SetActive(true); #endif - searchState.text = "Connecting..."; + searchState.text = App.GetLocalString("Connecting..."); }