Neuron®
The Neuron® is the basis for the creation of open and secure federated networks for smart societies.
Loading...
Searching...
No Matches
LanguageString.cs
1using System;
3
5{
9 public enum TranslationLevel
10 {
14 Untranslated = 0,
15
19 MachineTranslated = 1,
20
24 HumanTranslated = 2
25 }
26
30 [CollectionName("LanguageStrings")]
31 [Index("NamespaceId", "Id")]
32 [TypeName(TypeNameSerialization.None)]
33 public class LanguageString
34 {
35 private Guid objectId = Guid.Empty;
36 private Guid namespaceId = Guid.Empty;
37 private string id = string.Empty;
38 private string value = string.Empty;
39 private TranslationLevel level = TranslationLevel.HumanTranslated;
40
45 {
46 }
47
51 [ObjectId]
52 public Guid ObjectId
53 {
54 get => this.objectId;
55 set => this.objectId = value;
56 }
57
61 public Guid NamespaceId
62 {
63 get => this.namespaceId;
64 set => this.namespaceId = value;
65 }
66
70 public string Id
71 {
72 get => this.id;
73 set => this.id = value;
74 }
75
79 [DefaultValueStringEmpty]
80 public string Value
81 {
82 get => this.value;
83 set => this.value = value;
84 }
85
89 [DefaultValue(TranslationLevel.HumanTranslated)]
91 {
92 get => this.level;
93 set => this.level = value;
94 }
95
99 [Obsolete("Use Level instead.")]
100 [IgnoreMember]
101 public bool Untranslated
102 {
103 get => this.level == TranslationLevel.Untranslated;
104 set => this.level = value ? TranslationLevel.Untranslated : TranslationLevel.HumanTranslated;
105 }
106
108 public override string ToString()
109 {
110 return this.value;
111 }
112
113 }
114}
Contains a localized string.
TranslationLevel Level
If the string is untranslated.
LanguageString()
Contains information about a namespace in a language.
TypeNameSerialization
How the type name should be serialized.
TranslationLevel
Translation level.