Sentences converting to lowercase

More
7 years 11 months ago #1367 by SoftwareLogicAU
If I convert anything which contains an uppercase word after a lowercase word it converts the entire text to lowercase.
A simple example is:
This is bob (works fine - upper and lower correct)
This is Bob (all lowercase)

I am actually trying to translate this:
Can you survive the swarms? Blast your way through 13 beautiful planets and deliver Zamit to his homeworld.

Is there a workaround to fix this issue? I am using the Language Source rather than spreadsheets (see attachment).

Thanks for any assistance.
Attachments:

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

More
7 years 11 months ago #1368 by Frank
Hi,

A few months ago, there was an issue with google translation not understanding correctly the texts that had mixed cases. To work around that problem, I started converting all texts to lowercase, have them translated by google, and then convert the resulting translation to match the original text.
The plugin is able to detect when a sentence is: lowercase, UPPERCASE, "Title Case" or "First letter uppercase", but it fallbacks to lowercase when it can't find a match.

I have been testing if the original issue with google is still present but haven't been able to reproduce it, so most likely it was fixed. Therefore, I can remove the lowercase translation workaround. I will be adding the fix to 2.6.5 f3.

In the meantime, you could replace the GetTranslationWWW function in the file GoogleTranslation.cs with the following one to make it work as expected.
		public static WWW GetTranslationWWW(  string text, string LanguageCodeFrom, string LanguageCodeTo )
		{
			LanguageCodeFrom = GoogleLanguages.GetGoogleLanguageCode(LanguageCodeFrom);
			LanguageCodeTo = GoogleLanguages.GetGoogleLanguageCode(LanguageCodeTo);

			string url = string.Format ("http://www.google.com/translate_t?hl=en&vi=c&ie=UTF8&oe=UTF8&submit=Translate&langpair={0}|{1}&text={2}", LanguageCodeFrom, LanguageCodeTo, Uri.EscapeUriString( text ));
			WWW www = new WWW(url);
			return www;
		}

More about this:
I have been working on a new way of doing Translations. Currently, the plugin contacts the translate.google.com web and then parses the result to get the translation. However, that fails whenever google changes their appearance and also it is kind of slow.

In the beta folder, you can find version 2.6.5 f2 which uses a new way of translating by using the WebService. That is faster and allows me to do bulk translations.

That version uses that approach for doing individual translations, but I'm implementing the "Translate All" for translating all terms in a language, That bulk translation should be released in 2.6.5 f3.

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.144 seconds
Template by JoomlaShine