Remove unncessary translate code in base.html; comment translation still functions.

This commit is contained in:
Ross Poulton 2014-01-29 22:55:06 +11:00
parent fd9881e6e0
commit 0e58c99f69

View File

@ -11,9 +11,6 @@
<script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
<script src='{{ STATIC_URL }}helpdesk/jquery-ui-1.8.9.custom.min.js' type='text/javascript' language='javascript'></script>
{% comment %}
<script src='{{ STATIC_URL }}helpdesk/jquery.translate-debug-all.js' type='text/javascript' language='javascript'></script>
{% endcomment %}
<link rel='stylesheet' href='{{ STATIC_URL }}helpdesk/helpdesk-extend.css' type='text/css' media="screen" >
<!--link rel='stylesheet' href='{{ STATIC_URL }}helpdesk/helpdesk-print.css' type='text/css' media="print" /-->
@ -24,55 +21,6 @@
<link rel='alternate' href='{% url 'helpdesk_rss_activity' %}' type='application/rss+xml' title='{% trans "All Recent Activity" %}' />
<link rel='alternate' href='{% url 'helpdesk_rss_unassigned' %}' type='application/rss+xml' title='{% trans "Unassigned Tickets" %}' />
{% comment %}
<script type="text/javascript">
$(document).ready(function(){
// replace display while hovering over menu item
$('li.headerlink').hover(
function() { $('ul', this).css('display', 'block'); },
function() { $('ul', this).css('display', 'none'); });
{% if helpdesk_settings.HELPDESK_TRANSLATE_TICKET_COMMENTS %}
// add translate functionality - google translate V1 is deprecated
$.translate.load(bingID);
$.translate(function(){ //when the Language API is loaded
$.translate().ui({
tags: ["select", "option"],
// a function that filters the languages:
{% if helpdesk_settings.HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG %}
filter: {{ helpdesk_settings.HELPDESK_TRANSLATE_TICKET_COMMENTS_LANG|safe }},
{% else %}
// all languages
filter: $.translate.isTranslatable,
{% endif %}
//a function that returns the text to display based on the language code:
label: $.translate.toNativeLanguage ||
function(langCode, lang){
return $.translate.capitalize(lang);
},
// whether to include the UNKNOWN:"" along with the languages:
includeUnknown: false,
})
.click(function(){ // when selecting a language - 'change' is not enough, because your first language in the menu might be your target language
$('#translate_block').translate( '', $(this).val(), { // translate from current language to the selected language
not: '.option, select, pre, .translate_dropdown', // exclude these elements
fromOriginal: true, // always translate from original version (even after the page has been translated)
async: true, // this prevents the browser from freezing on larger sites by executing each DOM filtering iteration with a delay
toggle: true, // all translation will be cached (stored with $.data) and used if it's found, or translated to otherwise
walk: true // finds elements having textnodes and translates only their content; on very large and complex pages this might take some time
})
})
.appendTo('#translate_dropdown'); // insert the dropdown menu to the page
});
{% endif %}
});
</script>
{% endcomment %}
<style type="text/css">
/* hide google translate top bar */
.goog-te-banner-frame {display: none !important;}