Page 1 of 1

Actor.LocalizedName

Posted: Fri Jan 18, 2019 10:43 am
by forrestuv
Hi!
Can't undestand why LocalizedName field never return localized name.
I have "Use Display Name" ticked and added

"Display Name EN" and "Display Name EN" as Localization fields.

Do I have to do anything else?

Re: Actor.LocalizedName

Posted: Fri Jan 18, 2019 12:22 pm
by Tony Li
Hi,

Actor.localizedName returns the localized version of the "Name" field. In other words, it will only look for "Name EN".

If you want to get the localized version of the Dispay Name field, I recommend using CharacterInfo.GetLocalizedDisplayNameInDatabase(actor.Name). This will try the following, in order (assuming the language is set to EN):
  • Display Name EN
  • Display Name
  • Name EN
  • Name
It will also process any [var=varName] and [lua(code)] markup tags in the name.

Also, make sure the current language is set to EN. (See How To Switch Languages)

Re: Actor.LocalizedName

Posted: Fri Jan 18, 2019 12:55 pm
by forrestuv
It works.
thank you, always good support.

Re: Actor.LocalizedName

Posted: Fri Jan 18, 2019 1:07 pm
by Tony Li
Glad to help!