A comprehensive .NET library for internationalization (I18n) services including country data, currency conversion, and phone number validation.
- Country information with ISO codes, names, and capitals
- Phone number formats and regex patterns
- Postal code formats and validation rules
- Currency information per country
- Language and top-level domain data
- Economic alliance information
- Complete currency information and codes
- Real-time currency conversion with external API integration
- Memory caching for exchange rates
- Support for all major world currencies
- Phone number validation by country
- Automatic formatting and normalization
- Mobile vs landline detection
- Area code validation
- International dialing code support
Core service components containing the business logic and data access layer.
Key Models:
Country- Complete country informationCurrency- Currency data and codesPnp(Phone Numbering Plan) - Phone validation rulesPnpResult- Phone validation resultsCurrencyRates- Exchange rate data
Key Services:
CountriesService- Country data retrieval and lookupCurrenciesService- Currency operations and conversionPhoneNumberingPlansService- Phone number validationExternalCurrencyRatesService- Live exchange rate fetching
dotnet add package SimplyWorks.I18n.Service// Get country information
var countriesService = new CountriesService();
var country = countriesService.Get("US");
Console.WriteLine($"{country.Name} - {country.CurrencyCode}");
// Validate phone number
var phoneService = new PhoneNumberingPlansService(countriesService);
var result = phoneService.Validate("+1234567890", "US");
if (result.Status == PnpResultStatus.Ok)
{
Console.WriteLine($"Valid {result.PhoneType} phone number");
}
// Convert currency
var currenciesService = new CurrenciesService(/* dependencies */);
var converted = await currenciesService.ConvertAsync(100m, "USD", "EUR");The library includes embedded binary data files containing:
country.bin- Country information databasecntryd.bin- Country lookup datapnpd.bin- Phone numbering plan database
- .NET Standard 2.1
- Entity Framework Core (for service package)
- Memory caching support
This project is licensed under the MIT License.
Comprehensive .NET internationalization services for country data lookup, real-time currency conversion, and phone number validation. Includes embedded databases for countries, currencies, and phone numbering plans with memory caching support. Provides country information with ISO codes, currency conversion with live exchange rates, and phone number validation with mobile/landline detection. For full documentation and examples, visit: https://github.com/simplify9/SW-I18nServices