SOLVED: Google Translate Script Causes Special Characters?

This forum is for all Flare issues related to the HTML5, WebHelp, WebHelp Plus, and Adobe Air Targets
Post Reply
techwriter31
Propellus Maximus
Posts: 551
Joined: Wed Mar 05, 2008 10:50 am

SOLVED: Google Translate Script Causes Special Characters?

Post by techwriter31 »

As a Technical Writer who also manages translations, let me start this off by acknowledging the fact that Google Translate translation quality is most likely not the best.

That said, I recently started testing the Google Translate script mentioned in the post below, and added it to the master page for a Webhelp Plus output.
http://forums.madcapsoftware.com/viewto ... te+#p84414

I also have a copyright variable on the master page, directly above the Google Translate toolbar. The Webhelp Plus Output is published to an IIS website hosted on an internal server. When I first connect to the website using IE 9.0, the copyright variable looks correct, even if I refresh or close/reopen the browser. But as soon as I navigate to another topic, the copyright variable displays "special characters".

For example:
Copyright © 2012 vs. Copyright © 2012

I looked at the source code the first time I launch, and this is how it appears:

Code: Select all

        <p style="text-align: center;"><span class="CopyrightCopyright">Copyright © 2012</span>  XYZ Corporation. All Rights Reserved.</p>
But if I click on a different topic, the source code appears as:

Code: Select all

        <p style="text-align: center;"><span class="CopyrightCopyright">Copyright © 2012</span>  XYZ Corporation. All Rights Reserved.</p>
I know NOTHING about Java script...could Google Translate script be causing this?

I inserted the following within the <head> tags in the master page:

Code: Select all

        <meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE">
        </meta>
        <script type="text/javascript">/*<![CDATA[*/ var _gaq = _gaq || [];
			_gaq.push(['_setAccount', 'UA-xxxxxxxxx-1']);
			_gaq.push(['_setDomainName', 'domainname']);
			_gaq.push(['_trackPageview']);

			(function() {
			var ga = document.createElement('script'); ga.type = 'text/javascript'; ga.async = true;
			ga.src = ('https:' == document.location.protocol ? 'https://ssl' : 'http://www') + '.google-analytics.com/ga.js';
			var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(ga, s);
		})();/*]]>*/</script>
And then inserted the following code below the Copyright variable.

Code: Select all

        <div id="google_translate_element">
        </div>
        <script>
			function googleTranslateElementInit() {
			new google.translate.TranslateElement({
			pageLanguage: 'en'
			}, 'google_translate_element');
			}
		</script>
        <script src="http://translate.google.com/translate_a/element.js?cb=googleTranslateElementInit">
        </script>
Any help is greatly appreciated!
Last edited by techwriter31 on Fri Sep 12, 2014 4:17 pm, edited 1 time in total.
Kellie
techwriter31
Propellus Maximus
Posts: 551
Joined: Wed Mar 05, 2008 10:50 am

SOLVED: Google Translate Script Causes Special Characters?

Post by techwriter31 »

Finally got back around to looking at this, and figured out the problem.

In the Master Page, I replaced:

Code: Select all

<meta http-equiv="X-UA-Compatible" content="IE=9; IE=8; IE=7; IE=EDGE"></meta>
With:

Code: Select all

<meta http-equiv="Content-Type" content="text/html; charset=UTF-8"</meta>
Kellie
Bostonjoe
Jr. Propeller Head
Posts: 1
Joined: Thu Dec 20, 2012 2:23 am

Re: SOLVED: Google Translate Script Causes Special Characters?

Post by Bostonjoe »

As new content loads in Google Reader, some blocked ads take up a large amount of space for about 1 second before disappearing. Can this be done faster?
janifier kim
Jr. Propeller Head
Posts: 1
Joined: Thu Jan 03, 2013 2:40 am

Re: SOLVED: Google Translate Script Causes Special Characters?

Post by janifier kim »

When can we expect PHP 5.4 support?
LTinker68
Master Propellus Maximus
Posts: 7247
Joined: Thu Feb 16, 2006 9:38 pm

Re: SOLVED: Google Translate Script Causes Special Characters?

Post by LTinker68 »

janifier kim wrote:When can we expect PHP 5.4 support?
This is a peer-to-peer forum, so we end users have no idea when features will be added/upgraded to Flare. I suggest contacting support or a sales rep directly.
Image

Lisa
Eagles may soar, but weasels aren't sucked into jet engines.
Warning! Loose nut behind the keyboard.
perhanna
Jr. Propeller Head
Posts: 1
Joined: Sat Jan 26, 2013 1:45 am

Re: SOLVED: Google Translate Script Causes Special Characters?

Post by perhanna »

But how it resolved to make better result??
techwriter31
Propellus Maximus
Posts: 551
Joined: Wed Mar 05, 2008 10:50 am

Re: SOLVED: Google Translate Script Causes Special Characters?

Post by techwriter31 »

perhanna wrote:But how it resolved to make better result??
Hi perhanna,

Previously, the output displayed special characters. But after modifying the master page source code as explained above, the special characters no longer appeared.
Kellie
Post Reply