Welcome, Guest
Username: Password: Remember me
  • Page:
  • 1
  • 2

TOPIC: Right to Left Text problem in Dialogue System

Right to Left Text problem in Dialogue System 3 months 5 days ago #3197

  • fanaei
  • fanaei's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Karma: 0
Hi. I'm using I2 Localization + Dialogue System
The I2 localization shows the RTL languages like Arabic texts fine. But when I use it with Dialogue system, all the letters get separated and in a wrong direction.
How can I fix this problem?

Thanks in advance
The administrator has disabled public write access.

Right to Left Text problem in Dialogue System 3 months 5 days ago #3198

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1139
  • Thank you received: 243
  • Karma: 72
Hi,
How are you using I2 Localization + Dialog System.
By default Dialog System has a built-in localization and doesn't use I2 Localization. Integrating both plugins is possible, and there are several users who are using both at the same time.

I'm curious about how you are using them together. The fix for that issue will depend on how you integrate them.

Are you adding a Localize component to your Texts and made Dialog System call SetTerm ?
Are you handling all by code and calling LocalizationManager.GetTranslation when Dialog System needs a translation?
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
The administrator has disabled public write access.
The following user(s) said Thank You: fanaei

Right to Left Text problem in Dialogue System 3 months 4 days ago #3201

  • fanaei
  • fanaei's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Karma: 0
I didn't know that Dialogue system has localization. But I feel more comfortable with I2 localization.
Also I did the integration based on this guide:
www.pixelcrushers.com/dialogue_system/ma...i2_localization.html
The administrator has disabled public write access.

Right to Left Text problem in Dialogue System 3 months 4 days ago #3202

  • fanaei
  • fanaei's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Karma: 0
I found some fixes here:
pixelcrushers.com/phpbb/viewtopic.php?f=3&t=1590&p=8595#p8595
If you have nay better solution, I'm all ear.
Last Edit: 3 months 4 days ago by fanaei.
The administrator has disabled public write access.

Right to Left Text problem in Dialogue System 3 months 4 days ago #3203

  • fanaei
  • fanaei's Avatar
  • Offline
  • New Member
  • Posts: 10
  • Karma: 0
The code that I used for fixing RTL problem in the main Dialogue System UI:
using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using PixelCrushers.DialogueSystem;

public class FixFarsi : MonoBehaviour {
	public int TextLimit = 999;
	void OnConversationLine(Subtitle subtitle)
	{
		subtitle.formattedText.text = I2.Loc.LocalizationManager.ApplyRTLfix (subtitle.formattedText.text, TextLimit, false);
	}

	void OnConversationResponseMenu(Response[] responses)
	{
		for (int i = 0; i < responses.Length; i++) {
			responses [i].formattedText.text = I2.Loc.LocalizationManager.ApplyRTLfix (responses [i].formattedText.text, TextLimit, false);
		}
	}
}
The administrator has disabled public write access.

Right to Left Text problem in Dialogue System 3 months 4 days ago #3204

  • Frank
  • Frank's Avatar
  • Offline
  • Administrator
  • Posts: 1139
  • Thank you received: 243
  • Karma: 72
Hi,
Unfortunately, I don't have the Dialog System plugin to inspect the code, but from what I'm reading in the integration steps you listed:
www.pixelcrushers.com/dialogue_system/ma...i2_localization.html

That's not actually integrating I2 Localization with Dialog System. That keeps using the Dialog System localization and just uses I2 Localization as a way to translate terms in the editor or sync with Google Spreadsheet. But none of the runtime features of I2 Localization are used (except for reading the CurrentLanguage string).

That works fine if you just need the translations done, and the code you posted should work fine for fixing RTL issues.

But if you need more features (e.g. Parameters-> to dynamically change the player's name or other data, Plurals, etc) then the integration should be done a bit different.

Instead of storing the actual text in Dialog System, you should save the Term's name, and then whenever you do
formattedText.text = xxx.formattedText.text

you can do:
formattedText.text = I2.Localization.GetTranslation(xxx.formattedText.text)

That way, parameters, plurals, rtl fix, etc is automatically handled at runtime by I2 Localization.
And even better, if you link Google Spreadsheets with I2L, then if you change a translation in the spreadsheet, that change is automatically downloaded and used in your player's devices without deploying a new build.

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
The administrator has disabled public write access.
  • Page:
  • 1
  • 2
Time to create page: 0.164 seconds
Template by JoomlaShine