From eb92bf7b00b67f3c18412bb3bc5c3795a2248078 Mon Sep 17 00:00:00 2001 From: kervala Date: Fri, 18 Mar 2016 22:20:28 +0100 Subject: [PATCH] Fixed: Use language defined in Ryzom properties from Steam --- code/ryzom/client/src/steam_client.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/code/ryzom/client/src/steam_client.cpp b/code/ryzom/client/src/steam_client.cpp index 03ed261d0..6e9521eea 100644 --- a/code/ryzom/client/src/steam_client.cpp +++ b/code/ryzom/client/src/steam_client.cpp @@ -29,6 +29,7 @@ // prototypes definitions for Steam API functions we'll call typedef bool (__cdecl *SteamAPI_InitFuncPtr)(); typedef void (__cdecl *SteamAPI_ShutdownFuncPtr)(); +typedef ISteamApps* (__cdecl *SteamAppsFuncPtr)(); typedef ISteamClient* (__cdecl *SteamClientFuncPtr)(); typedef ISteamFriends* (__cdecl *SteamFriendsFuncPtr)(); typedef ISteamUser* (__cdecl *SteamUserFuncPtr)(); @@ -45,6 +46,7 @@ if (nl##symbol == NULL) return false NL_DECLARE_SYMBOL(SteamAPI_Init); NL_DECLARE_SYMBOL(SteamAPI_Shutdown); +NL_DECLARE_SYMBOL(SteamApps); NL_DECLARE_SYMBOL(SteamClient); NL_DECLARE_SYMBOL(SteamFriends); NL_DECLARE_SYMBOL(SteamUser); @@ -330,6 +332,7 @@ bool CSteamClient::init() _Initialized = true; // load more Steam functions + NL_LOAD_SYMBOL(SteamApps); NL_LOAD_SYMBOL(SteamClient); NL_LOAD_SYMBOL(SteamFriends); NL_LOAD_SYMBOL(SteamUser); @@ -339,10 +342,14 @@ bool CSteamClient::init() nlSteamClient()->SetWarningMessageHook(SteamWarningMessageHook); bool loggedOn = nlSteamUser()->BLoggedOn(); + const char *lang = nlSteamApps()->GetCurrentGameLanguage(); nlinfo("Steam AppID: %u", nlSteamUtils()->GetAppID()); nlinfo("Steam login: %s", nlSteamFriends()->GetPersonaName()); nlinfo("Steam user logged: %s", loggedOn ? "yes":"no"); + nlinfo("Steam language: %s", lang); + + NLMISC::CI18N::setSystemLanguageCode(lang); // don't need to continue, if not connected if (!loggedOn) return false;