Localization done, and now? how to load ingame english or french?

Setup some UI that calls FInternationalization::Get().SetCulture().

You can retrieve a culture for setting the same way FInternationalization::Get().GetCulture(“fr”)

You’ll want to save this value to ini so the game will remember the setting between runs.

Yo,

(in fact i didnt finish my localization :D) but i did some translations with the localization dashboard, and i am testing
this with “standalone launch” and work fine for EN-en and FR-fr cultures parameters.

but now, how can i allow player to change language ingame? i want a french flag (not a white flag!!!), an english flag, so if they click on it the language change :]

i am sure i can do a console command to restart the game with -culture parameters, but it wont save the culture for the next restart of the game rigth? :o

thank you

Ok this work fine inside the editor i can switch from culture en to fr and fr to en

but when i package my game, it dont work anymore,

and i saw some disturbing warning about localization in Project setting>Packaging>Localization to package

“anglais” and “français” have warning “this project does not have localization data (translations) for this culture”

http://i.imgur.com/66tGBEy.png

btw this work fine inside the editor in standalone and mobile preview

What does the editor think you have translations for? (Click the Show localized option)

I think at one point we had the loc hot reload disabled in shipping… it appears we’ve changed that. Idk if that is in your build.

nothing, with show localized, editor think i have 0 translation ! why u do this to me editor !!!

Any idea? :frowning: that probably a small manual line to write somewhere? :o

i managed to fix the warning about “this project does not have localization data (translations) for this culture” by adding this line in the DefaultGame.ini

[Internationalization]
+LocalizationPaths=%GAMEDIR%Content/Localization/NewTarget
i can now find in “Show Localized” english and français !!

i thought that would fix the localization missing in packaged game but no i still have no translation working in my packaged game

there is no folder “localization” in “Saved\Cooked…\Content” path

is there a manual line to write somewhere that i forgot ?

FInternationalization::Get().SetCulture() as well as console command CULTURE=en used to work in 4.8, but not in 4.9 :frowning: It doesn’t work in PIE, and I need to test in PIE because of the dedicated server. Is there a way to switch languages in PIE in 4.9?

You shuld click the compile button under the Cultures lable, and this will create .locres file under the target localization content directory.


Plase make sure these actions should be done under the GAME target, or there will be no enteries when you show localized.

1 Like