diff options
author | sr55 <[email protected]> | 2017-01-24 19:12:46 +0000 |
---|---|---|
committer | sr55 <[email protected]> | 2017-01-24 19:12:46 +0000 |
commit | c32a823816c58ffc8ea72394f40629f769830c09 (patch) | |
tree | 684f60806781ad718c4f98b40357d73d7d9d39e3 /win/CS/HandBrake.ApplicationServices/Utilities | |
parent | ca1dcccd09b5dfac93829d46fd6c7c9711898b77 (diff) |
WinGui: Always use iso639 for srt language code rather than name. #541
Diffstat (limited to 'win/CS/HandBrake.ApplicationServices/Utilities')
-rw-r--r-- | win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs b/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs index 49c1c488d..d8d16b87a 100644 --- a/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs +++ b/win/CS/HandBrake.ApplicationServices/Utilities/LanguageUtilities.cs @@ -284,5 +284,30 @@ namespace HandBrake.ApplicationServices.Utilities {
return MapLanguages().Values.ToList();
}
+
+ /// <summary>
+ /// The get language code.
+ /// </summary>
+ /// <param name="language">
+ /// The language.
+ /// </param>
+ /// <returns>
+ /// The <see cref="string"/>.
+ /// </returns>
+ public static string GetLanguageCode(string language)
+ {
+ if (string.IsNullOrEmpty(language))
+ {
+ return null;
+ }
+
+ string isoCode;
+ if (MapLanguages().TryGetValue(language, out isoCode))
+ {
+ return isoCode;
+ }
+
+ return null;
+ }
}
}
|