TrevorPilley / phone-number-parser

A .NET library for parsing phone numbers.
MIT License
19 stars 1 forks source link

Add an English version of geographic areas which are not written in Latin characters #166

Open TrevorPilley opened 3 years ago

TrevorPilley commented 3 years ago

Whilst the library intends to show the geographic area name in the local spelling, for non Latin alphabets (e.g. Hebrew, Arabic and Cyrillic) or script based (e.g. Chinese and Japanese) it would be helpful for the library to also show the English translation.

TrevorPilley commented 1 year ago

One idea is to follow the same approach used in RegionInfo and have string GeographicAreaEnglish { get; } alongside a string GeographicAreaNative { get; } the existing string GeographicArea { get; } would then return the appropriate value based upon the current culture (native if a match, English if not)

TrevorPilley commented 1 year ago

Another idea is to have region specific translations which is just a dictionary of name changes and a GetName(CultureInfo) method which would then read from a file (translations/IT/EN.txt) with content something like this - Firenze|Florence this would be more flexible and support translations between any languages it was coded for but also a lot more effort to populate and maintain.

TrevorPilley commented 1 year ago

Also consider if the equivalent should apply for the country name on CountryInfo

TrevorPilley commented 6 months ago

Think about how this can be implemented in a consistent way as at present CountryInfo.Name is always in English but GeographicPhoneNumber.GeographicArea is in the locality of the country where possible.

TrevorPilley commented 5 months ago

CountryInfo.Name is changed to return the name of the country the native language of the country, CountryInfo.NameEnglish is added to return the name of the country in English.