コード例 #1
0
ファイル: OutputDll.cs プロジェクト: bo3b/iZ3D
 public void UpdateLocalizedText()
 {
     localizedName = StringLocalization.Localize(this.name);
     foreach (var mode in modes)
     {
         mode.UpdateLocalizedText();
     }
 }
コード例 #2
0
ファイル: SqlStringLocalizer.cs プロジェクト: khoarin/TVADWEB
        private string GetString(string name)
        {
            var culture = this.Culture ?? CultureInfo.CurrentUICulture;

            StringLocalization value = null;

            try
            {
                do
                {
                    var query = DbContext.StringLocalizations
                                .Where(l => l.Culture == culture.Name)
                                .Where(l => BaseName.Contains(l.Location))
                                .OrderByDescending(l => l.Location.Length);

                    value = query.FirstOrDefault(l => l.Key == name);

                    culture = culture.Parent;
                } while (value == null && !string.IsNullOrEmpty(culture.Name));
            }
            catch { }

            if (this.Environment.IsDevelopment())
            {
                try
                {
                    if (!DbContext.StringLocalizables.Any(l => l.Key == name && l.Location == BaseName))
                    {
                        DbContext.StringLocalizables.Add(new StringLocalizable
                        {
                            Location    = BaseName,
                            Key         = name,
                            Description = name
                        });
                        DbContext.SaveChanges();
                    }
                }
                catch (Exception ex)
                {
                    Logger.LogWarning(ex.ToString());
                }
            }

            if (value == null)
            {
                return(null);
            }
            else if (this.Environment.IsDevelopment())
            {
                return("[" + value.Value + "]");
            }
            else
            {
                return(value.Value);
            }
        }
コード例 #3
0
ファイル: OutputDll.cs プロジェクト: bo3b/iZ3D
 public OutputDll(string name,
                  string outputDllName,
                  Mode[]         modes,
                  OutputParams parameters)
 {
     this.name          = name;
     this.localizedName = StringLocalization.Localize(this.name);
     this.dllName       = outputDllName;
     this.modes         = modes;
     this.parameters    = parameters;
 }
コード例 #4
0
ファイル: OutputDll.cs プロジェクト: bo3b/iZ3D
 public OutputDll(string name,
                  string outputDllName,
                  string[]       modes,
                  OutputParams parameters)
 {
     this.name          = name;
     this.localizedName = StringLocalization.Localize(this.name);
     this.dllName       = outputDllName;
     this.modes         = new Mode[modes.Length];
     for (int i = 0; i < modes.Length; ++i)
     {
         this.modes[i] = new Mode(modes[i], i);
     }
     this.parameters = parameters;
 }
コード例 #5
0
ファイル: OutputDll.cs プロジェクト: bo3b/iZ3D
 public void UpdateLocalizedText()
 {
     this.localizedName = StringLocalization.Localize(this.name);
 }
コード例 #6
0
ファイル: OutputDll.cs プロジェクト: bo3b/iZ3D
 public Mode(String name, int id)
 {
     this.name          = name;
     this.id            = id;
     this.localizedName = StringLocalization.Localize(this.name);
 }