Forums

[resolved] [Plugin: Google AJAX Translation] Warning: array_search(): Wrong datatype for second argument (11 posts)

  1. eichner
    Member
    Posted 2 years ago #

    Folks,

    I really like the translation plugin (0.4.0), and I have tried to install it in both WP 2.7.1 and WPMU 2.7.1 with the same result:
    1. When I activate the plugin I get the message: Warning: array_search(): Wrong datatype for second argument in /hsphere/local/home/eichner/eichner.dk/wpmu/wp-content/plugins/google-ajax-translation/ajaxtranslation.php on line 253
    2. when I go to settings for activation, I get the message again, plus "Error! Options page not found."

    I have disabled all other plugins and my web hotel is running PHP 4.4.7.

    Could you please help me ?

    Jørn Eichner, Denmark.

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

  2. monodistortion
    Member
    Posted 2 years ago #

    Hi Jørn,
    Sorry about that bug. The plugin was working fine if the options were already stored in the WordPress options database but it was not working right when it was first activated.

    If you saved the options once it would fix this problem.

    This is fixed in version 0.4.1.

    I'm not sure if it works in WordPress MU since I've never tried it and I haven't read up on WordPress MU yet. Let me know if there are problems though.

  3. eichner
    Member
    Posted 2 years ago #

    Thanks Nick,
    Seems that you have solved the line 253 error.
    On the WP 2.7.1 the options save ok, and the [translate] link appears below the posts, but there seems to be a problem with the pop-up window (both for texts and flags) which is not shown correctly (it is not possible to select another language) with the theme I use (Its a Artisteer 2 produced theme). However I also tried with the standard theme and here everything is fine. You can have a look at here to see the result.

    On the WPMU I still get the "Options page not found" error after pressing save in settings, so I'll guess it must be something different in the WPMU 2.7.1 implementation. It is not possible to enable any languages at all so I'll guess the options is not saved.

    Unfortunately I'm pretty new to WordPress and debugging techniques so I'm not sure I can find out whats going on, but I will give it a try.

    But I will mark this as resolved, because its works now with WP 2.7.1 and standard theme.

    Thanks,
    Jørn

  4. eichner
    Member
    Posted 2 years ago #

    Oh, I forgot to mention that the swedish flag looks odd - normally the swedish flag is a yellow cross on blue (as the danish is a white cross on red).

    Jørn

  5. eichner
    Member
    Posted 2 years ago #

    Nick, have googled around for the Options page not found, and found this:
    http://wordpress.org/support/topic/230231?replies=2

    Then I looked through your php code and found no register_setting calls - looks like it's something new for 2.7. I could be wrong but maybe WPMU is more strict than WP.

    Jørn

  6. monodistortion
    Member
    Posted 2 years ago #

    Sorry for the delay.

    The Swedish flag was an easy fix. That must have shown up because the Swedish language code is 'sv' which is the country code for El Salvador.

    It looks like my last fix introduced a new bug so I'm still working on that and looking into the other problems.

    It looks like your theme will have to be updated to work with this plugin. For this plugin to work each post needs to be surrounded by a div with an id="post-#" where # is the unique number for that post.

  7. monodistortion
    Member
    Posted 2 years ago #

    I've been working on this all day for over 12 hours or so and I think it should all work in version 0.4.2. I have to pack and catch a plane in a couple hours so if it doesn't it will have to wait!

    The documentation for the new functions in WordPress 2.7 is really poor, without any examples, so it takes a long time to wade through all the code figuring things out. I'll have to try to update the Codex when I have more time.

    I can't say if it works with WordPress MU tough since I haven't tried it.

  8. eichner
    Member
    Posted 2 years ago #

    Nick,
    this is fantastic - I must complement you for your work on this. I'm sorry you had to struggle with bad documentation.

    I have tested on both WP and WPMU, and and 0.4.2 definitely seem
    s to work using standard template themes.
    I like your new settings GUI with languages in 3 columns.

    I have a few suggestions you can take into consideration for the future:
    1. an option to list both flag and language name in the translate popup menu (change radio buttons to check boxes).
    2. an option to enable/disable all language check boxes at once.

    Jørn

  9. deborahkekone
    Member
    Posted 2 years ago #

    Love the plug in, but it’s not allowing for translation when pages are accessed through the sidebar categories. It shows the entire list of languages it could be translated into as part of the blog entry. How do I fix this?

  10. monodistortion
    Member
    Posted 2 years ago #

    deborahkekone,
    Can you start a new thread?
    Also, please post a link or screenshot of your problem if you can.

  11. simonnicol
    Member
    Posted 2 years ago #

    Excellent work on the plugin Nick.

    I'm have trouble though using it with an Artisteer template (everything works perfectly with the default 'Kubrick' template so it's not your plugin!)

    I've noticed quite a few people experiencing the same problem, but having your translation module is worth the trouble. I'll have a go at finding a solution to the Artisteer problem, but I think the solution might be a bit too much to post here so I will put it on my blog here:

    http://www.caspianit.co.uk/google-ajax-translation-not-working/

Topic Closed

This topic has been closed to new replies.

About this Topic