-
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathLocalizationInfo.cs
More file actions
56 lines (43 loc) · 1.62 KB
/
LocalizationInfo.cs
File metadata and controls
56 lines (43 loc) · 1.62 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
using CommunityToolkit.Mvvm.ComponentModel;
namespace AndreasReitberger.Shared.Core.Localization
{
public partial class LocalizationInfo : ObservableObject
{
#region Properties
[ObservableProperty]
public partial string Name { get; set; } = string.Empty;
[ObservableProperty]
public partial string NativeName { get; set; } = string.Empty;
[ObservableProperty]
public partial Uri? FlagUri { get; set; }
[ObservableProperty]
public partial string Translator { get; set; } = string.Empty;
[ObservableProperty]
public partial string Code { get; set; } = string.Empty;
[ObservableProperty]
public partial double PercentTranslated { get; set; } = 0;
[ObservableProperty]
public partial bool IsOfficial { get; set; } = false;
#endregion
#region Constructors
public LocalizationInfo() { }
public LocalizationInfo(string code)
{
Code = code;
}
public LocalizationInfo(string name, string nativeName, Uri flagUri, string translator, string code, double percentTranslated, bool isOfficial)
{
Name = name;
NativeName = nativeName;
FlagUri = flagUri;
Translator = translator;
Code = code;
PercentTranslated = percentTranslated;
IsOfficial = isOfficial;
}
#endregion
#region Overrides
public override string ToString() => JsonSerializer.Serialize(this!, CoreSourceGenerationContext.Default.LocalizationInfo);
#endregion
}
}