Skip to content
This repository was archived by the owner on Jun 30, 2022. It is now read-only.

Commit 35f5cd4

Browse files
authored
Using country and region in code and comment (#2385)
1 parent 1e21a1d commit 35f5cd4

File tree

10 files changed

+27
-27
lines changed

10 files changed

+27
-27
lines changed

samples/clients/csharp/assistant-WebTest/Assistant-WebTest/wwwroot/lib/jquery-validation/dist/additional-methods.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -533,7 +533,7 @@ $.validator.addMethod( "giroaccountNL", function( value, element ) {
533533

534534
/**
535535
* IBAN is the international bank account number.
536-
* It has a country - specific format, that is checked here too
536+
* It has a country/Region - specific format, that is checked here too
537537
*
538538
* Validation is case-insensitive. Please make sure to normalize input yourself.
539539
*/
@@ -562,7 +562,7 @@ $.validator.addMethod( "iban", function( value, element ) {
562562
return false;
563563
}
564564

565-
// Check the country code and find the country specific format
565+
// Check the country code and find the country/region specific format
566566
countrycode = iban.substring( 0, 2 );
567567
bbancountrypatterns = {
568568
"AL": "\\d{8}[\\dA-Z]{16}",
@@ -633,17 +633,17 @@ $.validator.addMethod( "iban", function( value, element ) {
633633

634634
bbanpattern = bbancountrypatterns[ countrycode ];
635635

636-
// As new countries will start using IBAN in the
636+
// As new countries or regions will start using IBAN in the
637637
// future, we only check if the countrycode is known.
638638
// This prevents false negatives, while almost all
639639
// false positives introduced by this, will be caught
640640
// by the checksum validation below anyway.
641641
// Strict checking should return FALSE for unknown
642-
// countries.
642+
// countries or regions.
643643
if ( typeof bbanpattern !== "undefined" ) {
644644
ibanregexp = new RegExp( "^[A-Z]{2}\\d{2}" + bbanpattern + "$", "" );
645645
if ( !( ibanregexp.test( iban ) ) ) {
646-
return false; // Invalid country specific format
646+
return false; // Invalid country/region specific format
647647
}
648648
}
649649

samples/utilities/linkedaccounts/linkedaccounts.web/wwwroot/lib/jquery-validation/dist/additional-methods.js

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -421,7 +421,7 @@ $.validator.addMethod("giroaccountNL", function(value, element) {
421421

422422
/**
423423
* IBAN is the international bank account number.
424-
* It has a country - specific format, that is checked here too
424+
* It has a country/Region - specific format, that is checked here too
425425
*/
426426
$.validator.addMethod("iban", function(value, element) {
427427
// some quick simple tests to prevent needless work
@@ -437,7 +437,7 @@ $.validator.addMethod("iban", function(value, element) {
437437
cOperator = "",
438438
countrycode, ibancheck, charAt, cChar, bbanpattern, bbancountrypatterns, ibanregexp, i, p;
439439

440-
// check the country code and find the country specific format
440+
// check the country code and find the country/region specific format
441441
countrycode = iban.substring(0, 2);
442442
bbancountrypatterns = {
443443
"AL": "\\d{8}[\\dA-Z]{16}",
@@ -507,17 +507,17 @@ $.validator.addMethod("iban", function(value, element) {
507507
};
508508

509509
bbanpattern = bbancountrypatterns[countrycode];
510-
// As new countries will start using IBAN in the
510+
// As new countries or regions will start using IBAN in the
511511
// future, we only check if the countrycode is known.
512512
// This prevents false negatives, while almost all
513513
// false positives introduced by this, will be caught
514514
// by the checksum validation below anyway.
515515
// Strict checking should return FALSE for unknown
516-
// countries.
516+
// countries or regions.
517517
if (typeof bbanpattern !== "undefined") {
518518
ibanregexp = new RegExp("^[A-Z]{2}\\d{2}" + bbanpattern + "$", "");
519519
if (!(ibanregexp.test(iban))) {
520-
return false; // invalid country specific format
520+
return false; // invalid country/region specific format
521521
}
522522
}
523523

skills/src/csharp/experimental/newsskill/Dialogs/NewsDialogBase.cs

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -98,22 +98,22 @@ protected async Task<DialogTurnResult> SetMarket(WaterfallStepContext sc, Cancel
9898

9999
if (string.IsNullOrWhiteSpace(userState.Market))
100100
{
101-
string country = (string)sc.Result;
101+
string countryregion = (string)sc.Result;
102102

103-
// use AzureMaps API to get country code from country input by user
104-
userState.Market = await _mapsService.GetCountryCodeAsync(country);
103+
// use AzureMaps API to get country code from country or region input by user
104+
userState.Market = await _mapsService.GetCountryCodeAsync(countryregion);
105105
}
106106

107107
return await sc.NextAsync();
108108
}
109109

110110
protected async Task<bool> MarketPromptValidatorAsync(PromptValidatorContext<string> promptContext, CancellationToken cancellationToken)
111111
{
112-
var country = promptContext.Recognized.Value;
112+
var countryregion = promptContext.Recognized.Value;
113113

114114
// check for valid country code
115-
country = await _mapsService.GetCountryCodeAsync(country);
116-
if (country != null)
115+
var countryCode = await _mapsService.GetCountryCodeAsync(countryregion);
116+
if (countryCode != null)
117117
{
118118
return await Task.FromResult(true);
119119
}

skills/src/csharp/experimental/newsskill/Models/AzureMaps/SearchAddress.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,10 @@ namespace NewsSkill.Models
55
public class SearchAddress
66
{
77
/// <summary>
8-
/// Gets or sets a string specifying the country of an address.
8+
/// Gets or sets a string specifying the country or region name of an address.
99
/// </summary>
1010
/// <value>
11-
/// A string specifying the country of an address.
11+
/// A string specifying the country or region name of an address.
1212
/// </value>
1313
[JsonProperty(PropertyName = "countryCode")]
1414
public string CountryCode { get; set; }

skills/src/csharp/experimental/newsskill/Responses/FindArticles/FindArticlesResponses.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@ public class FindArticlesResponses : TemplateManager
1818
["default"] = new TemplateIdMap
1919
{
2020
{ TopicPrompt, (context, data) => "What topic are you interested in?" },
21-
{ MarketPrompt, (context, data) => "What country do you want to search in?" },
21+
{ MarketPrompt, (context, data) => "What country or region do you want to search in?" },
2222
{ ShowArticles, (context, data) => ShowArticleCards(context, data) }
2323
},
2424
["en"] = new TemplateIdMap { },

skills/src/csharp/experimental/newsskill/Responses/Main/MainResponses.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ public class MainResponses : TemplateManager
3030
{ Greeting, (context, data) => MainStrings.GREETING },
3131
{ Help, (context, data) => SendHelpCard(context, data) },
3232
{ Intro, (context, data) => SendIntroCard(context, data) },
33-
{ MarketPrompt, (context, data) => "What country do you want to search in?" },
34-
{ MarketRetryPrompt, (context, data) => "Couldn't find that country. What country do you want to search in?" }
33+
{ MarketPrompt, (context, data) => "What country or region do you want to search in?" },
34+
{ MarketRetryPrompt, (context, data) => "Couldn't find that country or region. What country or region do you want to search in?" }
3535
},
3636
["en"] = new TemplateIdMap { },
3737
["fr"] = new TemplateIdMap { },

skills/src/csharp/experimental/newsskill/Responses/TrendingArticles/TrendingArticlesResponses.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ public class TrendingArticlesResponses : TemplateManager
1616
{
1717
["default"] = new TemplateIdMap
1818
{
19-
{ MarketPrompt, (context, data) => "What country are you in?" },
19+
{ MarketPrompt, (context, data) => "What country or region are you in?" },
2020
{ ShowArticles, (context, data) => ShowArticleCards(context, data) }
2121
},
2222
["en"] = new TemplateIdMap { },

skills/src/csharp/pointofinterestskill/pointofinterestskill/Models/AzureMaps/Address.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -65,11 +65,11 @@ public class Address
6565

6666
/// <summary>
6767
/// Gets or sets a string specifying the populated place for the address.
68-
/// This typically refers to a city, but may refer to a suburb or a neighborhood in certain countries.
68+
/// This typically refers to a city, but may refer to a suburb or a neighborhood in certain countries or regions.
6969
/// </summary>
7070
/// <value>
7171
/// A string specifying the populated place for the address.
72-
/// This typically refers to a city, but may refer to a suburb or a neighborhood in certain countries.
72+
/// This typically refers to a city, but may refer to a suburb or a neighborhood in certain countries or regions.
7373
/// </value>
7474
[JsonProperty(PropertyName = "locality")]
7575
public string Locality { get; set; }

skills/src/csharp/pointofinterestskill/pointofinterestskill/Models/AzureMaps/SearchAddress.cs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,11 +72,11 @@ public class SearchAddress
7272

7373
/// <summary>
7474
/// Gets or sets a string specifying the populated place for the address.
75-
/// This typically refers to a city, but may refer to a suburb or a neighborhood in certain countries.
75+
/// This typically refers to a city, but may refer to a suburb or a neighborhood in certain countries or regions.
7676
/// </summary>
7777
/// <value>
7878
/// A string specifying the populated place for the address.
79-
/// This typically refers to a city, but may refer to a suburb or a neighborhood in certain countries.
79+
/// This typically refers to a city, but may refer to a suburb or a neighborhood in certain countries or regions.
8080
/// </value>
8181
[JsonProperty(PropertyName = "municipalitySubdivision")]
8282
public string MunicipalitySubdivision { get; set; }

skills/src/csharp/pointofinterestskill/pointofinterestskill/Models/Foursquare/Location.cs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ public class Location
3434
public string State { get; set; }
3535

3636
[JsonProperty(PropertyName = "country")]
37-
public string Country { get; set; }
37+
public string CountryRegion { get; set; }
3838

3939
[JsonProperty(PropertyName = "formattedAddress")]
4040
public string[] FormattedAddress { get; set; }

0 commit comments

Comments
 (0)