RealDocs

UKismetSystemLibrary::GetPreferredLanguages

function Engine Blueprint Since 4.0
#include "Kismet/KismetSystemLibrary.h"
Access: public Specifiers: staticBlueprintCallable

Description

Returns the user's preferred languages as configured at the OS level, ordered from most to least preferred.

Caveats & Gotchas

  • Reflects OS/device settings, not the language the game has actually loaded — use it to pick a localization, not to assume the current one.
  • The list format and specificity (e.g. "en" vs "en-US") varies by platform, so treat entries as IETF-style tags and match loosely rather than expecting exact equality with your supported culture list.

Signature

static ENGINE_API TArray<FString> GetPreferredLanguages()

Return Type

TArray<FString>

Example

Pick the first supported language from the user's preferences C++
TArray<FString> Preferred = UKismetSystemLibrary::GetPreferredLanguages();
for (const FString& Lang : Preferred)
{
    if (SupportedCultures.Contains(Lang))
    {
        FInternationalization::Get().SetCurrentCulture(Lang);
        break;
    }
}

Version History

Introduced in: 4.0

Version Status Notes
5.6 stable

Feedback

Was this helpful?

Suggest an edit

Select a field above to begin editing.