Пример #1
0
 /// <summary>
 /// Audits object localization.
 /// </summary>
 /// <param name="repositoryObject"><see cref="T:Tridion.ContentManager.ContentManagement.RepositoryLocalObject" /></param>
 /// <param name="args">The <see cref="LocalizeEventArgs" /> instance containing the event data.</param>
 /// <param name="phase"><see cref="T:Tridion.ContentManager.Extensibility.EventPhases" /></param>
 private void AuditLocalize(RepositoryLocalObject repositoryObject, LocalizeEventArgs args, EventPhases phase)
 {
     if (phase == EventPhases.TransactionCommitted)
     {
         AuditContentEdit("Localize", repositoryObject, null, new SqlXml(repositoryObject.ToXml().CreateNavigator().ReadSubtree()));
     }
 }
Пример #2
0
 private static void OnLocalizeString(object sender, LocalizeEventArgs e)
 {
     e.LocalizedText = e.Text;
     if (e.Source is MenuBar)
     {
         e.LocalizedText = e.Text switch
         {
             "&File" => T._("&Datei"),
             "&Help" => T._("&Hilfe"),
             "&View" => T._("&Ansicht"),
             "&Edit" => T._("&Bearbeiten"),
             "Quit" => T._("Beenden"),
             _ => e.Text
         };
     }
     else if (e.Source is AboutDialog)
     {
         e.LocalizedText = e.Text switch
         {
             "About" => T._("Info"),
             "Credits" => T._("Mitwirkende"),
             "License" => T._("Lizenz"),
             "Developers:" => T._("Entwicklung:"),
             "Designers:" => T._("Design:"),
             "Documenters:" => T._("Dokumentation:"),
             _ => e.Text
         };
     }
 }
Пример #3
0
 static void LocalizationKeys_LocalizeString(object sender, LocalizeEventArgs e)
 {
     if (e.Key == LocalizationKeys.MessageBoxCancelButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&取消";
     }
     else if (e.Key == LocalizationKeys.MessageBoxOkButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&确定";
     }
     else if (e.Key == LocalizationKeys.MessageBoxCloseButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&关闭";
     }
     else if (e.Key == LocalizationKeys.MessageBoxYesButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&是";
     }
     else if (e.Key == LocalizationKeys.MessageBoxNoButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&否";
     }
     else if (e.Key == LocalizationKeys.MessageBoxTryAgainButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&重试";
     }
     else if (e.Key == LocalizationKeys.MessageBoxIgnoreButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&忽略";
     }
     else if (e.Key == LocalizationKeys.MessageBoxHelpButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&帮助";
     }
     else if (e.Key == LocalizationKeys.MessageBoxContinueButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&继续";
     }
     else if (e.Key == LocalizationKeys.MessageBoxAbortButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&中止";
     }
     else if (e.Key == LocalizationKeys.MessageBoxRetryButton)
     {
         e.Handled        = true;
         e.LocalizedValue = "&重试";
     }
 }
Пример #4
0
        private void App_LocalizeString(object sender, LocalizeEventArgs e)
        {
            switch (e.Text)
            {
            case "&File":
                e.LocalizedText = "文件(&F)";
                break;

            case "&Help":
                e.LocalizedText = "帮助(&H)";
                break;

            case "Quit":
                e.LocalizedText = "退出";
                break;
            }
        }
Пример #5
0
 static void LocalizationKeys_LocalizeString(object sender, LocalizeEventArgs e)
 {
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxCancelButton)
     {
         e.LocalizedValue = "取消"; e.Handled = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxNoButton)
     {
         e.LocalizedValue = "取消"; e.Handled = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxOkButton)
     {
         e.LocalizedValue = "确定"; e.Handled = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MessageBoxYesButton)
     {
         e.LocalizedValue = "确定"; e.Handled = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MonthCalendarClearButtonText)
     {
         e.LocalizedValue = "清除"; e.Handled = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.MonthCalendarTodayButtonText)
     {
         e.LocalizedValue = "今天"; e.Handled = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorHourLabel)
     {
         e.LocalizedValue = "时"; e.Handled = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorMinuteLabel)
     {
         e.LocalizedValue = "分"; e.Handled = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorClearButton)
     {
         e.LocalizedValue = "清除"; e.Handled = true;
     }
     if (e.Key == DevComponents.DotNetBar.LocalizationKeys.TimeSelectorOkButton)
     {
         e.LocalizedValue = "确定"; e.Handled = true;
     }
 }
Пример #6
0
 protected override void OnLocalizeString(LocalizeEventArgs e)
 {
     base.OnLocalizeString(e);
     //Console.WriteLine($"Localize {e.Source}:{e.Text}");
     //e.LocalizedText = e.Text + "_localized";
 }
Пример #7
0
 private void TabStripLocalizeString(object sender, LocalizeEventArgs e)
 {
     if (LocalizeString != null)
         LocalizeString(this, e);
 }
Пример #8
0
 ///<summary>
 /// InvokeLocalizeString
 ///</summary>
 ///<param name="e"></param>
 public void InvokeLocalizeString(LocalizeEventArgs e)
 {
     if (LocalizeString != null)
         LocalizeString(this, e);
 }
Пример #9
0
 /// <summary>
 /// Audits object localization.
 /// </summary>
 /// <param name="repositoryObject"><see cref="T:Tridion.ContentManager.ContentManagement.RepositoryLocalObject" /></param>
 /// <param name="args">The <see cref="LocalizeEventArgs" /> instance containing the event data.</param>
 /// <param name="phase"><see cref="T:Tridion.ContentManager.Extensibility.EventPhases" /></param>
 private void AuditLocalize(RepositoryLocalObject repositoryObject, LocalizeEventArgs args, EventPhases phase)
 {
     if (phase == EventPhases.TransactionCommitted)
         AuditContentEdit("Localize", repositoryObject, null, new SqlXml(repositoryObject.ToXml().CreateNavigator().ReadSubtree()));
 }