diff --git a/Models/Language.cs b/Models/Language.cs
index 7c2bef1..5aff58c 100644
--- a/Models/Language.cs
+++ b/Models/Language.cs
@@ -2,206 +2,263 @@
namespace NejCommon.Models
{
- ///
- /// Gets or Sets Language
- ///
+ ////
+ //// Gets or Sets Language
+ ////
public enum Langauge
{
- //
- // Summary:
- // Arabic
+ ///
+ ///
+ /// Arabic
+ ///
AR,
- //
- // Summary:
- // Bulgarian
+ ///
+ ///
+ /// Bulgarian
+ ///
BG,
- //
- // Summary:
- // Bosnian
+ ///
+ ///
+ /// Bosnian
+ ///
BS,
- //
- // Summary:
- // Czech
+ ///
+ ///
+ /// Czech
+ ///
CS,
- //
- // Summary:
- // Welsh
+ ///
+ ///
+ /// Welsh
+ ///
CY,
- //
- // Summary:
- // Danish
+ ///
+ ///
+ /// Danish
+ ///
DA,
- //
- // Summary:
- // German
+ ///
+ ///
+ /// German
+ ///
DE,
- //
- // Summary:
- // English
+ ///
+ ///
+ /// English
+ ///
EN,
- //
- // Summary:
- // Spanish; Castilian
+ ///
+ ///
+ /// Spanish; Castilian
+ ///
ES,
- //
- // Summary:
- // Estonian
+ ///
+ ///
+ /// Estonian
+ ///
ET,
- //
- // Summary:
- // Persian
+ ///
+ ///
+ /// Persian
+ ///
FA,
- //
- // Summary:
- // Finnish
+ ///
+ ///
+ /// Finnish
+ ///
FI,
- //
- // Summary:
- // French
+ ///
+ ///
+ /// French
+ ///
FR,
- // Summary:
- // Irish
+ ///
+ /// Irish
+ ///
GA,
- //
- // Summary:
- // Hebrew
+ ///
+ ///
+ /// Hebrew
+ ///
HE,
- //
- // Summary:
- // Hindi
+ ///
+ ///
+ /// Hindi
+ ///
HI,
- //
- // Summary:
- // Croatian
+ ///
+ ///
+ /// Croatian
+ ///
HR,
- //
- // Summary:
- // Haitian; Haitian Creole
+ ///
+ ///
+ /// Haitian; Haitian Creole
+ ///
HT,
- //
- // Summary:
- // Hungarian
+ ///
+ ///
+ /// Hungarian
+ ///
HU,
- //
- // Summary:
- // Armenian
+ ///
+ ///
+ /// Armenian
+ ///
HY,
- //
- // Summary:
- // Indonesian
+ ///
+ ///
+ /// Indonesian
+ ///
ID,
- //
- // Summary:
- // Icelandic
+ ///
+ ///
+ /// Icelandic
+ ///
IS,
- //
- // Summary:
- // Italian
+ ///
+ ///
+ /// Italian
+ ///
IT,
- //
- // Summary:
- // Japanese
+ ///
+ ///
+ /// Japanese
+ ///
JA,
- //
- // Summary:
- // Kazakh
+ ///
+ ///
+ /// Kazakh
+ ///
KK,
- //
- // Summary:
- // Korean
+ ///
+ ///
+ /// Korean
+ ///
KO,
- //
- // Summary:
- // Latin
+ ///
+ ///
+ /// Latin
+ ///
LA,
- //
- // Summary:
- // Luxembourgish; Letzeburgesch
+ ///
+ ///
+ /// Luxembourgish; Letzeburgesch
+ ///
LB,
- //
- // Summary:
- // Latvian
+ ///
+ ///
+ /// Latvian
+ ///
LV,
- //
- // Summary:
- // Mongolian
+ ///
+ ///
+ /// Mongolian
+ ///
MN,
- //
- // Summary:
- // Dutch; Flemish
+ ///
+ ///
+ /// Dutch; Flemish
+ ///
NL,
- //
- // Summary:
- // Norwegian
+ ///
+ ///
+ /// Norwegian
+ ///
NO,
- //
- // Summary:
- // Polish
+ ///
+ ///
+ /// Polish
+ ///
PL,
- //
- // Summary:
- // Portuguese
+ ///
+ ///
+ /// Portuguese
+ ///
PT,
- //
- // Summary:
- // Romanian; Moldavian; Moldovan
+ ///
+ ///
+ /// Romanian; Moldavian; Moldovan
+ ///
RO,
- //
- // Summary:
- // Russian
+ ///
+ ///
+ /// Russian
+ ///
RU,
- //
- // Summary:
- // Sardinian
+ ///
+ ///
+ /// Sardinian
+ ///
SC,
- //
- // Summary:
- // Slovak
+ ///
+ ///
+ /// Slovak
+ ///
SK,
- //
- // Summary:
- // Slovenian
+ ///
+ ///
+ /// Slovenian
+ ///
SL,
- //
- // Summary:
- // Serbian
+ ///
+ ///
+ /// Serbian
+ ///
SR,
- //
- // Summary:
- // Swedish
+ ///
+ ///
+ /// Swedish
+ ///
SV,
- //
- // Summary:
- // Thai
+ ///
+ ///
+ /// Thai
+ ///
TH,
- //
- // Summary:
- // Turkish
+ ///
+ ///
+ /// Turkish
+ ///
TR,
- //
- // Summary:
- // Ukrainian
+ ///
+ ///
+ /// Ukrainian
+ ///
UK,
- //
- // Summary:
- // Urdu
+ ///
+ ///
+ /// Urdu
+ ///
UR,
- //
- // Summary:
- // Uzbek
+ ///
+ ///
+ /// Uzbek
+ ///
UZ,
- //
- // Summary:
- // Vietnamese
+ ///
+ ///
+ /// Vietnamese
+ ///
VI,
-
- //
- // Summary:
- // Simplified Chinese
+ ///
+ ///
+ /// Simplified Chinese
+ ///
ZH_CN,
- //
- // Summary:
- // Traditional Chinese
+ ///
+ ///
+ /// Traditional Chinese
+ ///
ZH_TW,
+ ///
+ ///
+ /// Greek
+ ///
+ EL,
+ ///
+ /// Portuguese (Brazil)
+ ///
+ PT_BR
}
}
diff --git a/Models/LocalizedString.cs b/Models/LocalizedString.cs
new file mode 100644
index 0000000..75ecec4
--- /dev/null
+++ b/Models/LocalizedString.cs
@@ -0,0 +1,28 @@
+
+using System.ComponentModel.DataAnnotations.Schema;
+using Microsoft.EntityFrameworkCore;
+using Microsoft.EntityFrameworkCore.Metadata.Builders;
+
+namespace NejCommon.Models;
+
+[Owned]
+public class LocalizedString
+{
+ [Column(TypeName = "jsonb")]
+ public Dictionary Values { get; set; } = new();
+
+ public string this[Langauge locale]
+ {
+ get => Values.TryGetValue(locale, out var v) ? v : "";
+ set => Values[locale] = value;
+ }
+
+ public static implicit operator LocalizedString(string value)
+ => new() { Values = new() { [Langauge.EN] = value } };
+
+ public static implicit operator LocalizedString(Dictionary value)
+ => new() { Values = value };
+
+ public static implicit operator Dictionary(LocalizedString value)
+ => value.Values;
+}
\ No newline at end of file