Version 1.2.0

This commit is contained in:
Junior 2024-01-04 22:59:30 -03:00
parent 9b3a0e00a2
commit e74d93fab9
83 changed files with 110087 additions and 47507 deletions

View file

@ -1,44 +0,0 @@
using System.Globalization;
using System.Resources;
namespace RHLauncher.RHLauncher
{
public class LocalizationHelper
{
public static void LoadLocalizedStrings(
string lang,
List<Button> buttons,
List<ImageList> imageLists,
Dictionary<string, List<ImageList>> languageImageLists)
{
CultureInfo cultureInfo;
if (languageImageLists.ContainsKey(lang))
{
// If the language is supported, get the corresponding image lists
List<ImageList> langSpecificImageLists = languageImageLists[lang];
for (int i = 0; i < buttons.Count && i < langSpecificImageLists.Count; i++)
{
buttons[i].ImageList = langSpecificImageLists[i];
}
cultureInfo = new CultureInfo(lang);
}
else
{
// Default to English if the language is not supported
cultureInfo = new CultureInfo("en-US"); // English culture
for (int i = 0; i < buttons.Count && i < imageLists.Count; i++)
{
buttons[i].ImageList = imageLists[i];
}
}
Thread.CurrentThread.CurrentUICulture = cultureInfo;
// Load the appropriate resource file based on the selected language
_ = new
ResourceManager(typeof(LocalizedStrings));
LocalizedStrings.Culture = cultureInfo;
}
}
}