Change game's culture (language) during runtime (without restart)

Hi,

How can we change the game’s culture during runntime with blueprints? If there is not a way to do it, how can we do it in c++?

Also, what about enabling/disabling subtitles during runtime?

I’ve asked Rama about this and I have tries myself to convert my bp project to c++, and I manage to compile everything ok but well… I have no idea about C++ and everytime I make and try to add some code to a new class it just stops working :frowning:

Here is the forum link: (39) Rama's Extra Blueprint Nodes for You as a Plugin, No C++ Required! - Blueprint - Unreal Engine Forums

I am quite curious as well about changing culture during runtime, I am only aware of commandline options to change culture, which require restarting the UE4 game.

Rama

Is there an update on this? I’m looking for a solution too.

It can be done manually, but then you would not have a nice output to give your translator.

How can it be done?

In 4.7 in the c++ it is possible, for example:

FInternationalization::Get().SetCurrentCulture(TEXT("en"));
FInternationalization::Get().SetCurrentCulture(TEXT("pl"));

or something.

Of course I have some problem in cooked build, probably my cultures aren’t cooked or something, but this is another issue.

It is possible to do this with blueprints in 4.11?

In 4.12

In my case ‘FInternationalization::Get().SetCurrentCulture’ only changes the editor’s language. But I find how to change language in runtime.

I’m using the experimental tool “Localization Dashboard” and “Translation Picker” to generate the localization files.

In code:

TArray<FCultureRef> LocalizedCulturesForGame;

FInternationalization::Get().GetCulturesWithAvailableLocalization(FPaths::GetGameLocalizationPaths(), LocalizedCulturesForGame, true);

  int numCultures = LocalizedCulturesForGameNum();
  for (int i = 0; i < numCultures; ++i)
  {
    if (!LocalizedCulturesForGame[i].Get().GetEnglishName().Compare(Culture))
    {
      GConfig->SetString(TEXT("Internationalization"), TEXT("NativeGameCulture"), *LocalizedCulturesForGame[i].Get().GetName(), GEditorSettingsIni);
      GConfig->Flush(false, GEditorSettingsIni);
      FTextLocalizationManager::Get().RefreshResources();
      return;
    }
  }

It’s not the best approach, but it is my first attempt and it works.

I am also interested in how to do this