WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] [Plugin: Google AJAX Translation] Translation stops upon reaching SyntaxHighlighter code block (5 posts)

  1. baby_wilson
    Member
    Posted 4 years ago #

    Hi,

    The translator works for the content up until it reaches the first instance of a code block processed by the SyntaxHighlighter plugin.

    Please see: http://brian.dobberteen.com to view an example.

    Any fixes for this?

    Thanks!

    http://wordpress.org/extend/plugins/google-ajax-translation/

  2. monodistortion
    Member
    Posted 4 years ago #

    I looked at your site.

    The problem only shows up on some of your posts and some work fine like this one:
    http://brian.dobberteen.com/code/calling-a-pagemethod-with-jquery/
    but the result is that it translates the code also.

    The problem is somewhere in the jquery translate plugin where it stops for some reason.

    This problem could be fixed by modifying the JavaScript to skip the divs where class="syntaxhighlighter ". The jquery translate plugin has an easy way to do this but it would take some extra work to add an option for the administration panel.

    If you want to experiment try opening the file jquery.translate-1.3.9.min.js and find:

    not:".translate_block"
    

    near the end and change that to:

    not:".translate_block, .syntaxhighlighter"
    
  3. baby_wilson
    Member
    Posted 4 years ago #

    Thanks so much for the guidance! The solution offered worked perfectly!

    Thanks again!

    - baby_wilson
    http://brian.dobberteen.com

  4. natenewz
    Member
    Posted 4 years ago #

    This fix also works for a similiar problem using google-code-prettyify plugin. This may be a good option for the administration control panel.

  5. monodistortion
    Member
    Posted 4 years ago #

    Yes, when I saw this problem I considered adding an administration option for it but it's getting a little advanced and I'm not sure how common this problem is.

    For you I think you can change that part to:

    not:".translate_block, pre"
    

Topic Closed

This topic has been closed to new replies.

About this Topic