From 747fec47c7bed89f377aae46847272e781887c55 Mon Sep 17 00:00:00 2001 From: xieofxie Date: Mon, 19 Aug 2019 12:26:04 +0800 Subject: [PATCH] [POI] fix localization issue (#2115) --- .../Content/PointOfInterestDetailsWithRoute.1.0.json | 2 +- .../Content/PointOfInterestDetailsWithRoute.json | 2 +- .../LU/zh/secondary/poi_navigation_route_fromxtoy.lu | 2 +- .../pointofinterestskill/Dialogs/PointOfInterestDialogBase.cs | 4 ++-- .../pointofinterestskill/Models/PointofInterestModel.cs | 3 +++ .../csharp/Sample/SkillSample/Dialogs/MainDialog.cs | 1 - .../csharp/Template/Skill/Dialogs/MainDialog.cs | 1 - 7 files changed, 8 insertions(+), 7 deletions(-) diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Content/PointOfInterestDetailsWithRoute.1.0.json b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Content/PointOfInterestDetailsWithRoute.1.0.json index bfcd3e1b18..261115a792 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Content/PointOfInterestDetailsWithRoute.1.0.json +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Content/PointOfInterestDetailsWithRoute.1.0.json @@ -26,7 +26,7 @@ "size": "Large", "weight": "Bolder", "color": "Default", - "text": "Location services" + "text": "{CardTitle}" } ], "width": "stretch" diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Content/PointOfInterestDetailsWithRoute.json b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Content/PointOfInterestDetailsWithRoute.json index 8857e245b3..fc2f89aef4 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Content/PointOfInterestDetailsWithRoute.json +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Content/PointOfInterestDetailsWithRoute.json @@ -40,7 +40,7 @@ "size": "Large", "weight": "Bolder", "color": "Light", - "text": "Location services" + "text": "{CardTitle}" } ], "width": "stretch" diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Resources/LU/zh/secondary/poi_navigation_route_fromxtoy.lu b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Resources/LU/zh/secondary/poi_navigation_route_fromxtoy.lu index b4c9ea0f5a..dce6bf1f30 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Resources/LU/zh/secondary/poi_navigation_route_fromxtoy.lu +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Deployment/Resources/LU/zh/secondary/poi_navigation_route_fromxtoy.lu @@ -491,7 +491,7 @@ - {KEYWORD=约克斯明斯特} 在 {ADDRESS=1827} {ADDRESS=哈钦森法院} {ADDRESS=布恩县} {ADDRESS=Md} - {ADDRESS=z blvd。} 和 {ADDRESS=bnd 972} 在那里引导我 - {KEYWORD=齐翁国家公园} 在 {ADDRESS=第47街} 和 {ADDRESS=哥伦布的地方} 邮政编码 -- {KEYWORD=祖普!} 在 {ADDRESS=1497年} {ADDRESS=希尔堡的地方} {ADDRESS=哈莱姆市} {ADDRESS=罗德岛} 在 {地址 = 帕普亚新几内亚} +- {KEYWORD=祖普!} 在 {ADDRESS=1497年} {ADDRESS=希尔堡的地方} {ADDRESS=哈莱姆市} {ADDRESS=罗德岛} 在 {ADDRESS=帕普亚新几内亚} - 查找路线 - 哪里是 {KEYWORD=papa john's} - 我在哪里可以找到{KEYWORD=papa john's} diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Dialogs/PointOfInterestDialogBase.cs b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Dialogs/PointOfInterestDialogBase.cs index efc1f08603..1e615bec2d 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Dialogs/PointOfInterestDialogBase.cs +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Dialogs/PointOfInterestDialogBase.cs @@ -469,7 +469,6 @@ protected async Task> GetPointOfInterestLocationCards(DialogContext s { for (var i = 0; i < pointOfInterestList.Count; i++) { - pointOfInterestList[i].CardTitle = PointOfInterestSharedStrings.CARD_TITLE; pointOfInterestList[i] = await service.GetPointOfInterestDetailsAsync(pointOfInterestList[i]); // Increase by one to avoid zero based options to the user which are confusing @@ -656,7 +655,8 @@ protected async Task> GetRouteDirectionsViewCards(DialogContext sc, R TravelTimeSpeak = GetFormattedTravelTimeSpanString(travelTimeSpan), TravelDelaySpeak = GetFormattedTrafficDelayString(trafficTimeSpan), ProviderDisplayText = string.Format($"{PointOfInterestSharedStrings.POWERED_BY} **{{0}}**", destination.Provider.Aggregate((j, k) => j + " & " + k).ToString()), - Speak = GetFormattedTravelTimeSpanString(travelTimeSpan) + Speak = GetFormattedTravelTimeSpanString(travelTimeSpan), + CardTitle = PointOfInterestSharedStrings.CARD_TITLE }; cardData.Add(routeDirectionsModel); diff --git a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Models/PointofInterestModel.cs b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Models/PointofInterestModel.cs index c0c2d67d3d..bea04aad70 100644 --- a/skills/src/csharp/pointofinterestskill/pointofinterestskill/Models/PointofInterestModel.cs +++ b/skills/src/csharp/pointofinterestskill/pointofinterestskill/Models/PointofInterestModel.cs @@ -6,6 +6,7 @@ using System.Text; using Microsoft.Bot.Builder.Solutions.Responses; using PointOfInterestSkill.Models.Foursquare; +using PointOfInterestSkill.Responses.Shared; namespace PointOfInterestSkill.Models { @@ -49,6 +50,7 @@ public PointOfInterestModel(SearchResult azureMapsPoi) Category = (azureMapsPoi.Poi?.Classifications != null) ? CultureInfo.CurrentCulture.TextInfo.ToTitleCase(azureMapsPoi.Poi.Classifications.FirstOrDefault().Names.FirstOrDefault().NameProperty) : Category; + CardTitle = PointOfInterestSharedStrings.CARD_TITLE; if (Provider == null) { @@ -98,6 +100,7 @@ public PointOfInterestModel(Venue foursquarePoi) Category = (foursquarePoi.Categories != null) ? foursquarePoi.Categories.First().ShortName : Category; + CardTitle = PointOfInterestSharedStrings.CARD_TITLE; if (Provider == null) { diff --git a/templates/Skill-Template/csharp/Sample/SkillSample/Dialogs/MainDialog.cs b/templates/Skill-Template/csharp/Sample/SkillSample/Dialogs/MainDialog.cs index 4efb528664..16ba50fb45 100644 --- a/templates/Skill-Template/csharp/Sample/SkillSample/Dialogs/MainDialog.cs +++ b/templates/Skill-Template/csharp/Sample/SkillSample/Dialogs/MainDialog.cs @@ -55,7 +55,6 @@ public MainDialog( protected override async Task OnStartAsync(DialogContext dc, CancellationToken cancellationToken = default(CancellationToken)) { - var locale = CultureInfo.CurrentUICulture; await dc.Context.SendActivityAsync(_responseManager.GetResponse(MainResponses.WelcomeMessage)); } diff --git a/templates/Skill-Template/csharp/Template/Skill/Dialogs/MainDialog.cs b/templates/Skill-Template/csharp/Template/Skill/Dialogs/MainDialog.cs index 1e542109b7..ea79e4807d 100644 --- a/templates/Skill-Template/csharp/Template/Skill/Dialogs/MainDialog.cs +++ b/templates/Skill-Template/csharp/Template/Skill/Dialogs/MainDialog.cs @@ -55,7 +55,6 @@ public MainDialog( protected override async Task OnStartAsync(DialogContext dc, CancellationToken cancellationToken = default(CancellationToken)) { - var locale = CultureInfo.CurrentUICulture; await dc.Context.SendActivityAsync(_responseManager.GetResponse(MainResponses.WelcomeMessage)); }