Implement TrustwordsCulture setting so the default display language can be changed.
authorDean
Wed, 07 Sep 2016 18:23:04 +0200
changeset 1248d6aa0fcdbaa3
parent 1247 0d02588e644c
child 1249 00cc05656f71
Implement TrustwordsCulture setting so the default display language can be changed.
ThisAddIn.cs
UI/FormControlHandshake.xaml
UI/FormControlHandshake.xaml.cs
UI/FormControlOptions.xaml
UI/FormControlOptions.xaml.cs
UI/FormRegionPrivacyStatus.cs
     1.1 --- a/ThisAddIn.cs	Wed Sep 07 15:34:16 2016 +0200
     1.2 +++ b/ThisAddIn.cs	Wed Sep 07 18:23:04 2016 +0200
     1.3 @@ -170,6 +170,7 @@
     1.4              Outlook.NameSpace ns = Application.Session;
     1.5              Outlook.Account acct = null;
     1.6              Outlook.Accounts accounts = ns.Accounts;
     1.7 +            List<KeyValuePair<CultureInfo, string>> languages;
     1.8              List<PEPSettings.PEPAccountSettings> legacyAcctSettings = new List<PEPSettings.PEPAccountSettings>();
     1.9              PEPSettings.PEPAccountSettings newAcctSettings;
    1.10              PEPSettings.PEPAccountSettings existingAcctSettings;
    1.11 @@ -287,6 +288,35 @@
    1.12  
    1.13                      // Sync IsVerboseLoggingEnabled with engine
    1.14                      ThisAddIn.PEPEngine.verbose_logging(this._Settings.IsVerboseLoggingEnabled);
    1.15 +
    1.16 +                    // Sync TrustwordsCulture with engine
    1.17 +                    if (this._Settings.TrustwordsCulture != null)
    1.18 +                    {
    1.19 +                        // Validate it exists in the engine list
    1.20 +                        exists = false;
    1.21 +                        languages = this.LanguageList;
    1.22 +                        foreach (KeyValuePair<CultureInfo, string> entry in languages)
    1.23 +                        {
    1.24 +                            if (entry.Key.LCID == this._Settings.TrustwordsCulture.LCID)
    1.25 +                            {
    1.26 +                                exists = true;
    1.27 +                                break;
    1.28 +                            }
    1.29 +                        }
    1.30 +
    1.31 +                        if (exists == false)
    1.32 +                        {
    1.33 +                            // Reset to default
    1.34 +                            this._Settings.TrustwordsCulture = new CultureInfo(PEPSettings.CULTURE_CODE_DEFAULT);
    1.35 +                            Globals.Log("SyncWithSettings: Invalid TrustwordsCulture detected, setting to default.");
    1.36 +                        }
    1.37 +                    }
    1.38 +                    else
    1.39 +                    {
    1.40 +                        // Reset to default
    1.41 +                        this._Settings.TrustwordsCulture = new CultureInfo(PEPSettings.CULTURE_CODE_DEFAULT);
    1.42 +                        Globals.Log("SyncWithSettings: Invalid TrustwordsCulture detected, setting to default.");
    1.43 +                    }
    1.44                  }
    1.45              }
    1.46              catch { }
    1.47 @@ -1251,6 +1281,7 @@
    1.48                  this._Settings.IsSecurityLossWarningEnabled = state.IsSecurityLossWarningEnabled;
    1.49                  this._Settings.IsUnencryptedSubjectEnabled = state.IsUnencryptedSubjectEnabled;
    1.50                  this._Settings.IsVerboseLoggingEnabled = state.IsVerboseLoggingEnabled;
    1.51 +                this._Settings.TrustwordsCulture = ((state.TrustwordsCulture != null) ? new CultureInfo(state.TrustwordsCulture.LCID) : null);
    1.52  
    1.53                  // Save last state for next options opening
    1.54                  this.lastOptionsState = state.Copy();
    1.55 @@ -1363,6 +1394,7 @@
    1.56              state.PEPCopyright = Globals.PEP_COPYRIGHT;
    1.57              state.PEPName = (Globals.RELEASE_MODE == Globals.ReleaseMode.Reader ? Globals.PEP_DISPLAY_NAME_READER : Globals.PEP_DISPLAY_NAME);
    1.58              state.SystemInfo = Globals.GetSystemInfoList();
    1.59 +            state.TrustwordsCulture = ((this._Settings.TrustwordsCulture != null) ? new CultureInfo(this._Settings.TrustwordsCulture.LCID) : null);
    1.60  
    1.61              // Release objects
    1.62              if (ns != null)
    1.63 @@ -2607,11 +2639,13 @@
    1.64          /// </summary>
    1.65          private void Settings_PropertyChanged(object sender, PropertyChangedEventArgs e)
    1.66          {
    1.67 +            bool exists;
    1.68              PEPSettings settings = (PEPSettings)sender;
    1.69 +            List<KeyValuePair<CultureInfo, string>> languages;
    1.70  
    1.71              switch (e.PropertyName)
    1.72              {
    1.73 -                case ("IsKeyServerUsed"):
    1.74 +                case (nameof(PEPSettings.IsKeyServerUsed)):
    1.75                      {
    1.76                          // Sync IsKeyServerUsed with engine
    1.77                          if (settings.IsKeyServerUsed)
    1.78 @@ -2624,30 +2658,62 @@
    1.79                          }
    1.80                          break;
    1.81                      }
    1.82 -                case ("IsPassiveModeEnabled"):
    1.83 +                case (nameof(PEPSettings.IsPassiveModeEnabled)):
    1.84                      {
    1.85                          // Sync IsPassiveModeEnabled with engine
    1.86                          ThisAddIn.PEPEngine.passive_mode(settings.IsPassiveModeEnabled);
    1.87                          break;
    1.88                      }
    1.89 -                case ("IsPEPFolderVisible"):
    1.90 +                case (nameof(PEPSettings.IsPEPFolderVisible)):
    1.91                      {
    1.92                          // Sync IsPEPFolderVisible with Outlook
    1.93                          this.SetPEPStoreRootFolderVisibility(settings.IsPEPFolderVisible);
    1.94                          break;
    1.95                      }
    1.96 -                case ("IsUnencryptedSubjectEnabled"):
    1.97 +                case (nameof(PEPSettings.IsUnencryptedSubjectEnabled)):
    1.98                      {
    1.99                          // Sync IsUnencryptedSubjectEnabled with engine
   1.100                          ThisAddIn.PEPEngine.unencrypted_subject(settings.IsUnencryptedSubjectEnabled);
   1.101                          break;
   1.102                      }
   1.103 -                case ("IsVerboseLoggingEnabled"):
   1.104 +                case (nameof(PEPSettings.IsVerboseLoggingEnabled)):
   1.105                      {
   1.106                          // Sync IsVerboseLoggingEnabled with engine
   1.107                          ThisAddIn.PEPEngine.verbose_logging(settings.IsVerboseLoggingEnabled);
   1.108                          break;
   1.109                      }
   1.110 +                case (nameof(PEPSettings.TrustwordsCulture)):
   1.111 +                    {
   1.112 +                        // Sync TrustwordsCulture with engine
   1.113 +                        if (this._Settings.TrustwordsCulture != null)
   1.114 +                        {
   1.115 +                            // Validate it exists in the engine list
   1.116 +                            exists = false;
   1.117 +                            languages = this.LanguageList;
   1.118 +                            foreach (KeyValuePair<CultureInfo, string> entry in languages)
   1.119 +                            {
   1.120 +                                if (entry.Key.LCID == this._Settings.TrustwordsCulture.LCID)
   1.121 +                                {
   1.122 +                                    exists = true;
   1.123 +                                    break;
   1.124 +                                }
   1.125 +                            }
   1.126 +
   1.127 +                            if (exists == false)
   1.128 +                            {
   1.129 +                                // Reset to default
   1.130 +                                this._Settings.TrustwordsCulture = new CultureInfo(PEPSettings.CULTURE_CODE_DEFAULT);
   1.131 +                                Globals.Log("Settings_PropertyChanged: Invalid TrustwordsCulture detected, setting to default.");
   1.132 +                            }
   1.133 +                        }
   1.134 +                        else
   1.135 +                        {
   1.136 +                            // Reset to default
   1.137 +                            this._Settings.TrustwordsCulture = new CultureInfo(PEPSettings.CULTURE_CODE_DEFAULT);
   1.138 +                            Globals.Log("Settings_PropertyChanged: Invalid TrustwordsCulture detected, setting to default.");
   1.139 +                        }
   1.140 +                        break;
   1.141 +                    }
   1.142              }
   1.143  
   1.144              return;
     2.1 --- a/UI/FormControlHandshake.xaml	Wed Sep 07 15:34:16 2016 +0200
     2.2 +++ b/UI/FormControlHandshake.xaml	Wed Sep 07 18:23:04 2016 +0200
     2.3 @@ -101,10 +101,10 @@
     2.4                              <!-- Language selection -->
     2.5                              <ComboBox Grid.Row="1"
     2.6                                        Margin="0,10,0,0"
     2.7 -                                      ItemsSource="{Binding Path=LanguageList}"
     2.8 +                                      ItemsSource="{Binding Path=TrustwordsCultureList}"
     2.9                                        DisplayMemberPath="Value"
    2.10                                        SelectedValuePath="Key"
    2.11 -                                      SelectedValue="{Binding Path=SelectedCulture, Mode=TwoWay}">
    2.12 +                                      SelectedValue="{Binding Path=TrustwordsCulture, Mode=TwoWay}">
    2.13                              </ComboBox>
    2.14                          </Grid>
    2.15                      </TabItem.Content>
    2.16 @@ -129,10 +129,10 @@
    2.17                              <!-- Language selection -->
    2.18                              <ComboBox Grid.Row="1"
    2.19                                        Margin="0,10,0,0"
    2.20 -                                      ItemsSource="{Binding Path=LanguageList}"
    2.21 +                                      ItemsSource="{Binding Path=TrustwordsCultureList}"
    2.22                                        DisplayMemberPath="Value"
    2.23                                        SelectedValuePath="Key"
    2.24 -                                      SelectedValue="{Binding Path=SelectedCulture, Mode=TwoWay}">
    2.25 +                                      SelectedValue="{Binding Path=TrustwordsCulture, Mode=TwoWay}">
    2.26                              </ComboBox>
    2.27                          </Grid>
    2.28                      </TabItem.Content>
     3.1 --- a/UI/FormControlHandshake.xaml.cs	Wed Sep 07 15:34:16 2016 +0200
     3.2 +++ b/UI/FormControlHandshake.xaml.cs	Wed Sep 07 18:23:04 2016 +0200
     3.3 @@ -139,14 +139,14 @@
     3.4              private string                                  _FingerprintMyself;
     3.5              private string                                  _FingerprintPartner;
     3.6              private string                                  _FingerprintText;
     3.7 -            private List<KeyValuePair<CultureInfo, string>> _LanguageList;
     3.8              private HandshakeMode                           _Mode;
     3.9              private PEPIdentity                             _Myself;
    3.10              private string                                  _MyselfText;
    3.11              private PEPIdentity                             _Partner;
    3.12              private string                                  _PartnerText;
    3.13 -            private CultureInfo                             _SelectedCulture;
    3.14              private int                                     _SelectedTabItemIndex;
    3.15 +            private CultureInfo                             _TrustwordsCulture;
    3.16 +            private List<KeyValuePair<CultureInfo, string>> _TrustwordsCultureList;
    3.17              private string                                  _TrustwordsFull;
    3.18              private string                                  _TrustwordsFullText;
    3.19              private string                                  _TrustwordsShort;
    3.20 @@ -169,18 +169,21 @@
    3.21              }
    3.22  
    3.23              /// <summary>
    3.24 -            /// Builds a new state using a copy of the given identities.
    3.25 +            /// Builds a new state using a copy of the given identities and a trustwords culture.
    3.26              /// </summary>
    3.27              /// <param name="ownIdentity">The personal identity for the handshake.</param>
    3.28              /// <param name="partnerIdentity">The communication partner for the handshake.</param>
    3.29 +            /// <param name="trustwordsCulture">The culture/language to display the trustwords in.</param>
    3.30              public State(PEPIdentity ownIdentity,
    3.31 -                         PEPIdentity partnerIdentity)
    3.32 +                         PEPIdentity partnerIdentity,
    3.33 +                         CultureInfo trustwordsCulture)
    3.34              {
    3.35                  this.Reset();
    3.36  
    3.37                  // Call through property accessors to raise events
    3.38                  this.Myself = ownIdentity.Copy();
    3.39                  this.Partner = partnerIdentity.Copy();
    3.40 +                this.TrustwordsCulture = ((trustwordsCulture != null) ? new CultureInfo(trustwordsCulture.LCID) : null);
    3.41              }
    3.42  
    3.43              /**************************************************************
    3.44 @@ -248,14 +251,6 @@
    3.45              }
    3.46  
    3.47              /// <summary>
    3.48 -            /// Gets the list of languages and cultures supported for trustwords.
    3.49 -            /// </summary>
    3.50 -            public List<KeyValuePair<CultureInfo, string>> LanguageList
    3.51 -            {
    3.52 -                get { return (this._LanguageList); }
    3.53 -            }
    3.54 -
    3.55 -            /// <summary>
    3.56              /// Gets or sets the mode of the handshake.
    3.57              /// </summary>
    3.58              public HandshakeMode Mode
    3.59 @@ -357,22 +352,6 @@
    3.60              }
    3.61  
    3.62              /// <summary>
    3.63 -            /// Gets or sets the conversation culture (language) for the handshake.
    3.64 -            /// Warning: must correlate with LanguageList.
    3.65 -            /// </summary>
    3.66 -            public CultureInfo SelectedCulture
    3.67 -            {
    3.68 -                get { return (this._SelectedCulture); }
    3.69 -                set
    3.70 -                {
    3.71 -                    this._SelectedCulture = value;
    3.72 -                    this.RaisePropertyChangedEvent(nameof(this.SelectedCulture));
    3.73 -
    3.74 -                    this.CalcDependentProperties();
    3.75 -                }
    3.76 -            }
    3.77 -
    3.78 -            /// <summary>
    3.79              /// Gets or sets the selected tab index of the UI.
    3.80              /// </summary>
    3.81              public int SelectedTabItemIndex
    3.82 @@ -388,6 +367,30 @@
    3.83              }
    3.84  
    3.85              /// <summary>
    3.86 +            /// Gets or sets the current trustwords culture/language.
    3.87 +            /// Warning: This must correlate with TrustwordsCultureList.
    3.88 +            /// </summary>
    3.89 +            public CultureInfo TrustwordsCulture
    3.90 +            {
    3.91 +                get { return (this._TrustwordsCulture); }
    3.92 +                set
    3.93 +                {
    3.94 +                    this._TrustwordsCulture = value;
    3.95 +                    this.RaisePropertyChangedEvent(nameof(this.TrustwordsCulture));
    3.96 +
    3.97 +                    this.CalcDependentProperties();
    3.98 +                }
    3.99 +            }
   3.100 +
   3.101 +            /// <summary>
   3.102 +            /// Gets the list of possible cultures/languages for trustwords.
   3.103 +            /// </summary>
   3.104 +            public List<KeyValuePair<CultureInfo, string>> TrustwordsCultureList
   3.105 +            {
   3.106 +                get { return (this._TrustwordsCultureList); }
   3.107 +            }
   3.108 +
   3.109 +            /// <summary>
   3.110              /// Gets the full-version trustwords.
   3.111              /// This is a dependent property set through Myself, Partner and ConversationCulture.
   3.112              /// </summary>
   3.113 @@ -464,14 +467,14 @@
   3.114                  this._ConfirmTrustwordsText = pEp.Properties.Resources.Handshake_ConfirmTrustwordsText;
   3.115                  this._ExplanationText = pEp.Properties.Resources.Handshake_ExplanationText;
   3.116                  this._FingerprintText = pEp.Properties.Resources.Handshake_FingerprintText;
   3.117 -                this._LanguageList = Globals.ThisAddIn.LanguageList;
   3.118                  this._Mode = HandshakeMode.Standard;
   3.119                  this._Myself = null;
   3.120                  this._MyselfText = pEp.Properties.Resources.Handshake_MyselfText;
   3.121                  this._Partner = null;
   3.122                  this._PartnerText = pEp.Properties.Resources.Handshake_PartnerText;
   3.123 -                this._SelectedCulture = new CultureInfo(PEPSettings.CULTURE_CODE_DEFAULT);
   3.124                  this._SelectedTabItemIndex = -1;
   3.125 +                this._TrustwordsCulture = new CultureInfo(PEPSettings.CULTURE_CODE_DEFAULT);
   3.126 +                this._TrustwordsCultureList = Globals.ThisAddIn.LanguageList;
   3.127                  this._TrustwordsFullText = pEp.Properties.Resources.Handshake_TrustwordsFullText;
   3.128                  this._TrustwordsShortText = pEp.Properties.Resources.Handshake_TrustwordsShortText;
   3.129                  this._TrustwordsText = pEp.Properties.Resources.Handshake_TrustwordsText;
   3.130 @@ -482,7 +485,6 @@
   3.131                  this.RaisePropertyChangedEvent(nameof(this.ConfirmTrustwordsText));
   3.132                  this.RaisePropertyChangedEvent(nameof(this.ExplanationText));
   3.133                  this.RaisePropertyChangedEvent(nameof(this.FingerprintText));
   3.134 -                this.RaisePropertyChangedEvent(nameof(this.LanguageList));
   3.135                  this.RaisePropertyChangedEvent(nameof(this.Mode));
   3.136                  this.RaisePropertyChangedEvent(nameof(this.Myself));
   3.137                  this.RaisePropertyChangedEvent(nameof(this.MyselfString));
   3.138 @@ -490,8 +492,9 @@
   3.139                  this.RaisePropertyChangedEvent(nameof(this.Partner));
   3.140                  this.RaisePropertyChangedEvent(nameof(this.PartnerString));
   3.141                  this.RaisePropertyChangedEvent(nameof(this.PartnerText));
   3.142 -                this.RaisePropertyChangedEvent(nameof(this.SelectedCulture));
   3.143                  this.RaisePropertyChangedEvent(nameof(this.SelectedTabItemIndex));
   3.144 +                this.RaisePropertyChangedEvent(nameof(this.TrustwordsCulture));
   3.145 +                this.RaisePropertyChangedEvent(nameof(this.TrustwordsCultureList));
   3.146                  this.RaisePropertyChangedEvent(nameof(this.TrustwordsFullText));
   3.147                  this.RaisePropertyChangedEvent(nameof(this.TrustwordsShortText));
   3.148                  this.RaisePropertyChangedEvent(nameof(this.TrustwordsText));
   3.149 @@ -521,7 +524,7 @@
   3.150                                                       this._Partner,
   3.151                                                       out trustwordsShort,
   3.152                                                       out trustwordsFull,
   3.153 -                                                     this._SelectedCulture.TwoLetterISOLanguageName);
   3.154 +                                                     this._TrustwordsCulture?.TwoLetterISOLanguageName);
   3.155  
   3.156                      this._FingerprintMyself = Globals.ThisAddIn.ToQuadruple(this._Myself.Fingerprint, true);
   3.157                      this._FingerprintPartner = Globals.ThisAddIn.ToQuadruple(this._Partner.Fingerprint, true);
     4.1 --- a/UI/FormControlOptions.xaml	Wed Sep 07 15:34:16 2016 +0200
     4.2 +++ b/UI/FormControlOptions.xaml	Wed Sep 07 18:23:04 2016 +0200
     4.3 @@ -263,6 +263,7 @@
     4.4                              <RowDefinition Height="Auto" />
     4.5                              <RowDefinition Height="Auto" />
     4.6                              <RowDefinition Height="Auto" />
     4.7 +                            <RowDefinition Height="Auto" />
     4.8                          </Grid.RowDefinitions>
     4.9                          <CheckBox x:Name="CheckBoxIsEncryptAllAccountsEnabled"
    4.10                                    Grid.Row="0"
    4.11 @@ -317,6 +318,19 @@
    4.12                                         TextWrapping="Wrap"
    4.13                                         Margin="{StaticResource CheckBoxContentMarginWhenTop}" />
    4.14                          </CheckBox>
    4.15 +                        <ComboBox Grid.Row="4"
    4.16 +                                  ItemsSource="{Binding Path=TrustwordsCultureList}"
    4.17 +                                  DisplayMemberPath="Value"
    4.18 +                                  SelectedValuePath="Key"
    4.19 +                                  SelectedValue="{Binding Path=TrustwordsCulture, Mode=TwoWay}"
    4.20 +                                  Visibility="{Binding ElementName=CheckBoxIsAdvancedEnabled, Path=IsChecked, Mode=OneWay, Converter={StaticResource BoolToVisibility}}">
    4.21 +                            <ComboBox.Margin>
    4.22 +                                <Thickness Bottom="0"
    4.23 +                                           Left="0"
    4.24 +                                           Right="0"
    4.25 +                                           Top="{StaticResource PageSubSectionSpacing}" />
    4.26 +                            </ComboBox.Margin>
    4.27 +                        </ComboBox>
    4.28                      </Grid>
    4.29  
    4.30                  </Grid>
     5.1 --- a/UI/FormControlOptions.xaml.cs	Wed Sep 07 15:34:16 2016 +0200
     5.2 +++ b/UI/FormControlOptions.xaml.cs	Wed Sep 07 18:23:04 2016 +0200
     5.3 @@ -3,6 +3,7 @@
     5.4  using System.Collections.ObjectModel;
     5.5  using System.ComponentModel;
     5.6  using System.Diagnostics;
     5.7 +using System.Globalization;
     5.8  using System.IO;
     5.9  using System.Text;
    5.10  using System.Windows;
    5.11 @@ -288,64 +289,66 @@
    5.12                  Developer = 4
    5.13              }
    5.14  
    5.15 -            private string                       _AccountIsPEPEnabledText;
    5.16 -            private string                       _AccountIsSecureStorageEnabledText;
    5.17 +            private string                                  _AccountIsPEPEnabledText;
    5.18 +            private string                                  _AccountIsSecureStorageEnabledText;
    5.19              private ObservableCollection<PEPSettings.PEPAccountSettings> _AccountSettingsList;
    5.20 -            private int                          _AccountSettingsListSelectedIndex;
    5.21 -            private string                       _AutoUpdateOffWarningText;
    5.22 -            private string                       _CancelText;
    5.23 -            private string                       _EncryptedAccountsText;
    5.24 -            private bool                         _IsAdvancedEnabled;
    5.25 -            private string                       _IsAdvancedEnabledText;
    5.26 -            private bool                         _IsAutoUpdateEnabled;
    5.27 -            private string                       _IsAutoUpdateEnabledText;
    5.28 -            private bool                         _IsDeveloperModeEnabled;
    5.29 -            private bool                         _IsEncryptAllAccountsEnabled;
    5.30 -            private string                       _IsEncryptAllAccountsEnabledText;
    5.31 -            private bool                         _IsKeyServerUsed;
    5.32 -            private string                       _IsKeyServerUsedText;
    5.33 -            private bool                         _IsPEPFolderDefaultStore;
    5.34 -            private bool                         _IsPEPFolderVisible;
    5.35 -            private string                       _IsPEPFolderVisibleText;
    5.36 -            private bool                         _IsSecurityLossWarningEnabled;
    5.37 -            private string                       _IsSecurityLossWarningEnabledText;
    5.38 -            private bool                         _IsTNEFDisabled;
    5.39 -            private string                       _IsTNEFDisabledText;
    5.40 -            private bool                         _IsUnencryptedSubjectEnabled;
    5.41 -            private string                       _IsUnencryptedSubjectEnabledText;
    5.42 -            private bool                         _IsVerboseLoggingEnabled;
    5.43 -            private string                       _IsVerboseLoggingEnabledText;
    5.44 +            private int                                     _AccountSettingsListSelectedIndex;
    5.45 +            private string                                  _AutoUpdateOffWarningText;
    5.46 +            private string                                  _CancelText;
    5.47 +            private string                                  _EncryptedAccountsText;
    5.48 +            private bool                                    _IsAdvancedEnabled;
    5.49 +            private string                                  _IsAdvancedEnabledText;
    5.50 +            private bool                                    _IsAutoUpdateEnabled;
    5.51 +            private string                                  _IsAutoUpdateEnabledText;
    5.52 +            private bool                                    _IsDeveloperModeEnabled;
    5.53 +            private bool                                    _IsEncryptAllAccountsEnabled;
    5.54 +            private string                                  _IsEncryptAllAccountsEnabledText;
    5.55 +            private bool                                    _IsKeyServerUsed;
    5.56 +            private string                                  _IsKeyServerUsedText;
    5.57 +            private bool                                    _IsPEPFolderDefaultStore;
    5.58 +            private bool                                    _IsPEPFolderVisible;
    5.59 +            private string                                  _IsPEPFolderVisibleText;
    5.60 +            private bool                                    _IsSecurityLossWarningEnabled;
    5.61 +            private string                                  _IsSecurityLossWarningEnabledText;
    5.62 +            private bool                                    _IsTNEFDisabled;
    5.63 +            private string                                  _IsTNEFDisabledText;
    5.64 +            private bool                                    _IsUnencryptedSubjectEnabled;
    5.65 +            private string                                  _IsUnencryptedSubjectEnabledText;
    5.66 +            private bool                                    _IsVerboseLoggingEnabled;
    5.67 +            private string                                  _IsVerboseLoggingEnabledText;
    5.68              private ObservableCollection<KVPair<PEPIdentity, bool>> _KeyList;
    5.69              private ObservableCollection<KVPair<PEPIdentity, bool>> _KeyListDisplayed;
    5.70 -            private string                       _KeyListSearchCriteria;
    5.71 -            private string                       _KeyListSearchCriteriaText;
    5.72 -            private string                       _KeyListSearchNoResultsText;
    5.73 -            private int                          _KeyListSelectedIndex;
    5.74 -            private string                       _LogEngine;
    5.75 -            private string                       _LogEngineText;
    5.76 -            private string                       _LogOutlook;
    5.77 -            private string                       _LogOutlookText;
    5.78 -            private string                       _OKText;
    5.79 -            private string                       _OpenKeyManagerText;
    5.80 -            private string                       _PageAboutText;
    5.81 -            private string                       _PageAccountsText;
    5.82 -            private string                       _PageCompatibilityText;
    5.83 -            private string                       _PageCreditsText;
    5.84 -            private string                       _PageDeveloperText;
    5.85 -            private string                       _PageSectionAboutText;
    5.86 -            private string                       _PageSectionAccountsText;
    5.87 -            private string                       _PageSectionBlacklistText;
    5.88 -            private string                       _PageSectionCreditsText;
    5.89 -            private string                       _PageSectionDeveloperText;
    5.90 -            private string                       _PageSectionOpenPGPCompatibilityText;
    5.91 -            private string                       _PEPCopyright;
    5.92 -            private FlowDocument                 _PEPCredits;
    5.93 -            private string                       _PEPName;
    5.94 -            private string                       _PEPWebAddress;
    5.95 -            private string                       _RefreshLogsText;
    5.96 -            private string                       _ResetPEPStoreText;
    5.97 -            private int                          _SelectedPageIndex;
    5.98 -            private List<KVPair<string, string>> _SystemInfo;
    5.99 +            private string                                  _KeyListSearchCriteria;
   5.100 +            private string                                  _KeyListSearchCriteriaText;
   5.101 +            private string                                  _KeyListSearchNoResultsText;
   5.102 +            private int                                     _KeyListSelectedIndex;
   5.103 +            private string                                  _LogEngine;
   5.104 +            private string                                  _LogEngineText;
   5.105 +            private string                                  _LogOutlook;
   5.106 +            private string                                  _LogOutlookText;
   5.107 +            private string                                  _OKText;
   5.108 +            private string                                  _OpenKeyManagerText;
   5.109 +            private string                                  _PageAboutText;
   5.110 +            private string                                  _PageAccountsText;
   5.111 +            private string                                  _PageCompatibilityText;
   5.112 +            private string                                  _PageCreditsText;
   5.113 +            private string                                  _PageDeveloperText;
   5.114 +            private string                                  _PageSectionAboutText;
   5.115 +            private string                                  _PageSectionAccountsText;
   5.116 +            private string                                  _PageSectionBlacklistText;
   5.117 +            private string                                  _PageSectionCreditsText;
   5.118 +            private string                                  _PageSectionDeveloperText;
   5.119 +            private string                                  _PageSectionOpenPGPCompatibilityText;
   5.120 +            private string                                  _PEPCopyright;
   5.121 +            private FlowDocument                            _PEPCredits;
   5.122 +            private string                                  _PEPName;
   5.123 +            private string                                  _PEPWebAddress;
   5.124 +            private string                                  _RefreshLogsText;
   5.125 +            private string                                  _ResetPEPStoreText;
   5.126 +            private int                                     _SelectedPageIndex;
   5.127 +            private List<KVPair<string, string>>            _SystemInfo;
   5.128 +            private CultureInfo                             _TrustwordsCulture;
   5.129 +            private List<KeyValuePair<CultureInfo, string>> _TrustwordsCultureList;
   5.130  
   5.131              private bool calcDepPropIsEnabled;
   5.132  
   5.133 @@ -1017,6 +1020,30 @@
   5.134                  }
   5.135              }
   5.136  
   5.137 +            /// <summary>
   5.138 +            /// Gets or sets the current trustwords culture/language.
   5.139 +            /// Warning: This must correlate with TrustwordsCultureList.
   5.140 +            /// </summary>
   5.141 +            public CultureInfo TrustwordsCulture
   5.142 +            {
   5.143 +                get { return (this._TrustwordsCulture); }
   5.144 +                set
   5.145 +                {
   5.146 +                    this._TrustwordsCulture = value;
   5.147 +                    this.RaisePropertyChangedEvent(nameof(this.TrustwordsCulture));
   5.148 +
   5.149 +                    this.CalcDependentProperties();
   5.150 +                }
   5.151 +            }
   5.152 +
   5.153 +            /// <summary>
   5.154 +            /// Gets the list of possible cultures/languages for trustwords.
   5.155 +            /// </summary>
   5.156 +            public List<KeyValuePair<CultureInfo, string>> TrustwordsCultureList
   5.157 +            {
   5.158 +                get { return (this._TrustwordsCultureList); }
   5.159 +            }
   5.160 +
   5.161              /**************************************************************
   5.162               * 
   5.163               * Methods
   5.164 @@ -1104,6 +1131,7 @@
   5.165                  copy.PEPName = this._PEPName;
   5.166                  copy.SelectedPageIndex = this._SelectedPageIndex;
   5.167                  copy.SystemInfo = this._SystemInfo;
   5.168 +                copy.TrustwordsCulture = ((this._TrustwordsCulture != null) ? new CultureInfo(this._TrustwordsCulture.LCID) : null);
   5.169  
   5.170                  return (copy);
   5.171              }
   5.172 @@ -1140,6 +1168,8 @@
   5.173                  this._PEPName = null;
   5.174                  this._SelectedPageIndex = (int)OptionPages.Accounts;
   5.175                  this._SystemInfo = null;
   5.176 +                this._TrustwordsCulture = new CultureInfo(PEPSettings.CULTURE_CODE_DEFAULT);
   5.177 +                this._TrustwordsCultureList = Globals.ThisAddIn.LanguageList;
   5.178  
   5.179                  this.RaisePropertyChangedEvent(nameof(this.AccountSettingsList));
   5.180                  this.RaisePropertyChangedEvent(nameof(this.AccountSettingsListSelectedIndex));
   5.181 @@ -1165,6 +1195,8 @@
   5.182                  this.RaisePropertyChangedEvent(nameof(this.PEPName));
   5.183                  this.RaisePropertyChangedEvent(nameof(this.SelectedPageIndex));
   5.184                  this.RaisePropertyChangedEvent(nameof(this.SystemInfo));
   5.185 +                this.RaisePropertyChangedEvent(nameof(this.TrustwordsCulture));
   5.186 +                this.RaisePropertyChangedEvent(nameof(this.TrustwordsCultureList));
   5.187  
   5.188                  // Set independent display text properties
   5.189                  this._AccountIsPEPEnabledText = pEp.Properties.Resources.Options_AccountIsPEPEnabledText;
     6.1 --- a/UI/FormRegionPrivacyStatus.cs	Wed Sep 07 15:34:16 2016 +0200
     6.2 +++ b/UI/FormRegionPrivacyStatus.cs	Wed Sep 07 18:23:04 2016 +0200
     6.3 @@ -4,6 +4,7 @@
     6.4  using System.Collections.Generic;
     6.5  using System.ComponentModel;
     6.6  using System.Diagnostics;
     6.7 +using System.Globalization;
     6.8  using System.Runtime.InteropServices;
     6.9  using System.Windows;
    6.10  using System.Windows.Forms;
    6.11 @@ -251,7 +252,9 @@
    6.12              // Create and show handshake dialog
    6.13              handshakeDialog = new FormHandshake();
    6.14              handshakeDialog.StartPosition = FormStartPosition.CenterParent;
    6.15 -            handshakeDialog.FormControl.DisplayState = new FormControlHandshake.State(myself, partner);
    6.16 +            handshakeDialog.FormControl.DisplayState = new FormControlHandshake.State(myself,
    6.17 +                                                                                      partner,
    6.18 +                                                                                      Globals.ThisAddIn.Settings.TrustwordsCulture);
    6.19  
    6.20              result = handshakeDialog.ShowDialog(this);
    6.21              this.ProcessDoHandshakeResult(result, partner);
    6.22 @@ -421,7 +424,7 @@
    6.23                                                       partnerIdentity,
    6.24                                                       out trustwordsShort,
    6.25                                                       out trustwordsFull,
    6.26 -                                                     PEPSettings.CULTURE_CODE_DEFAULT);
    6.27 +                                                     Globals.ThisAddIn.Settings.TrustwordsCulture?.TwoLetterISOLanguageName);
    6.28  
    6.29                      item = new SelectionItem();
    6.30                      item.TextLine1 = partnerIdentity.Username;