예제 #1
0
        public static string Translate(string word)
        {
            var loc = LocalStorage.GetItem("localization");

            if (loc is null)
            {
                ChangeLocale("en");
                loc = "en";
            }

            return(loc == "en"
                ? _wordsEn[word]
                : _wordsUa[word]);
        }
예제 #2
0
        public object ProvideValue(IServiceProvider serviceProvider)
        {
            if (Text is null)
            {
                return(null);
            }

            var loc = LocalStorage.GetItem("localization");

            if (loc is null)
            {
                ChangeLocale("en");
                loc = "en";
            }

            return(loc == "en"
                ? _wordsEn[Text]
                : _wordsUa[Text]);
        }