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

◆ LangToNameInternal()

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

Definition at line 198 of file XsltLibrary.cs.

199 {
200 string result = "";
201 if (lang != null)
202 {
203 if (lang.Length == 0)
204 {
206 {
207 if (errorHelper == null)
208 {
209 throw new XslTransformException(System.SR.Xslt_InvalidAttrValue, "lang", lang);
210 }
211 errorHelper.ReportError(System.SR.Xslt_InvalidAttrValue, "lang", lang);
212 }
213 }
214 else
215 {
216 try
217 {
218 result = new CultureInfo(lang).Name;
219 }
220 catch (ArgumentException)
221 {
223 {
224 if (errorHelper == null)
225 {
226 throw new XslTransformException(System.SR.Xslt_InvalidLanguage, lang);
227 }
228 errorHelper.ReportError(System.SR.Xslt_InvalidLanguage, lang);
229 }
230 }
231 }
232 }
233 return result;
234 }
static string Xslt_InvalidAttrValue
Definition SR.cs:1884
static string Xslt_InvalidLanguage
Definition SR.cs:1974
Definition SR.cs:7

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

Referenced by System.Xml.Xsl.Xslt.QilGenerator.CompileLangAttribute(), and System.Xml.Xsl.Xslt.QilGenerator.CompileLangToLcid().