public void PreCondition() { t = TranslationProvider.GetTranslation("ua"); driver = new DriverFactory().GetDriver(); driver.Maximaze(); driver.GoToURL(); }
private string TranslateText(string text) { if (string.IsNullOrEmpty(text)) { return(string.Empty); } var matches = Regex.Matches(text, @"{i18n:\w+:\w+}"); for (var i = matches.Count - 1; i >= 0; i--) { var match = matches[i]; var parts = match.Value.Trim('{', '}').Split(':'); var result = _translationProvider.GetTranslation(parts[1], parts[2]); text = text.Remove(match.Index, match.Length); if (result != null) { text = text.Insert(match.Index, result); } else { text = text.Insert(match.Index, match.Value); } } return(text); }
public LocalizedValue(TranslationProvider translationProvider, string section, string key) { _translationprovider = translationProvider; _section = section; _key = key; _translationprovider.LanguageChanged += OnLanguageChanged; Value = _translationprovider.GetTranslation(_section, _key); }
public virtual void PreCondition() { report.BeforeTest(); t = TranslationProvider.GetTranslation("ua"); browser = TestContext.Parameters.Get("browser"); driver = new DriverFactory().GetDriver(browser); driver.Maximaze(); driver.GoToURL(); welcomePage = new WelcomePage(); welcomePage.Init(driver); }
private void OnLanguageChanged(object sender, EventArgs e) { Value = _translationprovider.GetTranslation(_section, _key); ValueChanged?.Invoke(); }