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));
        }
Exemple #2
0
        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));
        }
Exemple #3
0
        // 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));
        }
Exemple #4
0
 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));
        }
Exemple #6
0
        // 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));
 }
Exemple #9
0
        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);
        }
Exemple #10
0
 private string GetLocaleInfo(LocaleStringData type)
 {
     Contract.Assert(_sWindowsName != null, "[CultureData.GetLocaleInfo] Expected _sWindowsName to be populated already");
     return GetLocaleInfo(_sWindowsName, type);
 }
Exemple #11
0
 private string GetLocaleInfo(string localeName, LocaleStringData type)
 {
     return("");
 }
 private string GetLocaleInfo(string localeName, LocaleStringData type)
 {
     return "";
 }
Exemple #13
0
 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);
        }
Exemple #15
0
 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));
 }
Exemple #16
0
        // 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();
            }
        }
Exemple #17
0
 private string GetLocaleInfo(LocaleStringData type)
 {
     // TODO: Implement this fully.
     return(GetLocaleInfo("", type));
 }
Exemple #18
0
 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));
 }
Exemple #19
0
 // 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();
     }
 }
Exemple #20
0
 private string GetLocaleInfo(LocaleStringData type)
 {
     return("");
 }
Exemple #21
0
 private string GetLocaleInfo(LocaleStringData type)
 {
     // TODO: Implement this fully.
     return GetLocaleInfo("", type);
 }
 private string GetLocaleInfo(LocaleStringData type)
 {
     return "";
 }