Exemple #1
0
        public void LoadLanguages(string language)
        {
            if (language == null)
            {
                return;
            }

            LabelsAndMessagesCategories labelsAndMessagesCategories = new LabelsAndMessagesCategories();
            WPFLanguage wPFLanguage = LanguageHelper.GetLanguageForForms(language, "Categories");
        }
Exemple #2
0
        public void Setup_SetLanguage(string language)
        {
            if (language == null)
            {
                return;
            }

            LabelsAndMessagesCategories labelsAndMessagesCategories = new LabelsAndMessagesCategories();
            WPFLanguage wPFLanguage = LanguageHelper.GetLanguageForForms(language, "Categories");
            LabelsAndMessagesCategories labelsAndMessages = new LabelsAndMessagesCategories();
            LanguageElement             languageElement;

            languageElement = wPFLanguage.LanguageElementsFromDB.Where(x => x.OriginalValue == labelsAndMessages.LabelsFromDBCategories.LabelCategoryID).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LabelsFromDBCategories.LabelCategoryID = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsFromDB.Where(x => x.OriginalValue == labelsAndMessages.LabelsFromDBCategories.LabelCategoryName).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LabelsFromDBCategories.LabelCategoryName = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsFromDB.Where(x => x.OriginalValue == labelsAndMessages.LabelsFromDBCategories.LabelDescription).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LabelsFromDBCategories.LabelDescription = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsFromDB.Where(x => x.OriginalValue == labelsAndMessages.LabelsFromDBCategories.LabelPicture).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LabelsFromDBCategories.LabelPicture = languageElement.TranslatedValue;
            }

            //Labels
            languageElement = wPFLanguage.LanguageElementsDefaultControls.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsControlsCategories.LabelBtnNew).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsControlsCategories.LabelBtnNew = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsDefaultControls.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsControlsCategories.LabelBtnDelete).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsControlsCategories.LabelBtnDelete = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsDefaultControls.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsControlsCategories.LabelBtnUpdate).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsControlsCategories.LabelBtnUpdate = languageElement.TranslatedValue;
            }

            //Messages
            languageElement = wPFLanguage.LanguageElementsDefaultMessages.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsMessagesCategories.MessageBoxDeleteConfirm).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsMessagesCategories.MessageBoxDeleteConfirm = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsDefaultMessages.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsMessagesCategories.MessageBoxSaveOK).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsMessagesCategories.MessageBoxSaveError = languageElement.TranslatedValue;
            }

            languageElement = wPFLanguage.LanguageElementsDefaultMessages.Where(x => x.OriginalValue == labelsAndMessages.LanguageElementsMessagesCategories.MessageBoxSaveOK).FirstOrDefault();
            if (languageElement != null)
            {
                labelsAndMessages.LanguageElementsMessagesCategories.MessageBoxSaveOK = languageElement.TranslatedValue;
            }

            CategoriesDataContext.LabelsAndMessagesCategories = labelsAndMessages;
        }