/// <summary> /// Tries parsing the string representation of a locale identifier. /// </summary> /// <param name="s"> /// A case insensitive string containing a locale identifier, based on BCP47. /// </param> /// <param name="result"> /// A local identifier that refers to <paramref name="s"/> or <b>null</b> if the parsing /// failed. /// </param> /// <param name="message"> /// The reason why the parsing failed. /// </param> /// <returns> /// <b>true</b> if <paramref name="s"/> was parsed successfully; otherwise, <b>false</b>. /// </returns> /// <remarks> /// A locale identifier that refers to <paramref name="s"/>. /// </remarks> public static bool TryParse(string s, out LocaleIdentifier result, out string message) { if (TryParseBcp47(s, out result, out message)) { message = result.TransformFromBcp47(); } return(message == null); }