rlabrecque / Steamworks.NET

Steamworks wrapper for Unity / C#
http://steamworks.github.io
MIT License
2.77k stars 366 forks source link

SteamApps.GetCurrentGameLanguage() always returns "english" #572

Closed emberfish closed 1 year ago

emberfish commented 1 year ago

Hi! I'm having an issue with GetCurrentGameLanguage(). It's always returning "english" even though my steam is in another language. Tested on Editor and build. Currently on version 20.1.0.

stoora commented 1 year ago

what's the language of the game being debugged?

emberfish commented 1 year ago

I tried several languages, I'm also trying with GetCurrentGameLanguages()

image image image

Already rebooted steam client, rebooted my PC and also tried uninstalling the game.

emberfish commented 1 year ago

Tried updating the Steamworks via package manager to the latest version. Didn't work.

stoora commented 1 year ago

Maybe unity game language settings is what being reflected. try changing unity language restart unity and see what is gives you.

    /// <summary>
    /// Gets the current language that the user has set.
    /// This falls back to the Steam UI language if the user hasn't explicitly picked a language for the title.
    /// </summary>
emberfish commented 1 year ago

still didn't work 🤔

image image

emberfish commented 1 year ago

Also tried setting the steam UI to another language image

emberfish commented 1 year ago

I asked gpt, and he fixed it :P

I might have missed that you need to include the languages on the Managing Base Languages section: msedge_IJFG8UTQe7

here is the full gpt answer:

SteamApps.GetAvailableGameLanguages() is a method provided by the Steamworks.NET API, which returns a list of the languages that the active application supports.

It's important to note that this method does not return the language that is currently set in Steam or for a specific user, but rather the languages that the game itself supports. So, if you're getting "English" as the only response, it could be because the game you're currently working with only has support implemented for English language.

If you're developing a game and you want it to support more languages including Brazilian Portuguese, you'll have to implement localization support for these languages in your game. Once you've done that, SteamApps.GetAvailableGameLanguages() should return these new languages as well.

On the other hand, if you want to get the language the user has set in their Steam client, you can use the SteamApps.GetCurrentGameLanguage() method. Make sure that the game has support for the user's current language, or else it might default to the fallback language set in the game (often English).

In conclusion, it seems like your issue is likely due to the game only having support for English language, rather than an issue with the API or your user settings. Please double check the game's supported languages.

Thank you for the help!

rlabrecque commented 1 year ago

Holy shit dude, what was the gpt prompt? 🎉

emberfish commented 1 year ago

Here is the full conversation with GPT4:

User are you familiar with steamworks.net?

ChatGPT Steamworks.NET is a C# wrapper for Valve's Steamworks API, and is available on platforms like GitHub. Developers often use it when they're creating games with Unity that they plan to distribute on Steam.

This library allows developers to integrate their games with the full suite of Steam features, such as achievements, user authentication, microtransactions, multiplayer networking, and more.

As an AI developed by OpenAI, I can provide information about how these kinds of libraries work and how you might use them in your own projects, but remember that specific code advice might require a more up-to-date source or an expert in that particular library. As of my last training data in September 2021, I don't have the capacity to understand or interact with the Steamworks.NET library directly.

User SteamApps.GetAvailableGameLanguages() is only returning me "english" even though I have my steam set to "brazilian"

ChatGPT SteamApps.GetAvailableGameLanguages() is a method provided by the Steamworks.NET API, which returns a list of the languages that the active application supports.

It's important to note that this method does not return the language that is currently set in Steam or for a specific user, but rather the languages that the game itself supports. So, if you're getting "English" as the only response, it could be because the game you're currently working with only has support implemented for English language.

If you're developing a game and you want it to support more languages including Brazilian Portuguese, you'll have to implement localization support for these languages in your game. Once you've done that, SteamApps.GetAvailableGameLanguages() should return these new languages as well.

On the other hand, if you want to get the language the user has set in their Steam client, you can use the SteamApps.GetCurrentGameLanguage() method. Make sure that the game has support for the user's current language, or else it might default to the fallback language set in the game (often English).

In conclusion, it seems like your issue is likely due to the game only having support for English language, rather than an issue with the API or your user settings. Please double check the game's supported languages.