Represents a single CLDR JSON file.
Esempio n. 1
0
        public void Add(CldrJson cldrJson)
        {
            if (cldrJson == null)
            {
                return;
            }

            foreach (var leaf in cldrJson.Data.Leaves())
            {
                var value = (string)leaf;
                int valueId;

                // TODO refactor this
                if (this.values.HasId(value))
                {
                    valueId = this.values.GetId(value);
                }
                else
                {
                    valueId = this.values.GetId(value);
                    this.Tree.Values.Add(value);
                }

                this.Tree.Add(cldrJson.Locale, leaf.Path, valueId);
            }
        }
Esempio n. 2
0
        public void Add(CldrJson cldrJson)
        {
            if (cldrJson == null)
                return;

            foreach (var leaf in cldrJson.Data.Leaves())
            {
                var value = (string) leaf;
                int valueId;

                // TODO refactor this
                if (this.values.HasId(value))
                {
                    valueId = this.values.GetId(value);
                }
                else
                {
                    valueId = this.values.GetId(value);
                    this.Tree.Values.Add(value);
                }

                this.Tree.Add(cldrJson.Locale, leaf.Path, valueId);
            }
        }