Question about integration with I2Loc

Announcements, support questions, and discussion for the Dialogue System.
Krejwen
Posts: 25
Joined: Mon Jun 08, 2020 8:09 am

Question about integration with I2Loc

Post by Krejwen »

Hi,

I intergrate (Dialogue System)DS with I2Loc system and everything works. However, I have two questions about the solution.

1. Is it possible to integrate plural forms from I2Loc with DS?
2. Can you explain how sync with I2Loc works? I have a node like on a screenshot. When I send text to I2Loc the system copy text from "Dialogue Text", it ignore pl version . In addition it copy english text to polish part of the term.
Attachments
Sync.PNG
Sync.PNG (23.37 KiB) Viewed 1165 times
DS_I2Loc.PNG
DS_I2Loc.PNG (92.61 KiB) Viewed 1165 times
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about integration with I2Loc

Post by Tony Li »

Hi,
Krejwen wrote: Mon Jun 08, 2020 8:35 am1. Is it possible to integrate plural forms from I2Loc with DS?
I'll look into this.
Krejwen wrote: Mon Jun 08, 2020 8:35 am2. Can you explain how sync with I2Loc works? I have a node like on a screenshot. When I send text to I2Loc the system copy text from "Dialogue Text", it ignore pl version . In addition it copy english text to polish part of the term.
In the DS To I2 window, make sure to only tick the main Dialogue Text field, not the 'pl' field. It should only copy the term. It should not overwrite the 'pl' translation. If that doesn't work, please let me know which version of i2 you're using. Maybe something has changed in some version of i2.
Krejwen
Posts: 25
Joined: Mon Jun 08, 2020 8:09 am

Re: Question about integration with I2Loc

Post by Krejwen »

Hi,

Thanks for a fast response :)

1. In "DS to I2" window I uncheck "en" and "pl" boxes. However, I found that the "issuse" is connected with my languages, "pl" is a first langugage (see screenshot).
Lang.PNG
Lang.PNG (13.29 KiB) Viewed 1161 times
2. So I uderstand that you always add text from "Dialogue Text" to the default language? In I2Loc first language on the list is default. In addition, if "Dialogue Text" is empty then you don't create the key?

3. Is there any solution to change an algorithm which generate keys name?
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about integration with I2Loc

Post by Tony Li »

Krejwen wrote: Mon Jun 08, 2020 9:26 am2. So I uderstand that you always add text from "Dialogue Text" to the default language? In I2Loc first language on the list is default. In addition, if "Dialogue Text" is empty then you don't create the key?
Yes, that's correct.
Krejwen wrote: Mon Jun 08, 2020 9:26 am3. Is there any solution to change an algorithm which generate keys name?
There are two options to change the key name:
  • You can set the Extra Entry Info dropdown to add the Actor name or the actual text to the entry.
  • You can set Entry Min Digits to specify the number of digits to use in entry IDs. For example, if Entry Min Digits is 3, then an entry with ID 7 will use "007" in the key.
Other than that, the key name is specific because that's how the Dialogue System knows which keys to import and export.

The integration does not yet support i2 Localization's special Plurals support. I will try to get this added into the next version.
Krejwen
Posts: 25
Joined: Mon Jun 08, 2020 8:09 am

Re: Question about integration with I2Loc

Post by Krejwen »

Ok.

So how DS works with plural forms? Do you support them?
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about integration with I2Loc

Post by Tony Li »

Currently plural forms are handled manually by the author/designer.
Krejwen
Posts: 25
Joined: Mon Jun 08, 2020 8:09 am

Re: Question about integration with I2Loc

Post by Krejwen »

Thanks for info.

Do you have plans to add support for this?

I am thinking how to implement this feature. Is it possible to change text before it will be display? I assume that text will have special divining tags.
Krejwen
Posts: 25
Joined: Mon Jun 08, 2020 8:09 am

Re: Question about integration with I2Loc

Post by Krejwen »

I implement plural forms by using I2Loc system.

Thanks for your help!
User avatar
Tony Li
Posts: 22054
Joined: Thu Jul 18, 2013 1:27 pm

Re: Question about integration with I2Loc

Post by Tony Li »

Hi,

Sounds good! May I ask how you did it, and how you like the solution?

The integration includes a component Use I2 Language At Runtime that you could use to pull translations at runtime from i2.

Also, you could add an OnConversationLine method to change the text before display. For example:

Code: Select all

void OnConversationLine(Subtitle subtitle)
{
    // In here, change subtitle.formattedText.text, which is the text that will be displayed.
}
Krejwen
Posts: 25
Joined: Mon Jun 08, 2020 8:09 am

Re: Question about integration with I2Loc

Post by Krejwen »

Tony Li wrote: Tue Jun 09, 2020 7:52 am The integration includes a component Use I2 Language At Runtime that you could use to pull translations at runtime from i2.
I am using it :)
Tony Li wrote: Tue Jun 09, 2020 7:52 am Sounds good! May I ask how you did it, and how you like the solution?
I think it can be a kind of hack. I made a C# method and register it to the LUA. In addition, script registed itself to I2Loc plural system with const variable name - VALUE.


Method gets two parameters: text and value.
1. In method I save value for plural system
2. Then I call I2Loc method for text parameter which analyze the value of the I2Loc variable (VALUE) and return correct version of the text.
3. At the end method return correct text.

The solution is not percfect because the text in Dialogue text looks like this:

Code: Select all

[lua(PluralForm("Here, take {[VALUE]} pieces of gold.[i2p_Zero]I have no gold[i2p_One] I have only {[VALUE]}} gold", Variable["Gold"]))]
but it works with spreadsheet. A smal problem is that I2Loc inspector has a "crazy" behaviour because text is not as it expected but we can live with this..


If you have any idea how it can be improved or implemented in better way I am open for suggestions.
Post Reply