コード例 #1
0
 public Alert(string category = null)
 {
     AlertDate = DateTime.Now;
     if (category == "Driftsmelding")
     {
         EffectiveDate = AlertDate;
     }
     else
     {
         EffectiveDate = DateTime.Now.AddMonths(3);
     }
     Translations = new TranslationCollection <AlertTranslation>();
 }
コード例 #2
0
ファイル: Translation.cs プロジェクト: dekkerb115/Bam.Net
 public ActionResult Save(Bam.Net.Translation.Translation[] values)
 {
     try
     {
         TranslationCollection saver = new TranslationCollection();
         saver.AddRange(values);
         saver.Save();
         return(Json(new { Success = true, Message = "", Dao = "" }));
     }
     catch (Exception ex)
     {
         return(GetErrorResult(ex));
     }
 }
コード例 #3
0
		public TranslationProject ()
		{
			translations = new TranslationCollection (this);
			
			//NOTE: we don't really need multiple configurations for this project type, since nothing actually uses them
			//but it makes the solution configuration mapping look more consistent
			//Perhaps in future there will be some per-config settings
			foreach (string config in new [] { "Debug", "Release"})
				Configurations.Add (new TranslationProjectConfiguration (config));
		}
コード例 #4
0
ファイル: TabularTranslation.cs プロジェクト: japj/bidshelper
        private void SaveInternal(TranslationCollection translations, Dictionary <int, string> DisplayFolderLanguages, Dictionary <int, string> DescriptionLanguages, SSAS.TabularTranslationObjectAnnotation annotation)
        {
            List <int> listAllLanguages = new List <int>(Languages.Keys);

            foreach (int iLang in DisplayFolderLanguages.Keys)
            {
                if (!listAllLanguages.Contains(iLang))
                {
                    listAllLanguages.Add(iLang);
                }
            }
            foreach (int iLang in DescriptionLanguages.Keys)
            {
                if (!listAllLanguages.Contains(iLang))
                {
                    listAllLanguages.Add(iLang);
                }
            }

            List <SSAS.TabularTranslationAnnotation> listAnnotations = new List <TabularTranslationAnnotation>();

            translations.Clear();
            foreach (int iLang in listAllLanguages)
            {
                Translation t = new Translation(iLang);
                if (translations is AttributeTranslationCollection)
                {
                    t = new AttributeTranslation(iLang);
                }
                if (DisplayFolderLanguages.ContainsKey(iLang))
                {
                    t.DisplayFolder = DisplayFolderLanguages[iLang];
                }
                if (DescriptionLanguages.ContainsKey(iLang))
                {
                    t.Description = DescriptionLanguages[iLang];
                }

                if (Languages.ContainsKey(iLang) && !string.IsNullOrEmpty(Languages[iLang]))
                {
                    t.Caption = Languages[iLang];
                }
                else if (!string.IsNullOrEmpty(t.DisplayFolder) || !string.IsNullOrEmpty(t.Description))
                {
                    t.Caption = this.DefaultLanguage; //this works around a problem where if they translate the display folder or the description but not the caption, then the caption ends up blank
                }
                if (!string.IsNullOrEmpty(t.Caption) || !string.IsNullOrEmpty(t.Description) || !string.IsNullOrEmpty(t.DisplayFolder))
                {
                    translations.Add(t);
                    SSAS.TabularTranslationAnnotation tranAnnotation = new TabularTranslationAnnotation();
                    tranAnnotation.Caption       = t.Caption;
                    tranAnnotation.Description   = t.Description;
                    tranAnnotation.DisplayFolder = t.DisplayFolder;
                    tranAnnotation.Language      = t.Language;
                    listAnnotations.Add(tranAnnotation);
                }
            }

            if (annotation != null)
            {
                annotation.TabularTranslations = listAnnotations.ToArray();
            }
        }
コード例 #5
0
		public TranslationProject ()
		{
			translations = new TranslationCollection (this);
		}
コード例 #6
0
ファイル: Alert.cs プロジェクト: lulzzz/Geonorge.Register
 public Alert()
 {
     AlertDate     = DateTime.Now;
     EffectiveDate = DateTime.Now.AddMonths(3);
     Translations  = new TranslationCollection <AlertTranslation>();
 }
コード例 #7
0
		public TranslationProject ()
		{
			Initialize (this);
			translations = new TranslationCollection (this);
		}
コード例 #8
0
 public Theme()
 {
     Translations = new TranslationCollection <ThemeTranslation>();
 }
コード例 #9
0
ファイル: TabularTranslation.cs プロジェクト: japj/bidshelper
        private void SaveInternal(TranslationCollection translations, Dictionary<int, string> DisplayFolderLanguages, Dictionary<int, string> DescriptionLanguages, SSAS.TabularTranslationObjectAnnotation annotation)
        {
            List<int> listAllLanguages = new List<int>(Languages.Keys);
            foreach (int iLang in DisplayFolderLanguages.Keys)
            {
                if (!listAllLanguages.Contains(iLang))
                    listAllLanguages.Add(iLang);
            }
            foreach (int iLang in DescriptionLanguages.Keys)
            {
                if (!listAllLanguages.Contains(iLang))
                    listAllLanguages.Add(iLang);
            }

            List<SSAS.TabularTranslationAnnotation> listAnnotations = new List<TabularTranslationAnnotation>();
            translations.Clear();
            foreach (int iLang in listAllLanguages)
            {
                Translation t = new Translation(iLang);
                if (translations is AttributeTranslationCollection)
                    t = new AttributeTranslation(iLang);
                if (DisplayFolderLanguages.ContainsKey(iLang))
                    t.DisplayFolder = DisplayFolderLanguages[iLang];
                if (DescriptionLanguages.ContainsKey(iLang))
                    t.Description = DescriptionLanguages[iLang];

                if (Languages.ContainsKey(iLang) && !string.IsNullOrEmpty(Languages[iLang]))
                    t.Caption = Languages[iLang];
                else if (!string.IsNullOrEmpty(t.DisplayFolder) || !string.IsNullOrEmpty(t.Description))
                    t.Caption = this.DefaultLanguage; //this works around a problem where if they translate the display folder or the description but not the caption, then the caption ends up blank
                
                if (!string.IsNullOrEmpty(t.Caption) || !string.IsNullOrEmpty(t.Description) || !string.IsNullOrEmpty(t.DisplayFolder))
                {
                    translations.Add(t);
                    SSAS.TabularTranslationAnnotation tranAnnotation = new TabularTranslationAnnotation();
                    tranAnnotation.Caption = t.Caption;
                    tranAnnotation.Description = t.Description;
                    tranAnnotation.DisplayFolder = t.DisplayFolder;
                    tranAnnotation.Language = t.Language;
                    listAnnotations.Add(tranAnnotation);
                }
            }

            if (annotation != null)
                annotation.TabularTranslations = listAnnotations.ToArray();
        }