UPDATE: Google Translate @ UNCG.EDU

64 views
Skip to first unread message

Andrew Marker

unread,
Sep 12, 2012, 12:57:17 PM9/12/12
to uwd...@uncg.edu
Hi all,

The Chancellor's office has requested that we include the Google Translate widget on all pages that are subject to the University Website Requirements.  The easiest way to accomplish this is through the University Website Assets. For those who are leveraging the managed assets through the templates, Wrapper or the WordPress template, provided at the IOC website, there is on action for you. Things to be aware of that are not under our control:
  • When people use this option, it will tweak your layout and not always in good ways.
  • This feature is totally dependent on JavaScript.  When JavaScript is blocked, so is Google Translate.
  • The translation provided by Google Translate may in some cases not be the "best" translation. Hopefully not very many.
 I modified the following files. For those managing their own University assets, updated versions of the files will be available on the IOC website: Website Assets or from subversion @ https://version.uncg.edu/apps/uncg-assets/tags/current-release/.  Please note: Modifications for the address are optional.  I made them because Google Translate eats HTML break tags (<br />).

common.js (code inserted at the bottom)
try {
$('script').last().append('<meta name="google-translate-customization" content="2a9dc37f185c2a04-5b8a07c26cc72150-g88055c3034a40aa0-8" /><script type="text/javascript">function googleTranslateElementInit() {new google.translate.TranslateElement({pageLanguage: "en",layout:google.translate.TranslateElement.FloatPosition.BOTTOM_RIGHT}, "google_translate_element");}</script><script type="text/javascript" src="//translate.google.com/translate_a/element.js?cb=googleTranslateElementInit"></script>'); 
} catch (e) {} 


footer.htm
FROM:
    <!-- Footer Version 1.5.3 -->
    <div id="footer-nav">
      <ul id="navlist-footer">
        <li class="li-box"><a href="http://ioc.uncg.edu/policies/"
          >Web Standards &amp; Policies</a></li>
        <li class="li-box noBorder"><a 
          href="http://spartanalert.uncg.edu/">Emergency Info</a></li>
        <li class="img-connect"><a href="http://connect.uncg.edu/"
          class="noBorder" title="UNCG Connect Social Media Hub" ><img 
          src="/incuncg/images/connect_03.jpg" width="143" height="41" 
          alt="UNCG Connect Social Media Hub" /></a></li>
      </ul>
    </div>
TO:
    <!-- Footer Version 1.6 -->
    <div id="footer-nav">
      <ul id="navlist-footer">
        <li class="li-box"><a href="http://ioc.uncg.edu/policies/"
          >Web Standards &amp; Policies</a></li>
        <li class="li-box noBorder"><a 
          href="http://spartanalert.uncg.edu/">Emergency Info</a></li>
        <li class="img-connect"><a href="http://connect.uncg.edu/"
          class="noBorder" title="UNCG Connect Social Media Hub" ><img 
          src="/incuncg/images/connect_03.jpg" width="143" height="41" 
          alt="UNCG Connect Social Media Hub" /></a></li>
      </ul>
      <div id="google_translate_element"></div>
    </div>


common.css
#footer {
min-height:91px;
}
#footer-left dl {
margin-bottom:10px
}
#footer-left dd {
margin-left:0
}
#footer-nav ul {
height:49px
}
#google_translate_element {
padding-right: 15px;
text-align: right;
}


address.htm (OPTIONAL Modifications)
FROM:
<!-- Address Version 1.5.8 --> <p>The University of North Carolina at Greensboro<br /> <strong>Location</strong> 1400 Spring Garden Street Greensboro, NC 27412<br /> <strong>Mailing Address</strong> PO Box 26170, Greensboro, NC 27402-6170 <br /> <strong>Telephone</strong> 336.334.5000 </p> <p> Copyright &copy; 2012. The University of North Carolina at Greensboro. All rights reserved. </p>
TO:
<!-- Address Version 1.6 -->

    <dl title="University Contact Information">
      <dt>The University of North Carolina at Greensboro</dt>
      <dd><strong>Location</strong> 1400 Spring Garden Street Greensboro, NC 27412</dd>
      <dd><strong>Mailing Address</strong> PO Box 26170, Greensboro, NC 27402-6170</dd>
      <dd><strong>Telephone</strong> 336.334.5000</dd>
    </dl>
    <p> Copyright &copy; 2012. The University of North Carolina at Greensboro. All rights reserved. </p>
Reply all
Reply to author
Forward
0 new messages