mirror of https://github.com/abpframework/abp.git
2 changed files with 61 additions and 4 deletions
@ -0,0 +1,26 @@ |
|||||
|
using System; |
||||
|
using System.Globalization; |
||||
|
|
||||
|
namespace Volo.Abp.AspNetCore.Mvc.Localization |
||||
|
{ |
||||
|
internal static class GlobalizationHelper |
||||
|
{ |
||||
|
public static bool IsValidCultureCode(string cultureCode) |
||||
|
{ |
||||
|
if (cultureCode.IsNullOrWhiteSpace()) |
||||
|
{ |
||||
|
return false; |
||||
|
} |
||||
|
|
||||
|
try |
||||
|
{ |
||||
|
CultureInfo.GetCultureInfo(cultureCode); |
||||
|
return true; |
||||
|
} |
||||
|
catch (CultureNotFoundException) |
||||
|
{ |
||||
|
return false; |
||||
|
} |
||||
|
} |
||||
|
} |
||||
|
} |
||||
Loading…
Reference in new issue