Less complicated is to use the plugin’s Quicktags and use the Gettext functions to print the content in the site.
[:en]English[:pt]Português
Quicktags docs
Another option is to do just like qTranslate interface does with the post titles:
Create one custom field for each language in your meta box:
qTrans documentation is not consolidated, so analyzing the code can be handy:
http://plugins.svn.wordpress.org/qtranslate/trunk/qtranslate_utils.php
The function qtrans_getSortedLanguages
returns an array with the site languages:
array(
[0] => 'es'
[1] => 'en'
[2] => 'nl'
[3] => 'fr'
[4] => 'de'
)
This can be used to insert jQuery elements that will control the visibility of existing ones. The following is just a prof of concept and has to be adapted as desired.
The result is a checkbox inside the Page Attributes
meta box that will show/hide the button Preview
inside the Publish
metabox.
Code for the previous snapshot:
/**
* Inject jQuery Button to Control Some Element(s) Visibility
*/
add_action( 'admin_footer-post.php', 'wpse_59056_inject_visibility_checkbox' );
function wpse_59056_inject_visibility_checkbox()
{
global $current_screen;
// If not a Page, do nothing
if (
'page' != $current_screen->id
)
return;
?>
<script type="text/javascript">
jQuery(document).ready( function($)
{
// Define the Checkbox
var radioBtn = $('<input type="checkbox" name="rbtnCount" id="rbtnCount" /><label for="rbtnCount"> My Box Visibility</label>');
// Append to the Page Attributes meta box
radioBtn.appendTo('#pageparentdiv .inside');
// Mark it as checked
$('#rbtnCount').attr('checked', true);
// Watch its behavior
$('#rbtnCount').change( function ()
{
// Show/Hide the "Preview" button inside the Publish meta box
if( $(this).is(':checked') )
{
$('#preview-action').show();
}
else
{
$('#preview-action').hide();
}
});
});
</script>
<?php
}
* With the help of StackOverflow Create dynamically radio button in jquery