-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathLocalization.cs
More file actions
52 lines (48 loc) · 1.43 KB
/
Localization.cs
File metadata and controls
52 lines (48 loc) · 1.43 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
using System.Globalization;
namespace Petr.Notify
{
internal enum Strings
{
BadArgumentsTitle,
BadArgumentsText,
ClickedNotificationTitle,
ArgumentOutOfRangeExceptionText,
Win32ExceptionText
}
internal static class Localization
{
private static readonly string[] Default =
{
"Bad arguments",
"Expected {0} to {1} but got {2}.",
"Clicked notification",
"An error occurred while splitting the last argument into filename and argument. Check your quotes.",
"An error occurred while trying to start the last argument. Error message: {0}"
};
private static readonly string[] Swedish =
{
"Felaktiga argument",
"Förväntade {0} till {1} men fick {2}.",
"Klickad notifiering",
"Ett fel inträffade när sista argumentet skulle delas upp i filnamn och argument. Verifiera dina citationstecken.",
"Ett fel inträffade när sista argumentet skulle startas. Felmeddelande: {0}"
};
/// <summary>
/// Returns a localized string if a translation exists for the current UI culture. Otherwise, an English string is retuned.
/// </summary>
internal static string GetString(Strings @string)
{
// Quick and dirty multi language support. No resx files and satellite assemblies required.
switch (CultureInfo.CurrentUICulture.Name)
{
case "sv":
case "sv-AX":
case "sv-FI":
case "sv-SE":
return Swedish[(int)@string];
default:
return Default[(int)@string];
}
}
}
}