浏览代码

move localization classes

Luke Pulverenti 8 年之前
父节点
当前提交
3c1447804b
共有 71 个文件被更改,包括 329 次插入271 次删除
  1. 4 4
      Emby.Dlna/Didl/DidlBuilder.cs
  2. 245 1
      Emby.Server.Implementations/Emby.Server.Implementations.csproj
  3. 2 2
      Emby.Server.Implementations/HttpServer/GetSwaggerResource.cs
  4. 2 22
      Emby.Server.Implementations/HttpServer/SocketSharp/HttpUtility.cs
  5. 6 3
      Emby.Server.Implementations/HttpServer/SwaggerService.cs
  6. 0 0
      Emby.Server.Implementations/Localization/Core/ar.json
  7. 0 0
      Emby.Server.Implementations/Localization/Core/bg-BG.json
  8. 0 0
      Emby.Server.Implementations/Localization/Core/ca.json
  9. 0 0
      Emby.Server.Implementations/Localization/Core/core.json
  10. 0 0
      Emby.Server.Implementations/Localization/Core/cs.json
  11. 0 0
      Emby.Server.Implementations/Localization/Core/da.json
  12. 0 0
      Emby.Server.Implementations/Localization/Core/de.json
  13. 0 0
      Emby.Server.Implementations/Localization/Core/el.json
  14. 0 0
      Emby.Server.Implementations/Localization/Core/en-GB.json
  15. 0 0
      Emby.Server.Implementations/Localization/Core/en-US.json
  16. 0 0
      Emby.Server.Implementations/Localization/Core/es-AR.json
  17. 0 0
      Emby.Server.Implementations/Localization/Core/es-MX.json
  18. 0 0
      Emby.Server.Implementations/Localization/Core/es.json
  19. 0 0
      Emby.Server.Implementations/Localization/Core/fi.json
  20. 0 0
      Emby.Server.Implementations/Localization/Core/fr-CA.json
  21. 0 0
      Emby.Server.Implementations/Localization/Core/fr.json
  22. 0 0
      Emby.Server.Implementations/Localization/Core/gsw.json
  23. 0 0
      Emby.Server.Implementations/Localization/Core/he.json
  24. 0 0
      Emby.Server.Implementations/Localization/Core/hr.json
  25. 0 0
      Emby.Server.Implementations/Localization/Core/hu.json
  26. 0 0
      Emby.Server.Implementations/Localization/Core/id.json
  27. 0 0
      Emby.Server.Implementations/Localization/Core/it.json
  28. 0 0
      Emby.Server.Implementations/Localization/Core/kk.json
  29. 0 0
      Emby.Server.Implementations/Localization/Core/ko.json
  30. 0 0
      Emby.Server.Implementations/Localization/Core/ms.json
  31. 0 0
      Emby.Server.Implementations/Localization/Core/nb.json
  32. 0 0
      Emby.Server.Implementations/Localization/Core/nl.json
  33. 0 0
      Emby.Server.Implementations/Localization/Core/pl.json
  34. 0 0
      Emby.Server.Implementations/Localization/Core/pt-BR.json
  35. 0 0
      Emby.Server.Implementations/Localization/Core/pt-PT.json
  36. 0 0
      Emby.Server.Implementations/Localization/Core/ro.json
  37. 0 0
      Emby.Server.Implementations/Localization/Core/ru.json
  38. 0 0
      Emby.Server.Implementations/Localization/Core/sl-SI.json
  39. 0 0
      Emby.Server.Implementations/Localization/Core/sv.json
  40. 0 0
      Emby.Server.Implementations/Localization/Core/tr.json
  41. 0 0
      Emby.Server.Implementations/Localization/Core/uk.json
  42. 0 0
      Emby.Server.Implementations/Localization/Core/vi.json
  43. 0 0
      Emby.Server.Implementations/Localization/Core/zh-CN.json
  44. 0 0
      Emby.Server.Implementations/Localization/Core/zh-HK.json
  45. 0 0
      Emby.Server.Implementations/Localization/Core/zh-TW.json
  46. 37 26
      Emby.Server.Implementations/Localization/LocalizationManager.cs
  47. 0 0
      Emby.Server.Implementations/Localization/Ratings/au.txt
  48. 0 0
      Emby.Server.Implementations/Localization/Ratings/be.txt
  49. 0 0
      Emby.Server.Implementations/Localization/Ratings/br.txt
  50. 0 0
      Emby.Server.Implementations/Localization/Ratings/ca.txt
  51. 0 0
      Emby.Server.Implementations/Localization/Ratings/co.txt
  52. 0 0
      Emby.Server.Implementations/Localization/Ratings/de.txt
  53. 0 0
      Emby.Server.Implementations/Localization/Ratings/dk.txt
  54. 0 0
      Emby.Server.Implementations/Localization/Ratings/fr.txt
  55. 0 0
      Emby.Server.Implementations/Localization/Ratings/gb.txt
  56. 0 0
      Emby.Server.Implementations/Localization/Ratings/ie.txt
  57. 0 0
      Emby.Server.Implementations/Localization/Ratings/jp.txt
  58. 0 0
      Emby.Server.Implementations/Localization/Ratings/kz.txt
  59. 0 0
      Emby.Server.Implementations/Localization/Ratings/mx.txt
  60. 0 0
      Emby.Server.Implementations/Localization/Ratings/nl.txt
  61. 0 0
      Emby.Server.Implementations/Localization/Ratings/nz.txt
  62. 0 0
      Emby.Server.Implementations/Localization/Ratings/ru.txt
  63. 0 0
      Emby.Server.Implementations/Localization/Ratings/us.txt
  64. 0 0
      Emby.Server.Implementations/Localization/countries.json
  65. 0 0
      Emby.Server.Implementations/Localization/iso6392.txt
  66. 1 0
      MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs
  67. 1 0
      MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs
  68. 0 209
      MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj
  69. 5 4
      MediaBrowser.Server.Startup.Common/ApplicationHost.cs
  70. 1 0
      MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj
  71. 25 0
      MediaBrowser.Server.Startup.Common/TextLocalizer.cs

+ 4 - 4
Emby.Dlna/Didl/DidlBuilder.cs

@@ -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();

+ 245 - 1
Emby.Server.Implementations/Emby.Server.Implementations.csproj

@@ -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.

+ 2 - 2
MediaBrowser.Server.Implementations/HttpServer/GetSwaggerResource.cs → Emby.Server.Implementations/HttpServer/GetSwaggerResource.cs

@@ -1,6 +1,6 @@
-using ServiceStack;
+using MediaBrowser.Model.Services;
 
-namespace MediaBrowser.Server.Implementations.HttpServer
+namespace Emby.Server.Implementations.HttpServer
 {
     /// <summary>
     /// Class GetDashboardResource

+ 2 - 22
MediaBrowser.Server.Implementations/HttpServer/SocketSharp/HttpUtility.cs → Emby.Server.Implementations/HttpServer/SocketSharp/HttpUtility.cs

@@ -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);
 
         }
 

+ 6 - 3
MediaBrowser.Server.Implementations/HttpServer/SwaggerService.cs → Emby.Server.Implementations/HttpServer/SwaggerService.cs

@@ -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;
         }

+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/ar.json → Emby.Server.Implementations/Localization/Core/ar.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/bg-BG.json → Emby.Server.Implementations/Localization/Core/bg-BG.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/ca.json → Emby.Server.Implementations/Localization/Core/ca.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/core.json → Emby.Server.Implementations/Localization/Core/core.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/cs.json → Emby.Server.Implementations/Localization/Core/cs.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/da.json → Emby.Server.Implementations/Localization/Core/da.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/de.json → Emby.Server.Implementations/Localization/Core/de.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/el.json → Emby.Server.Implementations/Localization/Core/el.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/en-GB.json → Emby.Server.Implementations/Localization/Core/en-GB.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/en-US.json → Emby.Server.Implementations/Localization/Core/en-US.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/es-AR.json → Emby.Server.Implementations/Localization/Core/es-AR.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/es-MX.json → Emby.Server.Implementations/Localization/Core/es-MX.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/es.json → Emby.Server.Implementations/Localization/Core/es.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/fi.json → Emby.Server.Implementations/Localization/Core/fi.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/fr-CA.json → Emby.Server.Implementations/Localization/Core/fr-CA.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/fr.json → Emby.Server.Implementations/Localization/Core/fr.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/gsw.json → Emby.Server.Implementations/Localization/Core/gsw.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/he.json → Emby.Server.Implementations/Localization/Core/he.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/hr.json → Emby.Server.Implementations/Localization/Core/hr.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/hu.json → Emby.Server.Implementations/Localization/Core/hu.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/id.json → Emby.Server.Implementations/Localization/Core/id.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/it.json → Emby.Server.Implementations/Localization/Core/it.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/kk.json → Emby.Server.Implementations/Localization/Core/kk.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/ko.json → Emby.Server.Implementations/Localization/Core/ko.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/ms.json → Emby.Server.Implementations/Localization/Core/ms.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/nb.json → Emby.Server.Implementations/Localization/Core/nb.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/nl.json → Emby.Server.Implementations/Localization/Core/nl.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/pl.json → Emby.Server.Implementations/Localization/Core/pl.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/pt-BR.json → Emby.Server.Implementations/Localization/Core/pt-BR.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/pt-PT.json → Emby.Server.Implementations/Localization/Core/pt-PT.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/ro.json → Emby.Server.Implementations/Localization/Core/ro.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/ru.json → Emby.Server.Implementations/Localization/Core/ru.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/sl-SI.json → Emby.Server.Implementations/Localization/Core/sl-SI.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/sv.json → Emby.Server.Implementations/Localization/Core/sv.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/tr.json → Emby.Server.Implementations/Localization/Core/tr.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/uk.json → Emby.Server.Implementations/Localization/Core/uk.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/vi.json → Emby.Server.Implementations/Localization/Core/vi.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/zh-CN.json → Emby.Server.Implementations/Localization/Core/zh-CN.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/zh-HK.json → Emby.Server.Implementations/Localization/Core/zh-HK.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Core/zh-TW.json → Emby.Server.Implementations/Localization/Core/zh-TW.json


+ 37 - 26
MediaBrowser.Server.Implementations/Localization/LocalizationManager.cs → Emby.Server.Implementations/Localization/LocalizationManager.cs

@@ -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);
+    }
 }

+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/au.txt → Emby.Server.Implementations/Localization/Ratings/au.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/be.txt → Emby.Server.Implementations/Localization/Ratings/be.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/br.txt → Emby.Server.Implementations/Localization/Ratings/br.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/ca.txt → Emby.Server.Implementations/Localization/Ratings/ca.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/co.txt → Emby.Server.Implementations/Localization/Ratings/co.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/de.txt → Emby.Server.Implementations/Localization/Ratings/de.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/dk.txt → Emby.Server.Implementations/Localization/Ratings/dk.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/fr.txt → Emby.Server.Implementations/Localization/Ratings/fr.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/gb.txt → Emby.Server.Implementations/Localization/Ratings/gb.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/ie.txt → Emby.Server.Implementations/Localization/Ratings/ie.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/jp.txt → Emby.Server.Implementations/Localization/Ratings/jp.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/kz.txt → Emby.Server.Implementations/Localization/Ratings/kz.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/mx.txt → Emby.Server.Implementations/Localization/Ratings/mx.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/nl.txt → Emby.Server.Implementations/Localization/Ratings/nl.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/nz.txt → Emby.Server.Implementations/Localization/Ratings/nz.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/ru.txt → Emby.Server.Implementations/Localization/Ratings/ru.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/Ratings/us.txt → Emby.Server.Implementations/Localization/Ratings/us.txt


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/countries.json → Emby.Server.Implementations/Localization/countries.json


+ 0 - 0
MediaBrowser.Server.Implementations/Localization/iso6392.txt → Emby.Server.Implementations/Localization/iso6392.txt


+ 1 - 0
MediaBrowser.Server.Implementations/HttpServer/HttpListenerHost.cs

@@ -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;

+ 1 - 0
MediaBrowser.Server.Implementations/HttpServer/SocketSharp/WebSocketSharpRequest.cs

@@ -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;

+ 0 - 209
MediaBrowser.Server.Implementations/MediaBrowser.Server.Implementations.csproj

@@ -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. 

+ 5 - 4
MediaBrowser.Server.Startup.Common/ApplicationHost.cs

@@ -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);

+ 1 - 0
MediaBrowser.Server.Startup.Common/MediaBrowser.Server.Startup.Common.csproj

@@ -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 - 0
MediaBrowser.Server.Startup.Common/TextLocalizer.cs

@@ -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);
+        }
+    }
+}