internal LanguageInfo GetLanguage(string fileContent) { string langName = defaultLanguage.Name; var langMatch = languageRe.Match(fileContent); if (langMatch.Success) { langName = langMatch.Groups["lang"].Value; } LanguageInfo languageInfo = SupportedLanguageHelper.GetSupportedLanguage(langName); return(languageInfo); }
private static LanguageInfo LoadLangInfo(XElement langElm, string requestedLanguageName) { var langInfo = new LanguageInfo(); langInfo.Language = langElm.Attribute(XName.Get("code", "")).Value; langInfo.CultureInfo = CultureInfo.GetCultureInfo(langElm.Attribute(XName.Get("cultureInfo", "")).Value); var gherkinCodeAttr = langElm.Attribute(XName.Get("compatibleGherkinCode", "")); if (gherkinCodeAttr != null) langInfo.CompatibleGherkinLanguage = gherkinCodeAttr.Value; if (langInfo.CultureInfo.IsNeutralCulture) { langInfo.LanguageForConversions = GetLanguageForConversions(langElm, requestedLanguageName); } else { langInfo.LanguageForConversions = langInfo.CultureInfo; } return langInfo; }
private static LanguageInfo LoadLangInfo(XElement langElm, string requestedLanguageName) { var langInfo = new LanguageInfo(); langInfo.Language = langElm.Attribute(XName.Get("code", "")).Value; langInfo.CultureInfo = CultureInfo.GetCultureInfo(langElm.Attribute(XName.Get("cultureInfo", "")).Value); var gherkinCodeAttr = langElm.Attribute(XName.Get("compatibleGherkinCode", "")); if (gherkinCodeAttr != null) { langInfo.CompatibleGherkinLanguage = gherkinCodeAttr.Value; } if (langInfo.CultureInfo.IsNeutralCulture) { langInfo.LanguageForConversions = GetLanguageForConversions(langElm, requestedLanguageName); } else { langInfo.LanguageForConversions = langInfo.CultureInfo; } return(langInfo); }
internal I18n GetLanguageService(LanguageInfo language) { return new I18n(language.CompatibleGherkinLanguage ?? language.Language); }
internal GherkinDialect(LanguageInfo languageInfo, I18n nativeLanguageService) { NativeLanguageService = nativeLanguageService; LanguageInfo = languageInfo; }
internal GherkinDialect GetGherkinDialect(LanguageInfo language) { return new GherkinDialect(language, new I18n(language.CompatibleGherkinLanguage ?? language.Language)); }
internal GherkinDialect GetGherkinDialect(LanguageInfo language) { return(new GherkinDialect(language, new I18n(language.CompatibleGherkinLanguage ?? language.Language))); }
public override int GetHashCode() { return LanguageInfo.GetHashCode(); }
public override bool Equals(object obj) { LanguageInfo other = obj as LanguageInfo; return(other != null && other.Language.Equals(Language)); }