Ejemplo n.º 1
0
        public static EcmaValue NumberingSystem([This] EcmaValue thisValue)
        {
            Locale         locale = thisValue.GetUnderlyingObject <Locale>();
            BcpLanguageTag tag    = BcpLanguageTag.Parse(locale.LocaleString);

            return(tag.UExtensions["nu"]);
        }
Ejemplo n.º 2
0
        public static EcmaValue Numeric([This] EcmaValue thisValue)
        {
            Locale         locale = thisValue.GetUnderlyingObject <Locale>();
            BcpLanguageTag tag    = BcpLanguageTag.Parse(locale.LocaleString);

            return(tag.UExtensions["kn"] == "" || tag.UExtensions["kn"] == "true");
        }
Ejemplo n.º 3
0
        public static EcmaValue Region([This] EcmaValue thisValue)
        {
            Locale         locale = thisValue.GetUnderlyingObject <Locale>();
            BcpLanguageTag tag    = BcpLanguageTag.Parse(locale.LocaleString);

            return(tag.Region == "" ? default : tag.Region);
        }
Ejemplo n.º 4
0
        public static EcmaValue Language([This] EcmaValue thisValue)
        {
            Locale         locale = thisValue.GetUnderlyingObject <Locale>();
            BcpLanguageTag tag    = BcpLanguageTag.Parse(locale.LocaleString);

            return(tag.Language);
        }
Ejemplo n.º 5
0
 public Locale(BcpLanguageTag tag)
     : base(IntlModule.LocalePrototype)
 {
     Guard.ArgumentNotNull(tag, "tag");
     Init(new[] { tag.Canonicalize().ToString() }, new LocaleOptions());
 }
Ejemplo n.º 6
0
 public Locale Maximize()
 {
     return(new Locale(BcpLanguageTag.Parse(this.LocaleString).Maximize()));
 }