Пример #1
0
        /// <summary>
        /// Applies localized text translations for the passed in window
        /// See the comments in the method for more information
        /// </summary>
        /// <param name="window">The window to apply translations to</param>
        /// <param name="applyToolTips">Set to true to seach and apply tooltips to the components</param>
        public static void LocalizeWindow(RelhaxWindow window, bool applyToolTips)
        {
            //apply window title
            string typeName = window.GetType().Name;

            if (ExistsInCurrentLanguage(typeName))
            {
                window.Title = GetTranslatedString(typeName);
            }

            //Get a list of all visual class controls curently presend and loaded in the window
            List <FrameworkElement> allWindowControls = UiUtils.GetAllWindowComponentsVisual(window, false);

            foreach (FrameworkElement v in allWindowControls)
            {
                TranslateComponent(v, applyToolTips);
            }
        }