WordPress.org

Ready to get started?Download WordPress

Forums

xLanguage
Editor tools broken (6 posts)

  1. Larcha
    Member
    Posted 2 years ago #

    In the post/side editor the language button tools adds tags <del> ... </del> to sorround the selected text instead of the language tags e.g. <span lang="sv"> ... </span>

    http://wordpress.org/extend/plugins/xlanguage/

  2. michele.bartolettistella
    Member
    Posted 2 years ago #

    I've the same problem, and it seems that no one has solved it yet. And it's a pity, because xLanguage really is very useful.

    Waiting for some help...

  3. Nekomukuro
    Member
    Posted 2 years ago #

    Okay, I wanted to use this plugin for a site and had the same problem, so I went to do a bit of debugging of the scripts and I found the cause and I think got it working (at least so it seems).

    The plugin adds the new functions to the TinyMCE editor so that when you press the apply language button it does a few transformations of the text by first striking it through using <strike> and then retransforming it back to <span lang="it"> (I haven't understood much the logic in the process, but I saw what it does more or less).
    The problem is that when it applies the strike to the newly selected text, it uses the execCommand('Strikethrough') instruction, which does NOT add a <strike> tag, but it adds a <del> tag instead. Since the script looks for "STRIKE", it cannot find it and the text won't get correctly tagged.

    To fix this I opened the js/tinymce-plugin.js inside the plugin directory with a text editor and did a search/replace, replacing all occurrences of STRIKE with DEL.
    It seems to be working after doing this. I haven't tested that much though, and also, I replaced case sensitive at the moment but I don't know if it's enough. I haven't encountered troubles so far but if you do try replacing lowercase as well.
    Hope it helps others.

  4. michele.bartolettistella
    Member
    Posted 2 years ago #

    I have tested your suggestions just now. All seems to work, with the exception of the "Clear the language of the selected text" button, near to the other xLanguage buttons on the TinyMCE. This would be another useful function to be able to use...

    I will wait for news. Till now, thank you.

  5. michele.bartolettistella
    Member
    Posted 2 years ago #

    I found another solution for this problem. It's described on:

    http://levbarkov.ru/lang/en/xlanguage_problem/

    That seems to be more elegant, but I didn't check if it works.

  6. pdavenne
    Member
    Posted 2 years ago #

    It works, and it just saved my sanity :)

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags