summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Utilities
diff options
context:
space:
mode:
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs2
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs39
2 files changed, 39 insertions, 2 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs
index 1c6b785bb..9651c6e71 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/Converters.cs
@@ -129,7 +129,7 @@ namespace HandBrake.ApplicationServices.Utilities
{
case Mixdown.Auto:
case Mixdown.None:
- return "auto";
+ return "none";
case Mixdown.Mono:
return "mono";
case Mixdown.LeftOnly:
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs
index bbfe8f62c..94a1fb201 100644
--- a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs
+++ b/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs
@@ -11,6 +11,7 @@ namespace HandBrake.ApplicationServices.Utilities
{
using System.Collections.Generic;
using System.Collections.Specialized;
+ using System.Linq;
/// <summary>
/// Language Utilities
@@ -248,6 +249,42 @@ namespace HandBrake.ApplicationServices.Utilities
}
return iso6392Codes;
- }
+ }
+
+ /// <summary>
+ /// The get language codes.
+ /// </summary>
+ /// <param name="userLanguages">
+ /// The user languages.
+ /// </param>
+ /// <returns>
+ /// The <see cref="List"/>.
+ /// </returns>
+ public static List<string> GetLanguageCodes(IList<string> userLanguages)
+ {
+ // Translate to Iso Codes
+ List<string> iso6392Codes = new List<string>();
+ foreach (var item in userLanguages)
+ {
+ string isoCode;
+ if (LanguageUtilities.MapLanguages().TryGetValue(item, out isoCode))
+ {
+ iso6392Codes.Add(isoCode);
+ }
+ }
+
+ return iso6392Codes;
+ }
+
+ /// <summary>
+ /// The get iso codes.
+ /// </summary>
+ /// <returns>
+ /// The <see cref="List"/>.
+ /// </returns>
+ public static List<string> GetIsoCodes()
+ {
+ return MapLanguages().Values.ToList();
+ }
}
}