mirror of
https://github.com/jellyfin/jellyfin.git
synced 2025-12-27 03:04:49 +03:00
move localization classes
This commit is contained in:
25
MediaBrowser.Server.Startup.Common/TextLocalizer.cs
Normal file
25
MediaBrowser.Server.Startup.Common/TextLocalizer.cs
Normal file
@@ -0,0 +1,25 @@
|
||||
using System;
|
||||
using System.Globalization;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using Emby.Server.Implementations.Localization;
|
||||
|
||||
namespace MediaBrowser.Server.Startup.Common
|
||||
{
|
||||
public class TextLocalizer : ITextLocalizer
|
||||
{
|
||||
public string RemoveDiacritics(string text)
|
||||
{
|
||||
return String.Concat(
|
||||
text.Normalize(NormalizationForm.FormD)
|
||||
.Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) !=
|
||||
UnicodeCategory.NonSpacingMark)
|
||||
).Normalize(NormalizationForm.FormC);
|
||||
}
|
||||
|
||||
public string NormalizeFormKD(string text)
|
||||
{
|
||||
return text.Normalize(NormalizationForm.FormKD);
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user