File tree Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Expand file tree Collapse file tree 2 files changed +5
-7
lines changed Original file line number Diff line number Diff line change @@ -143,10 +143,10 @@ public static PageStyle GetViewStyle(Size s)
143
143
}
144
144
}
145
145
146
- public static string GetCountryCode ( )
146
+ public static string GetCountryISO ( )
147
147
{
148
- var c = CultureInfo . CurrentCulture . TwoLetterISOLanguageName ;
149
- return GetCountryCode ( c . ToUpper ( ) ) ;
148
+ var c = CultureInfo . CurrentCulture . Name ;
149
+ return c . Substring ( c . Length - 2 ) ;
150
150
}
151
151
152
152
public static bool ContainsCaseInsensitive ( this string str , string value )
Original file line number Diff line number Diff line change @@ -130,7 +130,7 @@ public async Task RefreshContacts(CancellationToken? cancellationToken = null)
130
130
{
131
131
contactAnnotationList = contactAnnotationLists [ 0 ] ;
132
132
}
133
-
133
+
134
134
foreach ( var contact in contacts )
135
135
{
136
136
var phones = contact . Phones ;
@@ -333,9 +333,7 @@ await Task.Run(() =>
333
333
/// <returns>A number in E164 format</returns>
334
334
private string ParsePhoneNumber ( string number )
335
335
{
336
- // on phone we should try to get their SIM country code
337
- // otherwise we should try to use the user's location?
338
- PhoneNumber phoneNumber = phoneNumberUtil . Parse ( number , "US" ) ;
336
+ PhoneNumber phoneNumber = phoneNumberUtil . Parse ( number , Utils . GetCountryISO ( ) ) ;
339
337
return phoneNumberUtil . Format ( phoneNumber , PhoneNumberFormat . E164 ) ;
340
338
}
341
339
}
You can’t perform that action at this time.
0 commit comments