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"

GatherText eliminates spaces in translated text

Hi there,

We're very close to locking down loc for our game and I'm having trouble with localized text that starts with a space (ex: " Is Healed!")

Every time I run GatherText it deletes the spaces in the translated text:

"Source": { "Text": " Is Healed!" }, "Translation": { "Text": "Totalmente Curado!"

Any thoughts?!

Product Version: UE 4.7
Tags:
more ▼

asked Feb 19 '16 at 01:55 AM in Bug Reports

avatar image

Bagelbeard
1 1 2

(comments are locked)
10|2000 characters needed characters left
Viewable by all users

1 answer: sort voted first

Hi Bagelbeard,

This is actually by-design, though done in a terrible way, down-stream where it's confusing. We'll work on that.

But that intent is that it's bad practice to have trailing or preceding whitespace in your translatable strings. This is because not all whitespace characters are visible, it can be incredible difficult for a translator to insert the same whitespace, and inserting the same whitespace may not be ideal because often times you change fonts when displaying localized messages which may treat the whitespace characters differently then the native font.

So lots of problems with having trailing and preceding whitespace. You should instead use proper layout constructs, such as padding to achieve the look you desire in your UI.

If you are concatenating strings together and thus need to have whitespace, don't do that :) you're probably doing something that's impossible to localize correctly in some languages. The more safe alternative is to perform an FText::Format() using a pattern string. i.e.

FText::Format("Hello, {Name}", "Bagel Beard") instead of "Hello, " + "Bagel Beard".

more ▼

answered Feb 19 '16 at 04:11 PM

avatar image

Sarge STAFF
627 14 5 36

avatar image Bagelbeard Feb 19 '16 at 06:15 PM

Hey Sarge - Thanks for responding.

Sadly we're too late in the game to make such a change, so it looks like we'll just have to put a "-" at the front of the string to create space.

(comments are locked)
10|2000 characters needed characters left
Viewable by all users
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