WordPress.org

Support

Support » Plugins and Hacks » [Plugin: Transposh – translation filter for wordpress] translate in iframe?

[Plugin: Transposh – translation filter for wordpress] translate in iframe?

Viewing 15 replies - 1 through 15 (of 15 total)
  • Plugin Author Ofer Wald

    @oferwald

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

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

    Plugin Author Ofer Wald

    @oferwald

    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

    Plugin Author Ofer Wald

    @oferwald

    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

    I will try it, thanks for the help!

    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

    Plugin Author Ofer Wald

    @oferwald

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

    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.

    Plugin Author Ofer Wald

    @oferwald

    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

    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.

    Plugin Author Ofer Wald

    @oferwald

    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

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

    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.

    Plugin Author Ofer Wald

    @oferwald

    Hi,

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

Viewing 15 replies - 1 through 15 (of 15 total)
  • The topic ‘[Plugin: Transposh – translation filter for wordpress] translate in iframe?’ is closed to new replies.