Manually applying parameters to translation

More
4 years 8 months ago #4096 by c_hawk
I'm using i2 Localization and love it! Makes a lot of hard things really easy :-)

One thing that hasn’t been easy is using it with Super Text Mesh, which has its own markup language for setting colors, fonts, and effects in the text. Our localization work also includes Arabic.

The problem is that replacing parameters in RTL languages only works before the fix is applied. A marker like {[VAR]} gets reversed and ignored during parameter substitution.

This is the simplest solution I’ve been able to come up with is:

object GetLocalizationParameter(string param) {
return “WOOT”;
}

string localizedTitle = LocalizationManager.GetTranslation("OrientationTitle", FixForRTL:false);

LocalizationManager.ApplyLocalizationParams(ref localizedTitle, GetLocalizationParameter, true);
if (LocalizationManager.IsRight2Left) {
localizedTitle = LocalizationManager.ApplyRTLfix(localizedTitle);
}

superTextMeshTitle.text = "<c=header><f=arabic_body>“ + localizedTitle;

Given how elegant everything else has been, it feels like I’m doing something wrong here. I didn’t have any luck with a LocalizationParamsManager - it updated in the editor and debugger, but the changes never propagated to the Super Text Mesh objects.

Thanks in advance for any help you can provide.

-ch

Please Log in or Create an account to join the conversation.

Time to create page: 0.128 seconds
Template by JoomlaShine