public void UpdateLocalizedText() { localizedName = StringLocalization.Localize(this.name); foreach (var mode in modes) { mode.UpdateLocalizedText(); } }
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); } }
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; }
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; }
public void UpdateLocalizedText() { this.localizedName = StringLocalization.Localize(this.name); }
public Mode(String name, int id) { this.name = name; this.id = id; this.localizedName = StringLocalization.Localize(this.name); }