WYZTracker/Managers/LocalizationManager.cs
/// <summary>
/// Localizes the currently open forms and sets the current culture to the specified one 
/// if supported. Otherwise, the first culture in the supported cultures list is used.
/// </summary>
/// <param name="cultureName">The culture name.</param>
Localizes the currently open forms and sets the current culture to the specified one
if supported. Otherwise, the first culture in the supported cultures list is used.
Localizes the currently open forms and sets the current culture to the specified one if supported . Otherwise the first culture in the supported cultures list is used .
public static void LocalizeApplication(string cultureName)
        {
            if (string.IsNullOrEmpty(cultureName))
            {
                cultureName = Thread.CurrentThread.CurrentUICulture.Name;
            }
            CultureInfo newCulture = new CultureInfo(cultureName);
            while (!newCulture.IsNeutralCulture)
            {
                newCulture = newCulture.Parent;
            }
            if (!supportedCultures.Contains(newCulture.Name))
            {
                newCulture = new CultureInfo(supportedCultures[0]);
            }
            Thread.CurrentThread.CurrentUICulture = newCulture;
        }
public static void LocalizeApplication ( string cultureName ) { if ( string . IsNullOrEmpty ( cultureName ) ) { cultureName = Thread . CurrentThread . CurrentUICulture . Name ; } CultureInfo newCulture = new CultureInfo ( cultureName ) ; while ( ! newCulture . IsNeutralCulture ) { newCulture = newCulture . Parent ; } if ( ! supportedCultures . Contains ( newCulture . Name ) ) { newCulture = new CultureInfo ( supportedCultures [ 0 ] ) ; } Thread . CurrentThread . CurrentUICulture = newCulture ; }
Localizes the currently open forms and sets the current culture to the specified one
if supported.
Localizes the currently open forms and sets the current culture to the specified one if supported .
// Look for the culture by full name.
cultureName
string
The culture name.
The culture name .