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

    (@oferwald)

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

    Thread Starter deepbevel

    (@deepbevel)

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

    Plugin Author oferwald

    (@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

    Thread Starter deepbevel

    (@deepbevel)

    Plugin Author oferwald

    (@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

    Thread Starter deepbevel

    (@deepbevel)

    I will try it, thanks for the help!

    Thread Starter deepbevel

    (@deepbevel)

    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 oferwald

    (@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 })

    Thread Starter deepbevel

    (@deepbevel)

    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 oferwald

    (@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

    Thread Starter deepbevel

    (@deepbevel)

    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="https://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 oferwald

    (@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

    Thread Starter deepbevel

    (@deepbevel)

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

    Thread Starter deepbevel

    (@deepbevel)

    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 oferwald

    (@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.