Exemple #1
0
        /// <summary>
        /// Translates a string
        /// </summary>
        /// <param name="id">The id of the translation value</param>
        /// <param name="field">The field of the translation value</param>
        /// <param name="def">The default value (sets to field if empty)</param>
        /// <returns>The string associated with the translation value</returns>
        public static string T(string id, string field = "Text", string def = "")
        {
            if (def == "")
            {
                def = field;
            }
            LanguageDictionary dictionary = LanguageDictionary.GetDictionary(LanguageContext.Instance.Culture);

            return((string)dictionary.Translate(id, field, def, typeof(string)));
        }
        public MainWindow()
        {
            var a        = LanguageDictionary.RegisteredDictionaries;
            var cultures = a.Keys;

            foreach (var culture in cultures)
            {
                MV.Cultures.Add(LanguageDictionary.GetDictionary(culture));
            }
            InitializeComponent();
            InitializeMenus();
            this.DataContext = MV;
        }