LorisYounger / VPet

虚拟桌宠模拟器 一个开源的桌宠软件, 可以内置到任何WPF应用程序
Apache License 2.0
4.79k stars 476 forks source link

[Suggestions] Automatic language for first start #348

Closed j6845 closed 5 months ago

j6845 commented 5 months ago

The steam store page of the game is in english for none chinese users. If you have installed the game and then start it the first time, the game is always in chinese language. To change the language the user needs to guess the correct menu and that will be a huge turn off to many people trying this game out.

So much suggestion: On first start, please check if the user is from china. If not, use the english language for first start.

Maybe you can check the user's language for example with:

LorisYounger commented 5 months ago

The default language for the game should be English. I will check again

LorisYounger commented 5 months ago

After my inspection, there should default setting being English https://github.com/LorisYounger/VPet/blob/a117b1d6ca42cec5f61d995489dee8bc07f7c8e2/VPet-Simulator.Windows/MainWindow.xaml.cs#L187-L196

LoadDefaultCulture() will load CurrentCulture

public static void LoadDefaultCulture()
{
    LoadCulture(CultureInfo.CurrentCulture);
}
public static void LoadCulture(CultureInfo culture)
{
    LPS_D value;
    if (culture == null || string.IsNullOrWhiteSpace(culture.Name))
    {
        currentCulture = "null";
        currentLPS = null;
        BindingNotify.Notify();
    }
    else if (localizations.TryGetValue(culture.Name, out value))
    {
        currentCulture = culture.Name;
        currentLPS = value;
        BindingNotify.Notify();
    }
    else
    {
        LoadCulture(culture.Parent);
    }
}

if return null, then switch to LocalizeCore.CurrentCulture = "en"; If your computer has such a problem, can you debug it and see why LoadCulture did not return en / null Thanks