public HTMLBrowserForm(TranslationsDictionary title, string filePathTemplate = null, string locationPropertyName = null, string clientSizePropertyName = null, bool menuEnabled = true) : this() { Title = title; ToolStrip.Visible = menuEnabled; FilePathTemplate = filePathTemplate; LocationPropertyName = locationPropertyName; ClientSizePropertyName = clientSizePropertyName; }
public ShowTextForm(TranslationsDictionary title, TranslationsDictionary text, bool hideOnClose = false, bool sizeable = true, int width = 400, int height = 300, bool wrap = true, bool justify = true) : this(title.GetLang(), text.GetLang(), hideOnClose, sizeable, width, height, wrap, justify) { LocalizedTitle = title; LocalizedText = text; }
public ShowTextForm(TranslationsDictionary title, TranslationsDictionary text, bool hideOnClose = false, bool sizeable = true, int width = MessageBoxEx.DefaultWidthSmall, int height = MessageBoxEx.DefaultHeightSmall, bool wrap = true, bool justify = true) : this(title.GetLang(), text.GetLang(), hideOnClose, sizeable, width, height, wrap, justify) { LocalizedTitle = title; LocalizedText = text; }
public HTMLBrowserForm(TranslationsDictionary title, string filePathTemplate = null, string locationPropertyName = null, string clientSizePropertyName = null, bool menuEnabled = true) : this() { Title = title; ToolStrip.Visible = menuEnabled; FilePathTemplate = filePathTemplate; LocationPropertyName = locationPropertyName; ClientSizePropertyName = clientSizePropertyName; if (!LocationPropertyName.IsNullOrEmpty() && !ClientSizePropertyName.IsNullOrEmpty()) { Location = (Point)Globals.Settings[locationPropertyName]; ClientSize = (Size)Globals.Settings[clientSizePropertyName]; } }
private void LogMissingTranslation(string textId, string defaultText) { if (LogOutMissingTranslations) { AvailableLanguages.ToList().ForEach(delegate(string languageId) { if (!TranslationsDictionary.ContainsKey(textId) || !TranslationsDictionary[textId].ContainsKey(languageId)) { if (!MissingTranslations.ContainsKey(textId)) { MissingTranslations.Add(textId, new SortedDictionary <string, string>()); } MissingTranslations[textId][languageId] = $"default text : {defaultText}"; } }); File.WriteAllText(missingTranslationsFileName, JsonConvert.SerializeObject(MissingTranslations, Formatting.Indented)); } }
/// <summary> /// Default implementation of <see cref="TranslationProviderBase"/> /// allowing the addition of translations for route components in a fluent style. /// </summary> public FluentTranslationProvider() { Translations = new TranslationsDictionary(); }
/// <summary> /// Fluent helper for adding translations for route components. /// </summary> public TranslationBuilder(TranslationsDictionary translations) { _translations = translations; }
/// <summary> /// Gets the string translation. /// </summary> /// <param name="values">The dictionary containing lang>translation.</param> /// <param name="parameters">Parameters for the translated string.</param> static public string GetLang(this TranslationsDictionary values, params object[] parameters) { return(string.Format(values?.GetLang(), parameters) ?? ERR + " " + string.Join(",", parameters)); }
/// <summary> /// Gets the string translation. /// </summary> /// <param name="values">The dictionary containing lang>translation.</param> static public string GetLang(this TranslationsDictionary values) { return(values?[Languages.Current] ?? values?[Languages.Default] ?? ERR); }
/// <summary> /// Gets the string translation. /// </summary> /// <param name="values">The dictionary containing lang>translation.</param> /// <param name="parameters">Parameters for the translated string.</param> static public string GetLang(this TranslationsDictionary values, params object[] parameters) { return(string.Format(values?.GetLang(), parameters) ?? $"{ERR} {parameters.AsMultiComma()}"); }