mirror of
https://github.com/Tichau/FileConverter.git
synced 2026-11-19 09:01:32 +01:00
26 lines
976 B
C#
26 lines
976 B
C#
// // <copyright file="Helpers.cs" company="AAllard">License: http://www.gnu.org/licenses/gpl.html GPL version 3.</copyright>
|
|
|
|
namespace FileConverter
|
|
{
|
|
using System;
|
|
using System.Collections.Generic;
|
|
using System.Globalization;
|
|
using System.IO;
|
|
using System.Linq;
|
|
using System.Reflection;
|
|
|
|
public static class Helpers
|
|
{
|
|
public static IEnumerable<CultureInfo> GetSupportedCultures()
|
|
{
|
|
//Get all culture
|
|
CultureInfo[] cultures = CultureInfo.GetCultures(CultureTypes.AllCultures);
|
|
|
|
//Find the location where application installed.
|
|
string exeLocation = Path.GetDirectoryName(Uri.UnescapeDataString(new UriBuilder(Assembly.GetExecutingAssembly().CodeBase).Path));
|
|
|
|
//Return all culture for which satellite folder found with culture code.
|
|
return cultures.Where(cultureInfo => Directory.Exists(Path.Combine(exeLocation, cultureInfo.Name)));
|
|
}
|
|
}
|
|
} |