Localization: OK in Standalone, missing after packaging

I’ve created some translations in Localization Dashboard and set them up. They work correctly in Standalone game mode (I can change localization in-game via console commands), but after packaging it doesn’t work. I have polish as my native language set up, but I want english to be default language after packaging. Here are my settings:

“Package default localization” is set to “en” and it works correctly when playing in Standalone mode (everything is in english), but in packaged game it starts in polish and I can’t change the language in-game just like I can in Standalone mode.

I don’t know solution for this problem but it is possible to bypass it.
It is impossible to achieve with blueprint only but C++ code is quite easy.

Short version: use FInternationalization::Get().SetCurrentCulture(TEXT("pl"));

Long version:

1.File → New C++ Class → Blueprint Function Library, name of class basically doesn’t matter from blueprint perspective.

2.In my case code looks like:

*.h

#pragma once
#include "Kismet/BlueprintFunctionLibrary.h"
#include "LocalizationChange.generated.h"

UCLASS()
class MYPROJECT2_API ULocalizationChange : public UBlueprintFunctionLibrary
{
	GENERATED_BODY()
public:
	UFUNCTION(BlueprintCallable, meta = (FriendlyName = "Set culture to PL"), Category = "Localization")
		static void SetCultureToPl();

	UFUNCTION(BlueprintCallable, meta = (FriendlyName = "Set culture to En"), Category = "Localization")
		static void SetCultureToEn();
};

*.cpp

#include "MyProject2.h"
#include "LocalizationChange.h"

void ULocalizationChange::SetCultureToPl()
{
	FInternationalization::Get().SetCurrentCulture(TEXT("pl"));
}

void ULocalizationChange::SetCultureToEn()
{
	FInternationalization::Get().SetCurrentCulture(TEXT("en"));
}

3.After compilation you’ll be able to simply call your functions from blueprint

64181-culture+change.png

Call it after level Event BeginPlay and it should be fine. With bit of extending its possible to create language selection thanks to this.

Thank you very much, it worked! :slight_smile:

there are errors Alis_0_1_4 - Unreal Editor (566 kb) закачан 31 января 2017 г. Joxi
how to fix they?

How would you treat it if you’re not using the localization files for translation, but for text formatting and text storage?

How do you add them?

This is also happening to me. It works fine in play in Editor AND Standalone. However, I just launched it and packaged it and both have this string tables gone (I’m using the 4.18 String Table Assets btw) and thus not loaded.

Any fixes?