Translate is changing the case of my text

More
8 years 2 months ago #1807 by cpotter
I have been using the webservice to do translations and it had been working well. I just updated recently and now the translator is changing all of the text to lower case when translated. This is a problem because I don't have a simple way to retype the translation in some languages without setting up multiple keyboards with the special characters for each language.

Is there some way you could add an override that allows me to specify i want an all caps translation?

Thanks,

Craig

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

More
8 years 2 months ago - 8 years 2 months ago #1808 by Frank
Hi,
I just found an issue when the text was ALL in Caps. (Will this be the case you are referring?)

This can be fixed by replacing the function GetTranslationWWW from
Assets\I2\Localization\Scripts\Google\GoogleTranslation.cs

with this one:
		public static WWW GetTranslationWWW(  string text, string LanguageCodeFrom, string LanguageCodeTo )
		{
			LanguageCodeFrom = GoogleLanguages.GetGoogleLanguageCode(LanguageCodeFrom);
			LanguageCodeTo = GoogleLanguages.GetGoogleLanguageCode(LanguageCodeTo);

			// Google has problem translating this "This Is An Example"  but not this "this is an example"
			// so I'm asking google with the lowercase version and then reverting back
			if (TitleCase(text)==text && text.ToUpper()!=text)
				text = text.ToLower();

			string url = string.Format("{0}?action=Translate&list={1}:{2}={3}", LocalizationManager.GetWebServiceURL(), LanguageCodeFrom, LanguageCodeTo, Uri.EscapeUriString( text ));
			//Debug.Log (url);
			WWW www = new WWW(url);
			return www;
		}

I'm going to be uploading today 2.6.8f4 to the beta folder including this fix

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: 8 years 2 months ago by Frank.

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

More
8 years 2 months ago #1811 by cpotter
Hi Frank,

Yes I was having trouble with all caps. Thanks for your quick response very appreciated!

Craig

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

More
8 years 2 months ago #1812 by Frank
BTW, I just uploaded version 2.6.8f4 to the beta folder, which includes that fix.

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

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

More
8 years 2 months ago #1814 by Mogulbasher
I would like to email you to send you the invoice to obtain access to the beta, but I cant find your email address anywhere in your profile. Can you advise please

Many thanks

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

More
8 years 2 months ago #1815 by Frank
Hi,
Instructions to access the beta can be found here: inter-illusion.com/forum/i2-localization...ssing-early-versions

But basically, you just need to send me an email to This email address is being protected from spambots. You need JavaScript enabled to view it. with your unity invoice number and I can grant you access to the beta folder.

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

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

Time to create page: 0.191 seconds
Template by JoomlaShine