x

Search in
Sort by:

Question Status:

Search help

  • Simple searches use one or more words. Separate the words with spaces (cat dog) to search cat,dog or both. Separate the words with plus signs (cat +dog) to search for items that may contain cat but must contain dog.
  • You can further refine your search on the search results page, where you can search by keywords, author, topic. These can be combined with each other. Examples
    • cat dog --matches anything with cat,dog or both
    • cat +dog --searches for cat +dog where dog is a mandatory term
    • cat -dog -- searches for cat excluding any result containing dog
    • [cats] —will restrict your search to results with topic named "cats"
    • [cats] [dogs] —will restrict your search to results with both topics, "cats", and "dogs"

AnswerHub Maintenance

Background maintenance is scheduled to occur between 9 - 11am EDT on Tuesday, May 21. Site operation may be slower than normal during this time and a brief interruption in operation may be observed

Dynamic Localisation (Runtime Data In Blueprints)

I'm working on a project where we need localised text to be updated by our client without recompiling the project. Changes need to automatically be pulled in from a file at runtime.

Unreal's localisation system is great, but the .po files had to be compiled into binary locres. Which seems like it would require continuous deployment or Unreal's Automation Tools.

So we'd gone down the route of reading a JSON (or CSV) file into a data table using 'FillDataTableFromJsonFile'. However we just discovered that these nodes cause crashes in packaged builds and are not supported outside the editor. (https://issues.unrealengine.com/issue/UE-64206)

This method uses IDs such as '6BW4' to uniquely identify key value pairs, and then grabs the correct text from the column of the current language.

We'd really appreciate any support on solving this issue! Has anyone managed to find an effective work around?

alt text

Product Version: UE 4.21
Tags:
more ▼

asked Apr 17 '19 at 10:16 AM in Blueprint Scripting

avatar image

Mark.Holland
6 3 4

avatar image DaveH Apr 17 '19 at 11:31 AM

You would need to deserialise the JSON file yourself at runtime, you can use FJsonSerializer::Deserialize for this and expose it to blueprints if needed. Does the result need to be stored in a datatable? You could store it as a struct or nested set of structs, or manually populate the data table after I guess.

avatar image Mark.Holland Apr 17 '19 at 02:41 PM

Thanks Dave,

So we can get the serialised data using the Low Entry plugins like this:

alt text

But we want to look up the data to use for localisation. Rows are IDs and columns are languages. This would mean languages can be changed from an external CMS and updated.

alt text

So how do we take this raw JSON data and structure it so we can read from it easily?

data.jpg (117.7 kB)
table.jpg (25.1 kB)
(comments are locked)
10|2000 characters needed characters left

1 answer: sort voted first

Shout out to Low Entry for their plugins and support on this. https://www.unrealengine.com/marketplace/en-US/profile/Low+Entry

They sent me the following:

You can read the data depending on how the data in JSON is formatted.

If it's stored in an object, so basically {key=>value}, and the value is a string, then you can just use the "Get String" or "Get As String" blueprint.

In your case, you could either have {language=>{ID=>translation}} or {ID=>{language=>translation}}.

In both cases you would first do "Get Object" to get the {ID=>translation} or {language=>translation} object, then on that object, you would use "Get String".

Here's a basic example of how that works for me. I'm storing the JSON object so that I'm not reading it from file every time.

"ID": [ "Lang-0", "Lang-1", "Lang-2", "Lang-3", "Lang-4" ]

Hope that helps anyone else trying to achieve this!

alt text alt text

jsonfile.jpg (144.8 kB)
jsonstring.jpg (109.8 kB)
more ▼

answered Apr 17 '19 at 04:03 PM

avatar image

Mark.Holland
6 3 4

(comments are locked)
10|2000 characters needed characters left
Your answer
toggle preview:

Up to 5 attachments (including images) can be used with a maximum of 5.2 MB each and 5.2 MB total.

Follow this question

Once you sign in you will be able to subscribe for any updates here

Answers to this question