Installing 2.6.4 a1 for use with UnityScript

  • pedrevans
  • Topic Author
  • Visitor
  • Visitor
8 years 10 months ago #1221 by pedrevans
With the new version only some very small tweaks are needed to make it work with UnityScript AKA JavaScript.

1. move Assets/I2 to Assets/Plugins/I2

2. Apply the following diff (left is working, right is as installed from Asset Store) (UnityScript doesn't handle the default function arguments)
diff -r Assets/Plugins/I2/Localization/Scripts/LocalizationManager.cs ../I2Test/Assets/I2/Localization/Scripts/LocalizationManager.cs
119,127c119
< 		public static string GetTermTranslation (string Term)
< 		{
< 			return GetTermTranslation (Term, false, 0);
< 		}
< 		public static string GetTermTranslation (string Term, bool FixForRTL)
< 		{
< 			return GetTermTranslation (Term, FixForRTL, 0);
< 		}
< 		public static string GetTermTranslation (string Term, bool FixForRTL, int maxLineLengthForRTL)
---
> 		public static string GetTermTranslation (string Term, bool FixForRTL = false, int maxLineLengthForRTL = 0)
438c430
< }
---
> }
\ No newline at end of file
diff -r Assets/Plugins/I2/Localization/Scripts/ScriptLocalization.cs ../I2Test/Assets/I2/Localization/Scripts/ScriptLocalization.cs
8,14c8
< 		public static string Get( string Term ) {
< 			return Get( Term, false, 0);
< 		}
< 		public static string Get( string Term, bool FixForRTL ) {
< 			return Get( Term, FixForRTL, 0);
< 		}
< 		public static string Get( string Term, bool FixForRTL, int maxLineLengthForRTL ) { return LocalizationManager.GetTermTranslation(Term, FixForRTL, maxLineLengthForRTL); }
---
> 		public static string Get( string Term, bool FixForRTL = false, int maxLineLengthForRTL = 0 ) { return LocalizationManager.GetTermTranslation(Term, FixForRTL, maxLineLengthForRTL); }
16c10
< }
---
> }
\ No newline at end of file
Thanks Frank for the brilliant package, I was so pleased to get the App Store internationalization functionality. :)

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

More
8 years 10 months ago #1223 by Frank
Hi,

Thanks for taking the time to adjust the plugin to work with Javascript!!

move Assets/I2 to Assets/Plugins/I2


The plugin its only outside the Plugins folder because it can be integrated with other plugins (TextMeshPro, NGUI, etc) that are not in the plugins folder.

If none of those third party plugins are used (e.g. only using the new Unity UI and other standard components) then its safe to move I2L into the plugins folder!

UnityScript doesn't handle the default function arguments


Great about those changes! I'm integrating them into 2.6.4 b2 and also found a couple other places using default parameters, so I'm modifying those as well.
Hope that helps you upgrade to future versions without problems.

Thanks a lot!
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

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

  • pedrevans
  • Topic Author
  • Visitor
  • Visitor
8 years 10 months ago #1224 by pedrevans
Replied by pedrevans on topic Installing 2.6.4 a1 for use with UnityScript
Thanks for the response and the tip about the other plugins. As I was using only standard stuff I wasn't aware of that.

Glad to be of help :)

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

Time to create page: 0.166 seconds
Template by JoomlaShine