summaryrefslogtreecommitdiffstats
path: root/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs
diff options
context:
space:
mode:
authorsr55 <[email protected]>2014-02-16 18:39:29 +0000
committersr55 <[email protected]>2014-02-16 18:39:29 +0000
commitd4327b0f304b99a7650b12622b48e6145794ab65 (patch)
treef0c0912f10a487d077ad36277f67f84889f176e2 /win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs
parent4c18d60bcd318aae2c39b3d898e96ce0470c7277 (diff)
WinGui: Initial work to refactor the Audio and Subtitle behavioural based automatic track selections. This is not quite complete yet but close enough for gathering feedback.
- Simplified UI design that's now available on the "Subtitle" and "Audio" tabs rather than the Options screen. The settings are no longer part of the app preferences. They are now per-preset. Build in presets default to None. - Selected Languages can now be set independently for Audio and Video. - Preferred Language is now part of the Selected Languages list. - Warning: Import/Export of presets still to be implemented. Design may yet change. git-svn-id: svn://svn.handbrake.fr/HandBrake/trunk@6036 b64f7644-9d1e-0410-96f1-a4d463321fa5
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs')
-rw-r--r--win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs39
1 files changed, 38 insertions, 1 deletions
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();
+ }
}
}