Exemple #1
0
        public string Translate(string jp)
        {
            if (!ShouldTranslateString(jp))
            {
                return(jp);
            }

            var specialTranslation = GetSpecialTranslation(jp);

            if (specialTranslation != null)
            {
                return(specialTranslation);
            }

            if (translations.TryGetValue(jp, out string en))
            {
                return(en ?? jp);
            }
            else
            {
                if (EnsureKey(jp))
                {
                    saveDebouncer.Bounce();
                }

                return(jp);
            }
        }
Exemple #2
0
        public string Translate(string jp)
        {
            if (lut.TryGetValue(jp, out string en))
            {
                return(en ?? jp);
            }
            else
            {
                InsertUntranslated(jp);

                saveDebouncer.Bounce();

                return(jp);
            }
        }