private string GetLocaleInfo(LocaleStringData type) { Debug.Assert(!GlobalizationMode.Invariant); Debug.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo] Expected _sWindowsName to be populated already"); return(GetLocaleInfo(_sWindowsName, type)); }
private string GetLocaleInfo(string localeName, LocaleStringData type) { Contract.Assert(localeName != null, "[CultureData.GetLocaleInfo] Expected localeName to be not be null"); switch (type) { case LocaleStringData.NegativeInfinitySymbol: // not an equivalent in ICU; prefix the PositiveInfinitySymbol with NegativeSign return(GetLocaleInfo(localeName, LocaleStringData.NegativeSign) + GetLocaleInfo(localeName, LocaleStringData.PositiveInfinitySymbol)); } StringBuilder sb = StringBuilderCache.Acquire(ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY); bool result = Interop.GlobalizationInterop.GetLocaleInfoString(localeName, (uint)type, sb, sb.Capacity); if (!result) { // Failed, just use empty string StringBuilderCache.Release(sb); Contract.Assert(false, "[CultureData.GetLocaleInfo(LocaleStringData)] Failed"); return(String.Empty); } return(StringBuilderCache.GetStringAndRelease(sb)); }
// For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the // "windows" name, which can be specific for downlevel (< windows 7) os's. private unsafe string IcuGetLocaleInfo(string localeName, LocaleStringData type) { Debug.Assert(!GlobalizationMode.UseNls); Debug.Assert(localeName != null, "[CultureData.IcuGetLocaleInfo] Expected localeName to be not be null"); switch (type) { case LocaleStringData.NegativeInfinitySymbol: // not an equivalent in ICU; prefix the PositiveInfinitySymbol with NegativeSign return(IcuGetLocaleInfo(localeName, LocaleStringData.NegativeSign) + IcuGetLocaleInfo(localeName, LocaleStringData.PositiveInfinitySymbol)); } char *buffer = stackalloc char[ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY]; bool result = Interop.Globalization.GetLocaleInfoString(localeName, (uint)type, buffer, ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY); if (!result) { // Failed, just use empty string Debug.Fail("[CultureData.IcuGetLocaleInfo(LocaleStringData)] Failed"); return(string.Empty); } return(new string(buffer)); }
private string IcuGetLocaleInfo(LocaleStringData type, string?uiCultureName = null) { Debug.Assert(!GlobalizationMode.Invariant); Debug.Assert(!GlobalizationMode.UseNls); Debug.Assert(_sWindowsName != null, "[CultureData.IcuGetLocaleInfo] Expected _sWindowsName to be populated already"); return(IcuGetLocaleInfo(_sWindowsName, type, uiCultureName)); }
// For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the // "windows" name, which can be specific for downlevel (< windows 7) os's. private string NlsGetLocaleInfo(string localeName, LocaleStringData type) { Debug.Assert(GlobalizationMode.UseNls); uint lctype = (uint)type; return(GetLocaleInfoFromLCType(localeName, lctype, UseUserOverride)); }
// For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the // "windows" name, which can be specific for downlevel (< windows 7) os's. private string NlsGetLocaleInfo(string localeName, LocaleStringData type) { Debug.Assert(ShouldUseUserOverrideNlsData); uint lctype = (uint)type; return(GetLocaleInfoFromLCType(localeName, lctype, _bUseOverrides)); }
// For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the // "windows" name, which can be specific for downlevel (< windows 7) os's. private string GetLocaleInfo(string localeName, LocaleStringData type) { uint lctype = (uint)type; return(GetLocaleInfoFromLCType(localeName, lctype, UseUserOverride)); }
private string GetLocaleInfo(LocaleStringData type) { Debug.Assert(_sWindowsName != null, "[CultureData.DoGetLocaleInfo] Expected _sWindowsName to be populated by already"); return(GetLocaleInfo(_sWindowsName, type)); }
private string GetLocaleInfo(string localeName, LocaleStringData type) { Contract.Assert(localeName != null, "[CultureData.GetLocaleInfo] Expected localeName to be not be null"); switch (type) { case LocaleStringData.NegativeInfinitySymbol: // not an equivalent in ICU; prefix the PositiveInfinitySymbol with NegativeSign return GetLocaleInfo(localeName, LocaleStringData.NegativeSign) + GetLocaleInfo(localeName, LocaleStringData.PositiveInfinitySymbol); } StringBuilder sb = StringBuilderCache.Acquire(ICU_ULOC_KEYWORD_AND_VALUES_CAPACITY); bool result = Interop.GlobalizationInterop.GetLocaleInfoString(localeName, (uint)type, sb, sb.Capacity); if (!result) { // Failed, just use empty string StringBuilderCache.Release(sb); Contract.Assert(false, "[CultureData.GetLocaleInfo(LocaleStringData)] Failed"); return String.Empty; } return StringBuilderCache.GetStringAndRelease(sb); }
private string GetLocaleInfo(LocaleStringData type) { Contract.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo] Expected _sWindowsName to be populated already"); return GetLocaleInfo(_sWindowsName, type); }
private string GetLocaleInfo(string localeName, LocaleStringData type) { return(""); }
private string GetLocaleInfo(string localeName, LocaleStringData type) { return ""; }
private string GetLocaleInfo(LocaleStringData type) { Contract.Assert(this.sWindowsName != null, "[CultureData.GetLocaleInfo] Expected this.sWindowsName to be populated already"); return(GetLocaleInfo(this.sWindowsName, type)); }
// For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the // "windows" name, which can be specific for downlevel (< windows 7) os's. private string GetLocaleInfo(string localeName, LocaleStringData type) { uint lctype = (uint)type; return GetLocaleInfoFromLCType(localeName, lctype, UseUserOverride); }
private string NlsGetLocaleInfo(LocaleStringData type) { Debug.Assert(GlobalizationMode.UseNls); Debug.Assert(_sWindowsName != null, "[CultureData.DoGetLocaleInfo] Expected _sWindowsName to be populated by already"); return(NlsGetLocaleInfo(_sWindowsName, type)); }
// For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the // "windows" name, which can be specific for downlevel (< windows 7) os's. private string GetLocaleInfo(string localeName, LocaleStringData type) { // TODO: Implement this fully. switch (type) { case LocaleStringData.LocalizedDisplayName: return("Invariant Language (Invariant Country)"); case LocaleStringData.EnglishDisplayName: return("Invariant Language (Invariant Country)"); case LocaleStringData.NativeDisplayName: return("Invariant Language (Invariant Country)"); case LocaleStringData.LocalizedLanguageName: return("Invariant Language"); case LocaleStringData.EnglishLanguageName: return("Invariant Language"); case LocaleStringData.NativeLanguageName: return("Invariant Language"); case LocaleStringData.EnglishCountryName: return("Invariant Country"); case LocaleStringData.NativeCountryName: return("Invariant Country"); case LocaleStringData.ListSeparator: return(","); case LocaleStringData.DecimalSeparator: return("."); case LocaleStringData.ThousandSeparator: return(","); case LocaleStringData.Digits: return("3;0"); case LocaleStringData.MonetarySymbol: return("\u00A4"); case LocaleStringData.Iso4217MonetarySymbol: return("XDR"); case LocaleStringData.MonetaryDecimalSeparator: return("."); case LocaleStringData.MonetaryThousandSeparator: return(","); case LocaleStringData.AMDesignator: return("AM"); case LocaleStringData.PMDesignator: return("PM"); case LocaleStringData.PositiveSign: return("+"); case LocaleStringData.NegativeSign: return("-"); case LocaleStringData.Iso639LanguageName: return("iv"); case LocaleStringData.Iso3166CountryName: return("IV"); case LocaleStringData.NaNSymbol: return("NaN"); case LocaleStringData.PositiveInfinitySymbol: return("Infinity"); case LocaleStringData.NegativeInfinitySymbol: return("-Infinity"); case LocaleStringData.ParentName: return(""); case LocaleStringData.PercentSymbol: return("%"); case LocaleStringData.PerMilleSymbol: return("\u2030"); default: Contract.Assert(false, "Unmatched case in GetLocaleInfo(LocaleStringData)"); throw new NotImplementedException(); } }
private string GetLocaleInfo(LocaleStringData type) { // TODO: Implement this fully. return(GetLocaleInfo("", type)); }
private string NlsGetLocaleInfo(LocaleStringData type) { Debug.Assert(ShouldUseUserOverrideNlsData); Debug.Assert(_sWindowsName != null, "[CultureData.DoGetLocaleInfo] Expected _sWindowsName to be populated by already"); return(NlsGetLocaleInfo(_sWindowsName, type)); }
// For LOCALE_SPARENT we need the option of using the "real" name (forcing neutral names) instead of the // "windows" name, which can be specific for downlevel (< windows 7) os's. private string GetLocaleInfo(string localeName, LocaleStringData type) { // TODO: Implement this fully. switch(type) { case LocaleStringData.LocalizedDisplayName: return "Invariant Language (Invariant Country)"; case LocaleStringData.EnglishDisplayName: return "Invariant Language (Invariant Country)"; case LocaleStringData.NativeDisplayName: return "Invariant Language (Invariant Country)"; case LocaleStringData.LocalizedLanguageName: return "Invariant Language"; case LocaleStringData.EnglishLanguageName: return "Invariant Language"; case LocaleStringData.NativeLanguageName: return "Invariant Language"; case LocaleStringData.EnglishCountryName: return "Invariant Country"; case LocaleStringData.NativeCountryName: return "Invariant Country"; case LocaleStringData.ListSeparator: return ","; case LocaleStringData.DecimalSeparator: return "."; case LocaleStringData.ThousandSeparator: return ","; case LocaleStringData.Digits: return "3;0"; case LocaleStringData.MonetarySymbol: return "$"; // TODO: CoreFX #846 Restore to the original value "\x00a4" case LocaleStringData.Iso4217MonetarySymbol: return "XDR"; case LocaleStringData.MonetaryDecimalSeparator: return "."; case LocaleStringData.MonetaryThousandSeparator: return ","; case LocaleStringData.AMDesignator: return "AM"; case LocaleStringData.PMDesignator: return "PM"; case LocaleStringData.PositiveSign: return "+"; case LocaleStringData.NegativeSign: return "-"; case LocaleStringData.Iso639LanguageName: return "iv"; case LocaleStringData.Iso3166CountryName: return "IV"; case LocaleStringData.NaNSymbol: return "NaN"; case LocaleStringData.PositiveInfinitySymbol: return "Infinity"; case LocaleStringData.NegativeInfinitySymbol: return "-Infinity"; case LocaleStringData.ParentName: return ""; case LocaleStringData.PercentSymbol: return "%"; case LocaleStringData.PerMilleSymbol: return "\u2030"; default: Contract.Assert(false, "Unmatched case in GetLocaleInfo(LocaleStringData)"); throw new NotImplementedException(); } }
private string GetLocaleInfo(LocaleStringData type) { return(""); }
private string GetLocaleInfo(LocaleStringData type) { // TODO: Implement this fully. return GetLocaleInfo("", type); }
private string GetLocaleInfo(LocaleStringData type) { return ""; }