Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ LangToLcidInternal()

static int System.Xml.Xsl.Runtime.XsltLibrary.LangToLcidInternal ( string lang,
bool forwardCompatibility,
IErrorHelper errorHelper )
inlinestaticpackage

Definition at line 160 of file XsltLibrary.cs.

161 {
162 int result = 127;
163 if (lang != null)
164 {
165 if (lang.Length == 0)
166 {
168 {
169 if (errorHelper == null)
170 {
171 throw new XslTransformException(System.SR.Xslt_InvalidAttrValue, "lang", lang);
172 }
173 errorHelper.ReportError(System.SR.Xslt_InvalidAttrValue, "lang", lang);
174 }
175 }
176 else
177 {
178 try
179 {
180 result = new CultureInfo(lang).LCID;
181 }
182 catch (ArgumentException)
183 {
185 {
186 if (errorHelper == null)
187 {
188 throw new XslTransformException(System.SR.Xslt_InvalidLanguage, lang);
189 }
190 errorHelper.ReportError(System.SR.Xslt_InvalidLanguage, lang);
191 }
192 }
193 }
194 }
195 return result;
196 }
static string Xslt_InvalidAttrValue
Definition SR.cs:1884
static string Xslt_InvalidLanguage
Definition SR.cs:1974
Definition SR.cs:7

References System.Globalization.CultureInfo.LCID, System.SR.Xslt_InvalidAttrValue, and System.SR.Xslt_InvalidLanguage.

Referenced by System.Xml.Xsl.Runtime.XsltLibrary.LangToLcid().