Beispiel #1
0
        public string Translate(Locale locale, Key key, params object[] args)
        {
            var trans = Translation(locale);

            if (trans == null)
            {
                trans = DefaultTranslation;
            }

            var msg = trans.Translate(key, args);

            if (string.IsNullOrEmpty(msg))
            {
                msg = DefaultTranslation.Translate(key, args);
                if (string.IsNullOrEmpty(msg))
                {
                    msg = BaseTranslation.Translate(key, args);
                    if (string.IsNullOrEmpty(msg))
                    {
                        msg = "No translation available for Key [" + key + "]";
                    }
                }
            }
            return(msg);
        }
Beispiel #2
0
        /// <summary>
        /// Apply a quaternion rotation on all translation data of this bone. Used to apply the jointOrient.
        /// </summary>
        /// <param name="quat"></param>
        public void RotateTranslation(MQuaternion quat)
        {
            BaseTranslation = BaseTranslation.rotateBy(quat);

            foreach (var list in Translation)
            {
                for (var i = 0; i < list.Count; i++)
                {
                    list[i] = new Tuple <uint, MVector>(list[i].Item1, list[i].Item2.rotateBy(quat));
                }
            }
        }
Beispiel #3
0
        public string Translate(Locale locale, Key key, params object[] args)
        {
            string str = (Translation(locale) ?? DefaultTranslation).Translate(key, args);

            if (string.IsNullOrEmpty(str))
            {
                str = DefaultTranslation.Translate(key, args);
                if (string.IsNullOrEmpty(str))
                {
                    str = BaseTranslation.Translate(key, args);
                    if (string.IsNullOrEmpty(str))
                    {
                        str = "No translation available for Key [" + key + "]";
                    }
                }
            }

            return(str);
        }