コード例 #1
0
        void Refresh()
        {
            label.text = Localization.Get(TableKey.Fuga);

            var now = System.DateTime.Now;
            var key = new LocalizationKey("Piyo",
                                          ("{hour}", LocalizationKey.CreateRaw(now.Hour.ToString())),
                                          ("{minute}", LocalizationKey.CreateRaw(now.Minute.ToString())));

            timeLabel.text = key.Localize();
        }
コード例 #2
0
        public LocalizationKeyBuilder Append(LocalizationKey key)
        {
            if (key.Empty)
            {
                return(this);
            }

            if (items.Count == 0)
            {
                items.Add(key);
            }
            else if (key.Fixed)
            {
                var last = items[items.Count - 1];
                if (last.Fixed)
                {
                    last = last.Concat(key);
                    items[items.Count - 1] = last;
                }
                else
                {
                    items.Add(key);
                }
            }
            else
            {
                items.Add(key);
            }
            return(this);
        }
コード例 #3
0
 public LocalizationKeyBuilder AppendLine(LocalizationKey key)
 {
     Append(key);
     AppendLine();
     return(this);
 }
コード例 #4
0
 public LocalizationKeyBuilder AppendLine()
 {
     Append(LocalizationKey.CreateRaw(System.Environment.NewLine));
     return(this);
 }