-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalizationManager.cs
More file actions
63 lines (59 loc) · 2.21 KB
/
Copy pathLocalizationManager.cs
File metadata and controls
63 lines (59 loc) · 2.21 KB
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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
using System.Collections.Generic;
using System.Globalization;
using System.Threading;
namespace UnifiedExplorer
{
public static class LocalizationManager
{
private static bool IsGerman => CultureInfo.CurrentUICulture.TwoLetterISOLanguageName.ToLower() == "de";
private static readonly Dictionary<string, string> EnglishStrings = new Dictionary<string, string>
{
{"Name", "Name"},
{"DateModified", "Date Modified"},
{"Type", "Type"},
{"Size", "Size"},
{"CreationDate", "Creation Date"},
{"Dimensions", "Dimensions"},
{"SizeAllColumns", "Size all columns to fit"},
{"Search", "Search..."},
{"ThisPC", "This PC"},
{"QuickAccess", "Quick access"},
{"Desktop", "Desktop"},
{"Downloads", "Downloads"},
{"Documents", "Documents"},
{"Pictures", "Pictures"},
{"Music", "Music"},
{"Videos", "Videos"},
{"Loading", "Loading..."},
{"FileFolder", "File folder"}
};
private static readonly Dictionary<string, string> GermanStrings = new Dictionary<string, string>
{
{"Name", "Name"},
{"DateModified", "Änderungsdatum"},
{"Type", "Typ"},
{"Size", "Größe"},
{"CreationDate", "Erstelldatum"},
{"Dimensions", "Abmessungen"},
{"SizeAllColumns", "Größe aller Spalten anpassen"},
{"Search", "Suchen..."},
{"ThisPC", "Dieser PC"},
{"QuickAccess", "Schnellzugriff"},
{"Desktop", "Desktop"},
{"Downloads", "Downloads"},
{"Documents", "Dokumente"},
{"Pictures", "Bilder"},
{"Music", "Musik"},
{"Videos", "Videos"},
{"Loading", "Wird geladen..."},
{"FileFolder", "Dateiordner"}
};
public static string GetString(string key)
{
var dict = IsGerman ? GermanStrings : EnglishStrings;
if (dict.TryGetValue(key, out string? value) && value != null)
return value;
return key; // Fallback to key if not found
}
}
}