Welcome, Guest
Username: Password: Remember me

TOPIC: String text translation with Playmaker?

String text translation with Playmaker? 3 weeks 1 day ago #3553

  • Wabby
  • Wabby's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Karma: 0
Hello,

Just bought your plugin to use in my project (Unity 2018.2 / Playmaker 1.9) and everything works fine with Button, TextMeshPro texts… but also I need a way to use Terms for String variables (for exemple : in my RPG game, there is a log panel which display a lot of messages sended to TextMeshPro objects).

Maybe by using the "Set Term" action? But I Don't understant how!

Can you help me, please?
Last Edit: 3 weeks 1 day ago by Wabby.
The administrator has disabled public write access.

String text translation with Playmaker? 3 weeks 10 hours ago #3559

  • Wabby
  • Wabby's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Karma: 0
ok… i'm using the "Set Term" action even if I Don't understant what "Secondary term" means.
Last Edit: 3 weeks 10 hours ago by Wabby.
The administrator has disabled public write access.

String text translation with Playmaker? 3 weeks 5 hours ago #3560

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1202
  • Thank you received: 256
  • Karma: 78
i'm using the "Set Term" action even if I Don't understant what "Secondary term" means

All Localize components have 2 terms. The Primary and the Secondary Term.
When the target is a label, the Primary term changes the Text, and the Secondary term changes the Font or material used.
When the target is a UI.Image, the Primary term changes the sprite used, and the Secondary term changes the Atlas,
etc.
but also I need a way to use Terms for String variables
If I understood you correctly, you have a class in your code similar to this one:
class LogPanel
{
    public string MyString;
}

And then you use PlayMaker to take the value of MyString and apply it to a TextMeshPro label.

If thats the case, then, yes, you should use SetTerm.
But, the content of MyString should be a term name, not the translation.

What I mean, is that MyString should have a text matching one of your Terms, then, when you take that value and call SetTerm, the plugin will find the Term matching that value, get the translation to the current language and apply that to TextMeshPro label.

To simplify this even more, there is an attribute that converts the string inspector into a Term selection popup. Just change your code to this:
class LogPanel
{
   [TermsPopup] public string MyString;
}

Hope that helps,
Frank
Are you :-) Give I2L 5 stars!
Are you :-( Please lets us know how to improve it!
To get the betas as soon as they are ready, check this out
Last Edit: 3 weeks 5 hours ago by Frank.
The administrator has disabled public write access.

String text translation with Playmaker? 2 weeks 6 days ago #3561

  • Wabby
  • Wabby's Avatar
  • Offline
  • New Member
  • Posts: 3
  • Karma: 0
Hello Frank and thank you very much for the clarification, it helps a lot.

In fact, I'm using the "Set Term" action or in other situation, the "Get Translation" to put the result in a String variable and build another variable with it (exemple : a translated term + an int variable).

Anyway, your product is very good and well implemented in my game, now : twitter.com/WabbysLand
The administrator has disabled public write access.
Time to create page: 0.102 seconds
Template by JoomlaShine