WordPress.org

Ready to get started?Download WordPress

Forums

Google AJAX Translation - Won't translate! (33 posts)

  1. reviewhostel
    Member
    Posted 5 years ago #

    Hi guys,

    I am having a problem with the plugin, i believe my posts have the correct div tags, but the translation doesn't work. The button is displayed, but when you click a country, nothing happens!

    Please help, the site is here: http://www.Review-Hostel.com

    Thanks!

  2. monodistortion
    Member
    Posted 5 years ago #

    Sorry for the slow reply. You had a different tag on this post so I didn't see it.

    The theme you're using called schemermag doesn't have the right divs for the translate plugin to see.

    The index.php page won't show the Translate button of course but you can fix the single.php and page.php files. They are both the same.

    From line 9 change:

    	<?php if (have_posts()) : the_post(); ?>
    		<h2><?php the_title(); ?></h2>
    		<div class="content"><?php the_content(); ?></div>
    	<?php else: ?>
    

    to this:

    	<?php if (have_posts()) : the_post(); ?>
    	<div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    		<h2><?php the_title(); ?></h2>
    		<div class="content"><?php the_content(); ?></div>
    	</div>
    	<?php else: ?>
    

    You can do this with a text editor or even from the Administration Panel under Appearance > Editor.

    That's it! Let me know if you have any other questions.

  3. Sheche
    Member
    Posted 5 years ago #

    monodistortion
    I have the same problem as "reviewhostel" but couldn't solve it with what you just posted. Can you help me? I really need this plugin to work since my blog is bilingual.

    THANKS A LOT IN ADVANCE!

  4. Sheche
    Member
    Posted 5 years ago #

    Forgot to post my blog URL
    http://www.sheche.net

    :)

  5. monodistortion
    Member
    Posted 5 years ago #

    Hi Sheche,
    I can see that your theme doesn't have div's with the right id's for the plugin to see. It looks like you're using a theme called "premium_blogger". If I can see the code for the theme it's easier to tell you what to change. Did you download this theme from somewhere?

  6. Sheche
    Member
    Posted 5 years ago #

    Yes, I download it from here:
    http://www.sha.tc/info-tech/wordpress/melayu-boleh-wordpress-theme-2

    I did some minor tweaks but everything is pretty much intact. THANKS FOR YOUR FAST RESPONSE!

  7. monodistortion
    Member
    Posted 5 years ago #

    Ok, I looked at the melayu-boleh-theme and it should be pretty straight forward. If you're familiar with the default (Kubrick) theme it needs a div in The Loop that has the id of each post. You'll need to edit the files index.php, single.php, and page.php.

    The changes for index.php and single.php are the same. After the while statement but before the div insert one more div like this:

    <?php while (have_posts()) : the_post(); ?>
    
    <div <?php post_class() ?> id="post-<?php the_ID(); ?>">
    
    <div class="box4">
    

    Then that div gets closed before the endwhile statement like this:

    </div>
    <?php endwhile; ?>
    

    The page.php file is almost the same too. Insert a new div after the while statement:

    <?php while (have_posts()) : the_post(); ?>
    
    <div class="post" id="post-<?php the_ID(); ?>">
    
    <div class="box4">
    

    And then close it before the endwhile statement:

    </div>
    <?php endwhile; ?>
    
  8. Sheche
    Member
    Posted 5 years ago #

    That solves it! THANK YOU SO MUCH FOR YOUR HELP!
    You're awesome :)

  9. monodistortion
    Member
    Posted 5 years ago #

    Sheche,
    I looked at your blog again. It looks like the translation is working ok except for the single.php pages if you click on the title of a blog post. You may have made a mistake editing that file.

  10. Sheche
    Member
    Posted 5 years ago #

    I just saw that, yes...

    Parse error: syntax error, unexpected T_ENDWHILE in .../public_html/wp-content/themes/premium_blogger/single.php on line 44

    This is what's on line 44

    <?php endwhile; ?>

    I don't know what the problem is. I did exactly what you said (and I did it twice, to be sure). It worked on the other files... Any advice?

  11. thenewhustle
    Member
    Posted 5 years ago #

    Hey Mono:

    Me again :) - translation was working beautifully until I upgraded to the latest plugin - still have the div tags where they are supposed to be - but it doesn't translate for me again, I click the language and it does nothing. http://www.thenewhustle.net

    Any ideas? thanks for being SO helpful on this forum, means the world.

    G

  12. thenewhustle
    Member
    Posted 5 years ago #

    Also - it works on my single blog pages, but not on my index page - and the code for both is the same, so weird.

  13. Sheche
    Member
    Posted 5 years ago #

    Im waiting for your response Monodistortion
    Please don't leave me hanging :(

  14. monodistortion
    Member
    Posted 5 years ago #

    Sheche,
    It hard to say exactly what the problem is with your single.php file without seeing it.

    The original melayu-boleh single.php file I have has a while loop from line 7 to 24. It sounds like something you changed messed up that loop. What do you use to edit your php files?

    I can look at your file if you put it on yousendit or somewhere I can see it.

  15. monodistortion
    Member
    Posted 5 years ago #

    thenewhustle,

    I don't see any problem on your site. The front page doesn't use index.php and I don't see a page that does.

  16. reviewhostel
    Member
    Posted 5 years ago #

    Works great - thankyou!

  17. reviewhostel
    Member
    Posted 5 years ago #

    One more thing - can the translate button be moved to the top of the post? From a user side, this is much better I think.

  18. thenewhustle
    Member
    Posted 5 years ago #

    Mono:

    So it's working for you? Maybe a browser problem on my end then? two different computers I use have the same issue: I click the flag/text and nothing happens?

    Please confirm this for me? thanks so much again fory our time and effort to help us non-coders :)

    G

  19. thenewhustle
    Member
    Posted 5 years ago #

    When I go to thenewhustle.net and/or any single blog post page it won't translate for me - but if I click on a static page made (in my nav) those do get translated - same code all around for index.php, single.php and page.php - that's why I'm confused?

    G

  20. monodistortion
    Member
    Posted 5 years ago #

    Reviewhostel,

    There are instructions for putting the button at the top of a post here:
    http://wordpress.org/support/topic/284499?replies=8
    Read the last post about moving it for version 0.4.5

  21. monodistortion
    Member
    Posted 5 years ago #

    Thenewhustle,

    I think this is your problem. There is some JavaScript from http://www.assoc-amazon.com here:
    http://www.assoc-amazon.com/s/link-enhancer?tag=thenewhus-20&o=1
    This loads four more JavaScript files including this one here:
    http://z-ecx.images-amazon.com/images/G/01/nav2/gamma/amazonJQ/amazonJQ-combined-core-20620._V223529337_.js
    This JavaScript includes jquery version 1.2.6. My plugin uses the jquery library from WordPress, version 1.3.2. These two different versions of jquery don't work together.

    WordPress 2.7 did use jquery 1.2.6 but any current WordPress plugin will normally ask WordPress to enqueue the built-in version. We could disable enqueuing jquery but then the plugin wouldn't work on your pages without the amazon JavaScript.

  22. thenewhustle
    Member
    Posted 5 years ago #

    Holy CRAP you are amazing :)

    While the javascript is nice, I can live without it for the sake of translation, giving it a try now - and it WORKS!

    Thanks soooooooooo much (spent hours trying to work it out) - is there anyway I can give you positive feedback or something on this forum? You're amazing.

    G

  23. Sheche
    Member
    Posted 5 years ago #

    Sheche,
    It hard to say exactly what the problem is with your single.php file without seeing it.

    The original melayu-boleh single.php file I have has a while loop from line 7 to 24. It sounds like something you changed messed up that loop. What do you use to edit your php files?

    I can look at your file if you put it on yousendit or somewhere I can see it.

    I actually took the original single.php and added the code and it works now. I guess I mess it up on some previews editing. THANKS AGAIN!

  24. CarlitoErgoSUM
    Member
    Posted 4 years ago #

    Hi,

    There are some real cracks reading this forum, so I am going to dare this question: On two sites I am maintaining, I can see translator buttons, but they do not function. I am unable to find the proper lines to adjust in the code for page.php and single.php. Maybe someone could help me out?

    The addresses: http://www.akinginghana.com and http://www.royalconsultinggroup.org .

    Any help would be greatly appreciated. Thanks in advance and my apologies if I asked a silly question.

    Cheers,

    Carlo

  25. monodistortion
    Member
    Posted 4 years ago #

    Hi Carlo,

    Could you start a new thread for your question?

    It looks like your themes will need to be modified to work with this plugin.

  26. CarlitoErgoSUM
    Member
    Posted 4 years ago #

    Hi,

    Okay, will do, if I decide to keep the themes... Thanks for your answer.

    Cheers,

    Carlo

  27. swingcheese
    Member
    Posted 4 years ago #

    hi,
    as I used your plugin on the sandbox theme it was working like a charm. now, I switched to semiologic pro and it doesn't work anymore.
    my website is here:
    http://www.berlinbalboa.de
    can you imagine which plugin/script causes the conflict?
    best regards from berlin,
    philippe

  28. monodistortion
    Member
    Posted 4 years ago #

    Hi Swingcheese,

    I'm looking at the theme from here:
    http://www.semiologic.com/software/sem-reloaded/

    Could you start a new thread? It's easier to keep track that way.

  29. swingcheese
    Member
    Posted 4 years ago #

    ok, I' ll do it. Thank you

  30. ExpertAdmin
    Member
    Posted 4 years ago #

    Tried to translate my post with your plugin, but can't get it running. i have checked the post before where you mentioned index.php, single.php but it looks different on my theme.
    Would be great if you could help http://schindlwick.com/ea

Topic Closed

This topic has been closed to new replies.

About this Topic