Esempio n. 1
0
        /// <summary>
        /// Translate the given code with the current language
        /// </summary>
        /// <param name="key"></param>
        /// <returns></returns>
        public string Translate(string key)
        {
            var translationBase = translationRepository.GetTranslationBase();

            if (translationBase is null || key is null)
            {
                return(key);
            }

            if (translationBase.TryGetValue(key, out string result))
            {
                return(result);
            }

            return(key);
        }