Changeset 2357


Ignore:
Timestamp:
Jan 17, 2011, 11:30:34 AM (10 years ago)
Author:
sauer
Message:

Wizard:

  • neutral languages handling
File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/CrypPlugins/Wizard/WizardControl.xaml.cs

    r2346 r2357  
    1818using System.Threading;
    1919using System.Collections;
     20using System.Globalization;
    2021
    2122namespace Wizard
     
    222223        private XElement FindElementInElement(XElement element, string xname)
    223224        {
    224             string currentLang = System.Globalization.CultureInfo.CurrentCulture.Name;
     225            CultureInfo currentLang = System.Globalization.CultureInfo.CurrentCulture;
    225226            XElement foundElement = null;
    226227
     
    228229            if (descriptions.Any())
    229230            {
    230                 var description = from descln in descriptions where descln.Attribute("lang").Value == currentLang select descln;
     231                var description = from descln in descriptions where descln.Attribute("lang").Value == currentLang.TextInfo.CultureName select descln;
    231232                if (!description.Any())
    232233                {
    233                     description = from descln in descriptions where descln.Attribute("lang").Value == defaultLang select descln;
     234                    description = from descln in descriptions where descln.Attribute("lang").Value == currentLang.TwoLetterISOLanguageName select descln;
    234235                    if (description.Any())
    235236                        foundElement = description.First();
     237                    else
     238                    {
     239                        description = from descln in descriptions where descln.Attribute("lang").Value == defaultLang select descln;
     240                        if (description.Any())
     241                            foundElement = description.First();
     242                    }
    236243                }
    237244                else
Note: See TracChangeset for help on using the changeset viewer.