Actor.LocalizedName

Announcements, support questions, and discussion for the Dialogue System.
Post Reply
forrestuv
Posts: 64
Joined: Tue Nov 06, 2018 11:28 am

Actor.LocalizedName

Post 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?
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Actor.LocalizedName

Post 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)
forrestuv
Posts: 64
Joined: Tue Nov 06, 2018 11:28 am

Re: Actor.LocalizedName

Post by forrestuv »

It works.
thank you, always good support.
User avatar
Tony Li
Posts: 22057
Joined: Thu Jul 18, 2013 1:27 pm

Re: Actor.LocalizedName

Post by Tony Li »

Glad to help!
Post Reply