Publisher
astralcrowgames
Steam Locale Mapper
Godot 4.1+ addon for mapping Steam API languages to Godot locale codes. When using Steam API addons in Godot such as GodotSteam, language names need to be mapped to Godot locales in order to switch a Godot game's language to the user-selected one in Steam. This small addon provides mapping functions to handle all languages available via the Steam API. For more information see: https://github.com/AstralCrowGames/GodotSteamLocaleMapper
This plugin has been mirrored from the Godot Asset Library.
The plugin author is in no way affiliated with Gadget.
If you are the author of this plugin and would like this mirror removed, please contact support@gadgetgodot.com.
Steam Locale Mapper Addon
Godot addon for mapping Steam API languages to Godot locale codes.
When using Steam API addons in Godot such as GodotSteam, language names need to be mapped to Godot locales in order to switch a Godot game's language to the user-selected one in Steam.
- A full list of Steam languages can be found here.
- A full list of Godot locale codes can be found here.
Usage
After activting the addon in a project, the SteamLocaleMapper can be used for mapping.
Here is an example using GodotSteam (getcurrentgamelanguage) to set the Godot game's locale to the Steam defined language:
var steam_language = Steam.getCurrentGameLanguage()
var locale = SteamLocaleMapper.mapSteamLanguageKeyToLocale(steam_language)
TranslationServer.set_locale(locale)
In case a specific locale is not added to the Godot project, such as brazilian ("pt_BR"), an additional function "mapSteamLanguageKeyToFallbackLocale" allows the retrieval of a fallback locale, in this case "pt".