• How to use

    Simply add the class “multilanguage-input” to all the elements which you want to get multilanguage (input-text, textarea). It will make the elements multilanguage, so the information will be saved using the qtranslate structure <!–:en–>Content EN<!–:–><!–:es–>Contenido ES<!–:–>

    The 1st part is easy, just open the target.php, add a new div to the target with class=”multilanguage-input”

    Do not forget to apply the filters [apply_filters(key, content)] before show teh content.

    2nd part, have no clue about it.
    Can anyone help ?

    thanks

    https://www.ads-software.com/extend/plugins/qtranslate-extended/

Viewing 12 replies - 1 through 12 (of 12 total)
  • Thread Starter yashiharu

    (@yashiharu)

    Unbelievable!
    I just made it work. ??

    Original:
    <?php echo $image->alttext; ?>

    2nd part mod like this:
    <?php echo __(html_entity_decode($image->alttext, ENT_NOQUOTES)); ?>

    It’s a good plugin, i hope the author can rewrite the “How to use”

    Plugin Author Fractalia

    (@786pe)

    Hi. Thanks for using this plugin.

    apply_filters function would work for get the correct content, you can see more about this function here

    In your specific case, the better solution would be using <?php echo apply_filters('the_title', $image->alttext); ?>

    Let me tell you that the plugin was initially created for make ngg-gallery multilanguage (and I think you are using it)

    If you have more question, please ask me.

    I’ve noticed that you can use just _e($variable) for showing the current language option from the string that qTranslate saves at the db.

    How worse is that from the options you both mentioned?

    in this specific example would be:
    <?php echo _e($image->alttext); ?>

    I’m using Price-Calc and have the same problem – I mean that i cannot get the Structure text translated.
    Simply add the class "multilanguage-input" to all the elements which you want to get multilanguage (input-text, textarea). It will make the elements multilanguage, so the information will be saved using the qtranslate structure <!--:en-->Content EN<!--:--><!--:es-->Contenido ES<!--:-->
    Could anyone post step-by-step instructions on how to do this?
    Thanks

    Hi,

    I would like to use this plugin to translate basic custom fields of posts, but actually, I don’t understand how it works… When I try to translate custom fields of a post in the backoffice, the same thing is register for all languages.

    Is there someone who can explain where to add the class “multilanguage-input” ? And how to use the filters with custom fields ?

    Thanks very much for your help !

    Yes, please explain this plugin so we can all understand! You guys are amazing but I need another plug-in just to understand what you are on about!
    Thanks,
    K

    Same problem for me … I’m trying to translate CCTM custom fields
    Can somebody explain us ?

    Thanks !

    I tried to put the class multilanguage-input into a text input and the the text input has disappeared. I checked it with firebug and it has a “display:none”. If I remove the class multilanguage-input I can see it again. Any ideas? Thankyou!

    Hi. Where do I have to add the <div> with class=”multilanguage-input”?
    I need traslating slug of Posts and I don’t know in which file of admin I have to enter this code.
    Thanks!

    Hey folks, I’ve been using this plugin and thought I’d a couple of the recurring questions. The way the plugin works is, you have to manually add the class “multilanguage-input” to the text input element. For instance, if your original code/HTML looks like this:

    <div id="some_meta_field_div">
        <label for="some_meta_field_id">My Meta Field</label>
        <input type="text" id="some_meta_field_id" name="some_meta_field" value="" />
    </div>

    Then you would change it to this:

    <div id="some_meta_field_div">
        <label for="some_meta_field_id">My Meta Field</label>
        <input type="text" id="some_meta_field_id" name="some_meta_field" class="multilanguage-input" value="" />
    </div>

    What happens is, AFTER the page is rendered in your browser, a jQuery script looks over your page for any <textarea> or <input> text fields with that class name, and it applies all the magic at that point.

    (That actually causes some problems in a number of advanced cases, like when you’re using it on a field that gets created with Javascript.. but that’s a topic for another day.)

    By the way, I’ve added some cool styling to mine that you guys might appreciate. If it doesn’t work for you.. well, sorry. I’m not getting paid to support someone else’s plugin ?? haha.

    Found somewhere around line 76 of qtranslate-extended.php:

    <style type="text/css">
    			.multilanguage-element{position: relative;}
    
                .multilanguage-inputs{margin-bottom:5px; display:block;}
                .multilanguage-inputs *{display:none;}
                .multilanguage-inputs .current{display:block !important;}
                .multilanguage-flags{
    				padding-top: 2px;
    				display:block;
    				height: 17px;
    				overflow: hidden;
    				position:absolute;
    				top: -19px;
    				right: 1px;
    				background-color:white;
    				border: 1px solid #dfdfdf;
    				border-bottom-color: white;
    			}
                .multilanguage-flags img{margin: 0 3px; opacity:0.4;filter:alpha(opacity=40);cursor:pointer;border:1px solid silver; display: none;}
                .multilanguage-flags img.current{opacity:1 !important;filter:alpha(opacity=100) !important;border:1px solid black !important; display: inline !important; float: right;}
    
    			.multilanguage-element:hover .multilanguage-flags img {
    				display: inline !important;
    			}
    			.multilanguage-element:hover .multilanguage-flags img.current {
    				float: none;
    			}
    
            </style>

    PS — Modifying plugin files directly is generally not recommended. Future updates will almost certainly break your changes (if not your entire site). Use at your own risk!

    Hi there,

    I’m trying to get your plugin running but somehow I hit a wall, I’m calling my meta information as follows:

    <?php $meta = $custom_mb->the_meta();
       echo ($meta['title']);?>

    but somehow I can not get my head around these filters, I tried like everything but still all languages are getting shown, not only the actual one.

    Please give me a push in the right direction!

    Thank you!

    jcbn

    Hi again,

    sorry for having bothered anyone. A night of sleep is mostly where the answer can be found.

    My fix:

    // get the meta data for the current post
                $meta_room = $custom_mb->the_meta();
    
    //and then a few lines further down, nested by some divs:
    
    echo _e($meta_room['title']);

    How easy was that….

    In the process of doing this I had to realize that this plugin does not work with textareas that make use of the wp_editor. I googled around a little, and it seems that right now there seems to be no way to get qtranslate to work with wp_editor customs enabled fields… I hope I’m wrong. I will get back if I find something. If somebody has an idea how to get at this, please share.

    Best,

    J

Viewing 12 replies - 1 through 12 (of 12 total)
  • The topic ‘[Plugin: qTranslate extension] How to use?’ is closed to new replies.