WordPress.org

Ready to get started?Download WordPress

Forums

Transposh WordPress Translation
[Plugin: Transposh - translation filter for wordpress] translate in iframe? (16 posts)

  1. deepbevel
    Member
    Posted 3 years ago #

    Just wondering if Transposh can be configured to keep the same language in iframes? I always have to re select the languge for pages on my site in iframes, and the default language setting doesn't seem work in iframes.

    http://wordpress.org/extend/plugins/transposh-translation-filter-for-wordpress/

  2. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    You can try and make sure that iframes are loaded with the appropriate language urls, an example url will be a good start

  3. deepbevel
    Member
    Posted 3 years ago #

    thanks, but is there more on this? not sure I follow.

  4. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    Iframes contain a url, transposh normally modify urls to include language information, this does not happen for iframes yet, although it probably could, so you can either add the code to do that yourself, or send us a link where we'll be able to see your usecase and if we can modify something in the core.

    good luck

  5. deepbevel
    Member
    Posted 3 years ago #

  6. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    Hello

    Add these lines to parser.php

    // for iframes we will rewrite urls if we can
            elseif ($node->tag == 'iframe') {
                $node->src = call_user_func_array($this->url_rewrite_func, array($node->src));
            }

    at the translate tagging function, at the appropriate line

  7. deepbevel
    Member
    Posted 3 years ago #

    I will try it, thanks for the help!

  8. deepbevel
    Member
    Posted 3 years ago #

    I found the function, but I'm afraid I wouldn't know the appropriate line, I tried many possibilities but they all cause the dreaded white page. Is there an existing piece of code in parser.php which should proceed the code you posted?

    thanks

  9. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    try after one of the other elseifs, such as elseif ($node->tag == 'input' && $node->type == 'submit')
    (not directly, but after the block ending with })

  10. deepbevel
    Member
    Posted 3 years ago #

    Thanks, I tried like this

    `// in submit type inputs, we want to translate the value
    elseif ($node->tag == 'input' && $node->type == 'submit') {
    $this->parsetext($node->value);
    }

    // for iframes we will rewrite urls if we can
    elseif ($node->tag == 'iframe') {
    $node->src = call_user_func_array($this->url_rewrite_func, array($node->src));
    logger($node->src);
    } `

    But it's the same result, white page for the whole site.

    Are there any other likely places to try it?

    Sorry, I don't know what's up with the backticks, it's not making the code box. But I tried the code as you described and no go.

  11. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    besides the backticks, your code looks fine, just remove the logger line (see that I removed it from my earlier post)

    It will be checked in soon :) sorry for the inconvenience

  12. deepbevel
    Member
    Posted 3 years ago #

    Okay, the code is working, but I don't think anything changed. it's still the case that when I use,

    <p><iframe name="main" src="http://www.foursticks.net/TravelBlog3000/slider/your-most-recent-trip" width="100%" height="800" </iframe></p>

    the content in the iframe will not inherit the selected languge. This seems odd to me as the user remains logged in while in the iframe, so it's not like a new instance of the page with a new user. You know what I mean? You'd think Transposh would recognizance the user, and so the users selected language as well.

  13. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    Hi,

    The code is not working on your site for some reason, had it worked you would have seen the source of the iframe being changed which apparently does not happen, I suggest you wait for the next version, or try seeing if the code is misplaced. You can also contact me directly via transposh.org and I'll send you a link to see where it actually works.

    Good luck

  14. deepbevel
    Member
    Posted 3 years ago #

    Thanks, I'll disable some plugins and try moving the code.

  15. deepbevel
    Member
    Posted 3 years ago #

    One other thing I don't think I made clear, the links which open the pages in the iframe are in a flash menu. I realize content in the flash menu won't translate, but I never considered that links inside a flash menu may not open pages in a selected language.

  16. Ofer Wald
    Member
    Plugin Author

    Posted 3 years ago #

    Hi,

    Regarding flash, you are correct, although if you have the source code to the flash file you can probably patch in such support

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic