Пример #1
0
        private void Language_OnSelectionChanged(object sender, SelectionChangedEventArgs e)
        {
            var locale = I18nUtil.AvailableLangDic[(string)e.AddedItems[0]];

            I18nUtil.SwitchToLang(locale);
            AppSettings.Default.Interface.Locale = locale;
            AppSettings.SaveDefault();
        }
Пример #2
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var shown = (bool)value;

            if (System.Convert.ToString(parameter) == "string")
            {
                return(shown ? I18nUtil.GetString("ui-closeDesktopLyric") : I18nUtil.GetString("ui-openDesktopLyric"));
            }
            else if (System.Convert.ToString(parameter) == "bool")
            {
                return(shown);
            }
            else
            {
                return(null);
            }
        }
Пример #3
0
        public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
        {
            var locked = (bool)value;

            return(locked ? I18nUtil.GetString("ui-unlockLyric") : I18nUtil.GetString("ui-lockLyric"));
        }
Пример #4
0
 private void Application_Startup(object sender, StartupEventArgs e)
 {
     I18nUtil.LoadI18N();
 }