-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathLanguageHandler.cs
46 lines (44 loc) · 975 Bytes
/
LanguageHandler.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
using System;
using System.Collections.Generic;
using System.Globalization;
namespace BatteryDischarger
{
public static class LanguageHandler
{
public enum Languages
{
bg,
cs,
da,
de,
el,
en,
es,
et,
fi,
fr,
hu,
it,
ja,
lt,
lv,
nl,
pl,
pt,
ro,
ru,
sk,
sl,
sv,
zh
}
public static IEnumerable<string> GetLanguages()
{
foreach (Languages entry in Enum.GetValues(typeof(Languages)))
{
var twoLetterLanguageCode = Enum.GetName(typeof(Languages), entry);
yield return twoLetterLanguageCode + ": " + (new CultureInfo(twoLetterLanguageCode).DisplayName);
}
}
}
}