public EFStringLocalizerFactory()
 {
     _db = new LocalizationDBContext();
     _db.AddRange(
         new Culture
     {
         Name      = "en-US",
         Resources = new List <Resource>()
         {
             new Resource {
                 Key = "Hello", Value = "Hello"
             }
         }
     },
         new Culture
     {
         Name      = "fr-FR",
         Resources = new List <Resource>()
         {
             new Resource {
                 Key = "Hello", Value = "Bonjour"
             }
         }
     },
         new Culture
     {
         Name      = "es-ES",
         Resources = new List <Resource>()
         {
             new Resource {
                 Key = "Hello", Value = "Hola"
             }
         }
     },
         new Culture
     {
         Name      = "jp-JP",
         Resources = new List <Resource>()
         {
             new Resource {
                 Key = "Hello", Value = "こんにちは"
             }
         }
     },
         new Culture
     {
         Name      = "zh",
         Resources = new List <Resource>()
         {
             new Resource {
                 Key = "Hello", Value = "您好"
             }
         }
     },
         new Culture
     {
         Name      = "zh-CN",
         Resources = new List <Resource>()
         {
             new Resource {
                 Key = "Hello", Value = "您好"
             }
         }
     }
         );
     _db.SaveChanges();
 }
Exemple #2
0
 public EFStringLocalizer(LocalizationDBContext db)
 {
     _db = db;
 }
Exemple #3
0
        public EFStringLocalizerFactory(LocalizationDBContext db)
        {
            _db = db;

            LoadResources();
        }