mirror of
https://github.com/jellyfin/jellyfin.git
synced 2024-06-29 10:23:36 +02:00
move localization classes
This commit is contained in:
parent
25312d7d03
commit
3c1447804b
|
@ -104,6 +104,8 @@ namespace Emby.Dlna.Didl
|
|||
|
||||
writer.WriteStartElement(string.Empty, "item", NS_DIDL);
|
||||
|
||||
AddGeneralProperties(item, null, context, writer, filter);
|
||||
|
||||
writer.WriteAttributeString("restricted", "1");
|
||||
writer.WriteAttributeString("id", clientId);
|
||||
|
||||
|
@ -122,8 +124,6 @@ namespace Emby.Dlna.Didl
|
|||
|
||||
//AddBookmarkInfo(item, user, element);
|
||||
|
||||
AddGeneralProperties(item, null, context, writer, filter);
|
||||
|
||||
// refID?
|
||||
// storeAttribute(itemNode, object, ClassProperties.REF_ID, false);
|
||||
|
||||
|
@ -501,6 +501,8 @@ namespace Emby.Dlna.Didl
|
|||
{
|
||||
writer.WriteStartElement(string.Empty, "container", NS_DIDL);
|
||||
|
||||
AddGeneralProperties(folder, stubType, context, writer, filter);
|
||||
|
||||
writer.WriteAttributeString("restricted", "0");
|
||||
writer.WriteAttributeString("searchable", "1");
|
||||
writer.WriteAttributeString("childCount", childCount.ToString(_usCulture));
|
||||
|
@ -534,8 +536,6 @@ namespace Emby.Dlna.Didl
|
|||
}
|
||||
}
|
||||
|
||||
AddCommonFields(folder, stubType, null, writer, filter);
|
||||
|
||||
AddCover(folder, context, stubType, writer);
|
||||
|
||||
writer.WriteEndElement();
|
||||
|
|
|
@ -67,11 +67,14 @@
|
|||
<Compile Include="FileOrganization\NameUtils.cs" />
|
||||
<Compile Include="FileOrganization\OrganizerScheduledTask.cs" />
|
||||
<Compile Include="FileOrganization\TvFolderOrganizer.cs" />
|
||||
<Compile Include="HttpServer\GetSwaggerResource.cs" />
|
||||
<Compile Include="HttpServer\SocketSharp\HttpUtility.cs" />
|
||||
<Compile Include="HttpServer\IHttpListener.cs" />
|
||||
<Compile Include="HttpServer\Security\AuthorizationContext.cs" />
|
||||
<Compile Include="HttpServer\Security\AuthService.cs" />
|
||||
<Compile Include="HttpServer\Security\SessionContext.cs" />
|
||||
<Compile Include="HttpServer\StreamWriter.cs" />
|
||||
<Compile Include="HttpServer\SwaggerService.cs" />
|
||||
<Compile Include="Images\BaseDynamicImageProvider.cs" />
|
||||
<Compile Include="Intros\DefaultIntroProvider.cs" />
|
||||
<Compile Include="IO\FileRefresher.cs" />
|
||||
|
@ -144,6 +147,7 @@
|
|||
<Compile Include="LiveTv\TunerHosts\M3UTunerHost.cs" />
|
||||
<Compile Include="LiveTv\TunerHosts\MulticastStream.cs" />
|
||||
<Compile Include="LiveTv\TunerHosts\QueueStream.cs" />
|
||||
<Compile Include="Localization\LocalizationManager.cs" />
|
||||
<Compile Include="Logging\PatternsLogger.cs" />
|
||||
<Compile Include="MediaEncoder\EncodingManager.cs" />
|
||||
<Compile Include="News\NewsEntryPoint.cs" />
|
||||
|
@ -230,7 +234,9 @@
|
|||
<Compile Include="UserViews\CollectionFolderImageProvider.cs" />
|
||||
<Compile Include="UserViews\DynamicImageProvider.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\iso6392.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\MediaBrowser.Common\MediaBrowser.Common.csproj">
|
||||
<Project>{9142eefa-7570-41e1-bfcc-468bb571af2f}</Project>
|
||||
|
@ -266,8 +272,246 @@
|
|||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.svg">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.svg</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.svg">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.svg</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\images\explorer_icons.png">
|
||||
<Link>swagger-ui\images\explorer_icons.png</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\images\logo_small.png">
|
||||
<Link>swagger-ui\images\logo_small.png</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\images\pet_store_api.png">
|
||||
<Link>swagger-ui\images\pet_store_api.png</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\images\throbber.gif">
|
||||
<Link>swagger-ui\images\throbber.gif</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\images\wordnik_api.png">
|
||||
<Link>swagger-ui\images\wordnik_api.png</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\index.html">
|
||||
<Link>swagger-ui\index.html</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\backbone-min.js">
|
||||
<Link>swagger-ui\lib\backbone-min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\handlebars-2.0.0.js">
|
||||
<Link>swagger-ui\lib\handlebars-2.0.0.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\highlight.7.3.pack.js">
|
||||
<Link>swagger-ui\lib\highlight.7.3.pack.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\jquery-1.8.0.min.js">
|
||||
<Link>swagger-ui\lib\jquery-1.8.0.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\jquery.ba-bbq.min.js">
|
||||
<Link>swagger-ui\lib\jquery.ba-bbq.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\jquery.slideto.min.js">
|
||||
<Link>swagger-ui\lib\jquery.slideto.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\jquery.wiggle.min.js">
|
||||
<Link>swagger-ui\lib\jquery.wiggle.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\marked.js">
|
||||
<Link>swagger-ui\lib\marked.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\shred.bundle.js">
|
||||
<Link>swagger-ui\lib\shred.bundle.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\shred\content.js">
|
||||
<Link>swagger-ui\lib\shred\content.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\swagger-client.js">
|
||||
<Link>swagger-ui\lib\swagger-client.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\swagger-oauth.js">
|
||||
<Link>swagger-ui\lib\swagger-oauth.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\lib\underscore-min.js">
|
||||
<Link>swagger-ui\lib\underscore-min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\o2c.html">
|
||||
<Link>swagger-ui\o2c.html</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\patch.js">
|
||||
<Link>swagger-ui\patch.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\swagger-ui.js">
|
||||
<Link>swagger-ui\swagger-ui.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\swagger-ui.min.js">
|
||||
<Link>swagger-ui\swagger-ui.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<EmbeddedResource Include="Localization\Core\ar.json" />
|
||||
<EmbeddedResource Include="Localization\Core\bg-BG.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ca.json" />
|
||||
<EmbeddedResource Include="Localization\Core\core.json" />
|
||||
<EmbeddedResource Include="Localization\Core\cs.json" />
|
||||
<EmbeddedResource Include="Localization\Core\da.json" />
|
||||
<EmbeddedResource Include="Localization\Core\de.json" />
|
||||
<EmbeddedResource Include="Localization\Core\el.json" />
|
||||
<EmbeddedResource Include="Localization\Core\en-GB.json" />
|
||||
<EmbeddedResource Include="Localization\Core\en-US.json" />
|
||||
<EmbeddedResource Include="Localization\Core\es-AR.json" />
|
||||
<EmbeddedResource Include="Localization\Core\es-MX.json" />
|
||||
<EmbeddedResource Include="Localization\Core\es.json" />
|
||||
<EmbeddedResource Include="Localization\Core\fi.json" />
|
||||
<EmbeddedResource Include="Localization\Core\fr-CA.json" />
|
||||
<EmbeddedResource Include="Localization\Core\fr.json" />
|
||||
<EmbeddedResource Include="Localization\Core\gsw.json" />
|
||||
<EmbeddedResource Include="Localization\Core\he.json" />
|
||||
<EmbeddedResource Include="Localization\Core\hr.json" />
|
||||
<EmbeddedResource Include="Localization\Core\hu.json" />
|
||||
<EmbeddedResource Include="Localization\Core\id.json" />
|
||||
<EmbeddedResource Include="Localization\Core\it.json" />
|
||||
<EmbeddedResource Include="Localization\Core\kk.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ko.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ms.json" />
|
||||
<EmbeddedResource Include="Localization\Core\nb.json" />
|
||||
<EmbeddedResource Include="Localization\Core\nl.json" />
|
||||
<EmbeddedResource Include="Localization\Core\pl.json" />
|
||||
<EmbeddedResource Include="Localization\Core\pt-BR.json" />
|
||||
<EmbeddedResource Include="Localization\Core\pt-PT.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ro.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ru.json" />
|
||||
<EmbeddedResource Include="Localization\Core\sl-SI.json" />
|
||||
<EmbeddedResource Include="Localization\Core\sv.json" />
|
||||
<EmbeddedResource Include="Localization\Core\tr.json" />
|
||||
<EmbeddedResource Include="Localization\Core\uk.json" />
|
||||
<EmbeddedResource Include="Localization\Core\vi.json" />
|
||||
<EmbeddedResource Include="Localization\Core\zh-CN.json" />
|
||||
<EmbeddedResource Include="Localization\Core\zh-HK.json" />
|
||||
<EmbeddedResource Include="Localization\Core\zh-TW.json" />
|
||||
<EmbeddedResource Include="Localization\countries.json" />
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.eot">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.eot</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.ttf">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.ttf</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.woff">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.woff</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-700.woff2">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.woff2</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.eot">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.eot</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.ttf">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.ttf</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.woff">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.woff</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\fonts\droid-sans-v6-latin-regular.woff2">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.woff2</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\au.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\be.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\br.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\ca.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\co.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\de.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\dk.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\fr.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\gb.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\ie.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\jp.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\kz.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\mx.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\nl.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\nz.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\ru.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Localization\Ratings\us.txt" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\css\reset.css">
|
||||
<Link>swagger-ui\css\reset.css</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\css\screen.css">
|
||||
<Link>swagger-ui\css\screen.css</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\thirdparty\servicestack\swagger-ui\css\typography.css">
|
||||
<Link>swagger-ui\css\typography.css</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
Other similar extension points exist, see Microsoft.Common.targets.
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
using ServiceStack;
|
||||
using MediaBrowser.Model.Services;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.HttpServer
|
||||
namespace Emby.Server.Implementations.HttpServer
|
||||
{
|
||||
/// <summary>
|
||||
/// Class GetDashboardResource
|
|
@ -1,33 +1,13 @@
|
|||
using System;
|
||||
using System.Collections;
|
||||
using System.Collections.Generic;
|
||||
using System.Collections.Specialized;
|
||||
using System.Text;
|
||||
using MediaBrowser.Model.Services;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
|
||||
namespace Emby.Server.Implementations.HttpServer.SocketSharp
|
||||
{
|
||||
public static class MyHttpUtility
|
||||
{
|
||||
sealed class HttpQSCollection : NameValueCollection
|
||||
{
|
||||
public override string ToString()
|
||||
{
|
||||
int count = Count;
|
||||
if (count == 0)
|
||||
return "";
|
||||
StringBuilder sb = new StringBuilder();
|
||||
string[] keys = AllKeys;
|
||||
for (int i = 0; i < count; i++)
|
||||
{
|
||||
sb.AppendFormat("{0}={1}&", keys[i], this[keys[i]]);
|
||||
}
|
||||
if (sb.Length > 0)
|
||||
sb.Length--;
|
||||
return sb.ToString();
|
||||
}
|
||||
}
|
||||
|
||||
// Must be sorted
|
||||
static readonly long[] entities = new long[] {
|
||||
(long)'A' << 56 | (long)'E' << 48 | (long)'l' << 40 | (long)'i' << 32 | (long)'g' << 24,
|
||||
|
@ -607,7 +587,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer.SocketSharp
|
|||
|
||||
byte[] buf = bytes.ToArray();
|
||||
bytes = null;
|
||||
return e.GetString(buf);
|
||||
return e.GetString(buf, 0, buf.Length);
|
||||
|
||||
}
|
||||
|
|
@ -1,17 +1,20 @@
|
|||
using MediaBrowser.Controller;
|
||||
using MediaBrowser.Controller.Net;
|
||||
using System.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Services;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.HttpServer
|
||||
namespace Emby.Server.Implementations.HttpServer
|
||||
{
|
||||
public class SwaggerService : IHasResultFactory, IService
|
||||
{
|
||||
private readonly IServerApplicationPaths _appPaths;
|
||||
private readonly IFileSystem _fileSystem;
|
||||
|
||||
public SwaggerService(IServerApplicationPaths appPaths)
|
||||
public SwaggerService(IServerApplicationPaths appPaths, IFileSystem fileSystem)
|
||||
{
|
||||
_appPaths = appPaths;
|
||||
_fileSystem = fileSystem;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -23,7 +26,7 @@ namespace MediaBrowser.Server.Implementations.HttpServer
|
|||
{
|
||||
var swaggerDirectory = Path.Combine(_appPaths.ApplicationResourcesPath, "swagger-ui");
|
||||
|
||||
var requestedFile = Path.Combine(swaggerDirectory, request.ResourceName.Replace('/', Path.DirectorySeparatorChar));
|
||||
var requestedFile = Path.Combine(swaggerDirectory, request.ResourceName.Replace('/', _fileSystem.DirectorySeparatorChar));
|
||||
|
||||
return ResultFactory.GetStaticFileResult(Request, requestedFile).Result;
|
||||
}
|
|
@ -9,14 +9,11 @@ using System.Collections.Generic;
|
|||
using System.Globalization;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Text;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Controller.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
using MediaBrowser.Model.Logging;
|
||||
using MediaBrowser.Model.Reflection;
|
||||
|
||||
namespace MediaBrowser.Server.Implementations.Localization
|
||||
namespace Emby.Server.Implementations.Localization
|
||||
{
|
||||
/// <summary>
|
||||
/// Class LocalizationManager
|
||||
|
@ -39,6 +36,8 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
private readonly IFileSystem _fileSystem;
|
||||
private readonly IJsonSerializer _jsonSerializer;
|
||||
private readonly ILogger _logger;
|
||||
private readonly IAssemblyInfo _assemblyInfo;
|
||||
private readonly ITextLocalizer _textLocalizer;
|
||||
|
||||
/// <summary>
|
||||
/// Initializes a new instance of the <see cref="LocalizationManager" /> class.
|
||||
|
@ -46,12 +45,14 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
/// <param name="configurationManager">The configuration manager.</param>
|
||||
/// <param name="fileSystem">The file system.</param>
|
||||
/// <param name="jsonSerializer">The json serializer.</param>
|
||||
public LocalizationManager(IServerConfigurationManager configurationManager, IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger)
|
||||
public LocalizationManager(IServerConfigurationManager configurationManager, IFileSystem fileSystem, IJsonSerializer jsonSerializer, ILogger logger, IAssemblyInfo assemblyInfo, ITextLocalizer textLocalizer)
|
||||
{
|
||||
_configurationManager = configurationManager;
|
||||
_fileSystem = fileSystem;
|
||||
_jsonSerializer = jsonSerializer;
|
||||
_logger = logger;
|
||||
_assemblyInfo = assemblyInfo;
|
||||
_textLocalizer = textLocalizer;
|
||||
|
||||
ExtractAll();
|
||||
}
|
||||
|
@ -65,20 +66,20 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
|
||||
_fileSystem.CreateDirectory(localizationPath);
|
||||
|
||||
var existingFiles = Directory.EnumerateFiles(localizationPath, "ratings-*.txt", SearchOption.TopDirectoryOnly)
|
||||
var existingFiles = GetRatingsFiles(localizationPath)
|
||||
.Select(Path.GetFileName)
|
||||
.ToList();
|
||||
|
||||
// Extract from the assembly
|
||||
foreach (var resource in type.Assembly
|
||||
.GetManifestResourceNames()
|
||||
foreach (var resource in _assemblyInfo
|
||||
.GetManifestResourceNames(type)
|
||||
.Where(i => i.StartsWith(resourcePath)))
|
||||
{
|
||||
var filename = "ratings-" + resource.Substring(resourcePath.Length);
|
||||
|
||||
if (!existingFiles.Contains(filename))
|
||||
{
|
||||
using (var stream = type.Assembly.GetManifestResourceStream(resource))
|
||||
using (var stream = _assemblyInfo.GetManifestResourceStream(type, resource))
|
||||
{
|
||||
var target = Path.Combine(localizationPath, filename);
|
||||
_logger.Info("Extracting ratings to {0}", target);
|
||||
|
@ -90,13 +91,21 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
}
|
||||
}
|
||||
}
|
||||
|
||||
foreach (var file in Directory.EnumerateFiles(localizationPath, "ratings-*.txt", SearchOption.TopDirectoryOnly))
|
||||
|
||||
foreach (var file in GetRatingsFiles(localizationPath))
|
||||
{
|
||||
LoadRatings(file);
|
||||
}
|
||||
}
|
||||
|
||||
private List<string> GetRatingsFiles(string directory)
|
||||
{
|
||||
return _fileSystem.GetFilePaths(directory, false)
|
||||
.Where(i => string.Equals(Path.GetExtension(i), ".txt", StringComparison.OrdinalIgnoreCase))
|
||||
.Where(i => Path.GetFileName(i).StartsWith("ratings-", StringComparison.OrdinalIgnoreCase))
|
||||
.ToList();
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the localization path.
|
||||
/// </summary>
|
||||
|
@ -111,16 +120,12 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
|
||||
public string RemoveDiacritics(string text)
|
||||
{
|
||||
return String.Concat(
|
||||
text.Normalize(NormalizationForm.FormD)
|
||||
.Where(ch => CharUnicodeInfo.GetUnicodeCategory(ch) !=
|
||||
UnicodeCategory.NonSpacingMark)
|
||||
).Normalize(NormalizationForm.FormC);
|
||||
return _textLocalizer.RemoveDiacritics(text);
|
||||
}
|
||||
|
||||
public string NormalizeFormKD(string text)
|
||||
{
|
||||
return text.Normalize(NormalizationForm.FormKD);
|
||||
return _textLocalizer.NormalizeFormKD(text);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
|
@ -134,7 +139,7 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
|
||||
var list = new List<CultureDto>();
|
||||
|
||||
using (var stream = type.Assembly.GetManifestResourceStream(path))
|
||||
using (var stream = _assemblyInfo.GetManifestResourceStream(type, path))
|
||||
{
|
||||
using (var reader = new StreamReader(stream))
|
||||
{
|
||||
|
@ -176,7 +181,7 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
var type = GetType();
|
||||
var path = type.Namespace + ".countries.json";
|
||||
|
||||
using (var stream = type.Assembly.GetManifestResourceStream(path))
|
||||
using (var stream = _assemblyInfo.GetManifestResourceStream(type, path))
|
||||
{
|
||||
return _jsonSerializer.DeserializeFromStream<List<CountryInfo>>(stream);
|
||||
}
|
||||
|
@ -234,7 +239,7 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
/// <returns>Dictionary{System.StringParentalRating}.</returns>
|
||||
private void LoadRatings(string file)
|
||||
{
|
||||
var dict = File.ReadAllLines(file).Select(i =>
|
||||
var dict = _fileSystem.ReadAllLines(file).Select(i =>
|
||||
{
|
||||
if (!string.IsNullOrWhiteSpace(i))
|
||||
{
|
||||
|
@ -337,18 +342,17 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
{
|
||||
var dictionary = new Dictionary<string, string>(StringComparer.OrdinalIgnoreCase);
|
||||
|
||||
var assembly = GetType().Assembly;
|
||||
var namespaceName = GetType().Namespace + "." + prefix;
|
||||
|
||||
CopyInto(dictionary, namespaceName + "." + baseFilename, assembly);
|
||||
CopyInto(dictionary, namespaceName + "." + GetResourceFilename(culture), assembly);
|
||||
CopyInto(dictionary, namespaceName + "." + baseFilename);
|
||||
CopyInto(dictionary, namespaceName + "." + GetResourceFilename(culture));
|
||||
|
||||
return dictionary;
|
||||
}
|
||||
|
||||
private void CopyInto(IDictionary<string, string> dictionary, string resourcePath, Assembly assembly)
|
||||
private void CopyInto(IDictionary<string, string> dictionary, string resourcePath)
|
||||
{
|
||||
using (var stream = assembly.GetManifestResourceStream(resourcePath))
|
||||
using (var stream = _assemblyInfo.GetManifestResourceStream(GetType(), resourcePath))
|
||||
{
|
||||
if (stream != null)
|
||||
{
|
||||
|
@ -419,4 +423,11 @@ namespace MediaBrowser.Server.Implementations.Localization
|
|||
}.OrderBy(i => i.Name);
|
||||
}
|
||||
}
|
||||
|
||||
public interface ITextLocalizer
|
||||
{
|
||||
string RemoveDiacritics(string text);
|
||||
|
||||
string NormalizeFormKD(string text);
|
||||
}
|
||||
}
|
|
@ -18,6 +18,7 @@ using System.Reflection;
|
|||
using System.Threading;
|
||||
using System.Threading.Tasks;
|
||||
using Emby.Server.Implementations.HttpServer;
|
||||
using Emby.Server.Implementations.HttpServer.SocketSharp;
|
||||
using MediaBrowser.Common.Net;
|
||||
using MediaBrowser.Common.Security;
|
||||
using MediaBrowser.Controller;
|
||||
|
|
|
@ -3,6 +3,7 @@ using System.Collections.Generic;
|
|||
using System.Collections.Specialized;
|
||||
using System.IO;
|
||||
using System.Text;
|
||||
using Emby.Server.Implementations.HttpServer.SocketSharp;
|
||||
using Funq;
|
||||
using MediaBrowser.Common.IO;
|
||||
using MediaBrowser.Model.IO;
|
||||
|
|
|
@ -117,7 +117,6 @@
|
|||
<Compile Include="Devices\CameraUploadsFolder.cs" />
|
||||
<Compile Include="EntryPoints\ExternalPortForwarding.cs" />
|
||||
<Compile Include="HttpServer\ContainerAdapter.cs" />
|
||||
<Compile Include="HttpServer\GetSwaggerResource.cs" />
|
||||
<Compile Include="HttpServer\HttpListenerHost.cs" />
|
||||
<Compile Include="HttpServer\HttpResultFactory.cs" />
|
||||
<Compile Include="HttpServer\LoggerUtils.cs" />
|
||||
|
@ -126,9 +125,7 @@
|
|||
<Compile Include="HttpServer\ServerFactory.cs" />
|
||||
<Compile Include="HttpServer\ServerLogFactory.cs" />
|
||||
<Compile Include="HttpServer\ServerLogger.cs" />
|
||||
<Compile Include="HttpServer\SocketSharp\HttpUtility.cs" />
|
||||
<Compile Include="HttpServer\SocketSharp\SharpWebSocket.cs" />
|
||||
<Compile Include="HttpServer\SwaggerService.cs" />
|
||||
<Compile Include="HttpServer\SocketSharp\Extensions.cs" />
|
||||
<Compile Include="HttpServer\SocketSharp\RequestMono.cs" />
|
||||
<Compile Include="HttpServer\SocketSharp\WebSocketSharpListener.cs" />
|
||||
|
@ -158,7 +155,6 @@
|
|||
<Compile Include="LiveTv\TunerHosts\SatIp\SatIpHost.cs" />
|
||||
<Compile Include="LiveTv\TunerHosts\SatIp\TransmissionMode.cs" />
|
||||
<Compile Include="LiveTv\TunerHosts\SatIp\Utils.cs" />
|
||||
<Compile Include="Localization\LocalizationManager.cs" />
|
||||
<Compile Include="Persistence\BaseSqliteRepository.cs" />
|
||||
<Compile Include="Persistence\DataExtensions.cs" />
|
||||
<Compile Include="Persistence\IDbConnector.cs" />
|
||||
|
@ -202,162 +198,7 @@
|
|||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\backbone-min.js">
|
||||
<Link>swagger-ui\lib\backbone-min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\handlebars-2.0.0.js">
|
||||
<Link>swagger-ui\lib\handlebars-2.0.0.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\highlight.7.3.pack.js">
|
||||
<Link>swagger-ui\lib\highlight.7.3.pack.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery-1.8.0.min.js">
|
||||
<Link>swagger-ui\lib\jquery-1.8.0.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.ba-bbq.min.js">
|
||||
<Link>swagger-ui\lib\jquery.ba-bbq.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.slideto.min.js">
|
||||
<Link>swagger-ui\lib\jquery.slideto.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\jquery.wiggle.min.js">
|
||||
<Link>swagger-ui\lib\jquery.wiggle.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\marked.js">
|
||||
<Link>swagger-ui\lib\marked.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\shred.bundle.js">
|
||||
<Link>swagger-ui\lib\shred.bundle.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\swagger-client.js">
|
||||
<Link>swagger-ui\lib\swagger-client.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\swagger-oauth.js">
|
||||
<Link>swagger-ui\lib\swagger-oauth.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\underscore-min.js">
|
||||
<Link>swagger-ui\lib\underscore-min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\o2c.html">
|
||||
<Link>swagger-ui\o2c.html</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\patch.js">
|
||||
<Link>swagger-ui\patch.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\swagger-ui.js">
|
||||
<Link>swagger-ui\swagger-ui.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\swagger-ui.min.js">
|
||||
<Link>swagger-ui\swagger-ui.min.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.eot">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.eot</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.ttf">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.ttf</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.woff">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.woff</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.woff2">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.woff2</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.eot">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.eot</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.ttf">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.ttf</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.woff">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.woff</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.woff2">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.woff2</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<EmbeddedResource Include="Localization\Ratings\us.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\ru.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\nz.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\nl.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\mx.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\kz.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\jp.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\ie.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\gb.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\fr.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\dk.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\de.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\co.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\ca.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\br.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\be.txt" />
|
||||
<EmbeddedResource Include="Localization\Ratings\au.txt" />
|
||||
<EmbeddedResource Include="Localization\iso6392.txt" />
|
||||
<None Include="app.config" />
|
||||
<EmbeddedResource Include="Localization\Core\ar.json" />
|
||||
<EmbeddedResource Include="Localization\Core\bg-BG.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ca.json" />
|
||||
<EmbeddedResource Include="Localization\Core\core.json" />
|
||||
<EmbeddedResource Include="Localization\Core\cs.json" />
|
||||
<EmbeddedResource Include="Localization\Core\da.json" />
|
||||
<EmbeddedResource Include="Localization\Core\de.json" />
|
||||
<EmbeddedResource Include="Localization\Core\el.json" />
|
||||
<EmbeddedResource Include="Localization\Core\en-GB.json" />
|
||||
<EmbeddedResource Include="Localization\Core\en-US.json" />
|
||||
<EmbeddedResource Include="Localization\Core\es-AR.json" />
|
||||
<EmbeddedResource Include="Localization\Core\es-MX.json" />
|
||||
<EmbeddedResource Include="Localization\Core\es.json" />
|
||||
<EmbeddedResource Include="Localization\Core\fi.json" />
|
||||
<EmbeddedResource Include="Localization\Core\fr-CA.json" />
|
||||
<EmbeddedResource Include="Localization\Core\fr.json" />
|
||||
<EmbeddedResource Include="Localization\Core\gsw.json" />
|
||||
<EmbeddedResource Include="Localization\Core\he.json" />
|
||||
<EmbeddedResource Include="Localization\Core\hr.json" />
|
||||
<EmbeddedResource Include="Localization\Core\hu.json" />
|
||||
<EmbeddedResource Include="Localization\Core\id.json" />
|
||||
<EmbeddedResource Include="Localization\Core\it.json" />
|
||||
<EmbeddedResource Include="Localization\Core\kk.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ko.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ms.json" />
|
||||
<EmbeddedResource Include="Localization\Core\nb.json" />
|
||||
<EmbeddedResource Include="Localization\Core\nl.json" />
|
||||
<EmbeddedResource Include="Localization\Core\pl.json" />
|
||||
<EmbeddedResource Include="Localization\Core\pt-BR.json" />
|
||||
<EmbeddedResource Include="Localization\Core\pt-PT.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ro.json" />
|
||||
<EmbeddedResource Include="Localization\Core\ru.json" />
|
||||
<EmbeddedResource Include="Localization\Core\sl-SI.json" />
|
||||
<EmbeddedResource Include="Localization\Core\sv.json" />
|
||||
<EmbeddedResource Include="Localization\Core\tr.json" />
|
||||
<EmbeddedResource Include="Localization\Core\uk.json" />
|
||||
<EmbeddedResource Include="Localization\Core\vi.json" />
|
||||
<EmbeddedResource Include="Localization\Core\zh-CN.json" />
|
||||
<EmbeddedResource Include="Localization\Core\zh-HK.json" />
|
||||
<EmbeddedResource Include="Localization\Core\zh-TW.json" />
|
||||
<EmbeddedResource Include="Localization\countries.json" />
|
||||
<None Include="LiveTv\TunerHosts\SatIp\ini\satellite\0030.ini" />
|
||||
<None Include="LiveTv\TunerHosts\SatIp\ini\satellite\0049.ini" />
|
||||
<None Include="LiveTv\TunerHosts\SatIp\ini\satellite\0070.ini" />
|
||||
|
@ -529,56 +370,6 @@
|
|||
<None Include="LiveTv\TunerHosts\SatIp\ini\satellite\3594.ini" />
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\css\reset.css">
|
||||
<Link>swagger-ui\css\reset.css</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\css\screen.css">
|
||||
<Link>swagger-ui\css\screen.css</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\css\typography.css">
|
||||
<Link>swagger-ui\css\typography.css</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-700.svg">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-700.svg</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\fonts\droid-sans-v6-latin-regular.svg">
|
||||
<Link>swagger-ui\fonts\droid-sans-v6-latin-regular.svg</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\explorer_icons.png">
|
||||
<Link>swagger-ui\images\explorer_icons.png</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\logo_small.png">
|
||||
<Link>swagger-ui\images\logo_small.png</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\pet_store_api.png">
|
||||
<Link>swagger-ui\images\pet_store_api.png</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\throbber.gif">
|
||||
<Link>swagger-ui\images\throbber.gif</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\images\wordnik_api.png">
|
||||
<Link>swagger-ui\images\wordnik_api.png</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\index.html">
|
||||
<Link>swagger-ui\index.html</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<Content Include="..\ThirdParty\ServiceStack\swagger-ui\lib\shred\content.js">
|
||||
<Link>swagger-ui\lib\shred\content.js</Link>
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<!-- To modify your build process, add your task inside one of the targets below and uncomment it.
|
||||
|
|
|
@ -54,7 +54,6 @@ using MediaBrowser.Server.Implementations.Configuration;
|
|||
using MediaBrowser.Server.Implementations.Devices;
|
||||
using MediaBrowser.Server.Implementations.HttpServer;
|
||||
using MediaBrowser.Server.Implementations.IO;
|
||||
using MediaBrowser.Server.Implementations.Localization;
|
||||
using MediaBrowser.Server.Implementations.Notifications;
|
||||
using MediaBrowser.Server.Implementations.Persistence;
|
||||
using MediaBrowser.Server.Implementations.Security;
|
||||
|
@ -107,6 +106,7 @@ using Emby.Server.Implementations.FileOrganization;
|
|||
using Emby.Server.Implementations.HttpServer.Security;
|
||||
using Emby.Server.Implementations.Library;
|
||||
using Emby.Server.Implementations.LiveTv;
|
||||
using Emby.Server.Implementations.Localization;
|
||||
using Emby.Server.Implementations.MediaEncoder;
|
||||
using Emby.Server.Implementations.Notifications;
|
||||
using Emby.Server.Implementations.Persistence;
|
||||
|
@ -548,7 +548,10 @@ namespace MediaBrowser.Server.Startup.Common
|
|||
|
||||
RegisterSingleInstance(ServerConfigurationManager);
|
||||
|
||||
LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LogManager.GetLogger("LocalizationManager"));
|
||||
IAssemblyInfo assemblyInfo = new AssemblyInfo();
|
||||
RegisterSingleInstance<IAssemblyInfo>(assemblyInfo);
|
||||
|
||||
LocalizationManager = new LocalizationManager(ServerConfigurationManager, FileSystemManager, JsonSerializer, LogManager.GetLogger("LocalizationManager"), assemblyInfo, new TextLocalizer());
|
||||
StringExtensions.LocalizationManager = LocalizationManager;
|
||||
RegisterSingleInstance(LocalizationManager);
|
||||
|
||||
|
@ -558,8 +561,6 @@ namespace MediaBrowser.Server.Startup.Common
|
|||
RegisterSingleInstance<IBlurayExaminer>(() => new BdInfoExaminer(FileSystemManager, textEncoding));
|
||||
|
||||
RegisterSingleInstance<IXmlReaderSettingsFactory>(new XmlReaderSettingsFactory());
|
||||
IAssemblyInfo assemblyInfo = new AssemblyInfo();
|
||||
RegisterSingleInstance<IAssemblyInfo>(assemblyInfo);
|
||||
|
||||
UserDataManager = new UserDataManager(LogManager, ServerConfigurationManager);
|
||||
RegisterSingleInstance(UserDataManager);
|
||||
|
|
|
@ -89,6 +89,7 @@
|
|||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
<Compile Include="StartupOptions.cs" />
|
||||
<Compile Include="SystemEvents.cs" />
|
||||
<Compile Include="TextLocalizer.cs" />
|
||||
<Compile Include="Threading\PeriodicTimer.cs" />
|
||||
<Compile Include="UnhandledExceptionWriter.cs" />
|
||||
</ItemGroup>
|
||||
|
|
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);
|
||||
}
|
||||
}
|
||||
}
|
Loading…
Reference in a new issue