Title: Integration-CMB2-qTranslate
Author: jmarceli
Published: <strong>29. rujna 2015.</strong>
Last modified: 16. travnja 2016.

---

Pretraga dodataka

Dodatak **nije testiran s zadnje 3 glavna izdanja WordPressa**. Možda ga se više
ne održava ili pruža podršku i možda ima probleme sa kompatibilnošću s novijim inačicama
WordPressa.

![](https://s.w.org/plugins/geopattern-icon/integration-cmb2-qtranslate.svg)

# Integration-CMB2-qTranslate

 Od [jmarceli](https://profiles.wordpress.org/jmarceli/)

[Preuzmi](https://downloads.wordpress.org/plugin/integration-cmb2-qtranslate.0.1.1.zip)

 * [Detalji](https://hr.wordpress.org/plugins/integration-cmb2-qtranslate/#description)
 * [Recenzije](https://hr.wordpress.org/plugins/integration-cmb2-qtranslate/#reviews)
 *  [Instalacija](https://hr.wordpress.org/plugins/integration-cmb2-qtranslate/#installation)
 * [Razvoj](https://hr.wordpress.org/plugins/integration-cmb2-qtranslate/#developers)

 [Podrška](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/)

## Opis

CMB2-qTranslate is WordPress plugin for CMB2 and qTranslate X integration. Adds 
language switch buttons above selected CMB2 fields to make content translatable.

For updated docs please refer to the Github project page [https://github.com/jmarceli/integration-cmb2-qtranslate](https://github.com/jmarceli/integration-cmb2-qtranslate).

**Supported CMB2 field types:**

 * input
 * textarea
 * wysiwyg
 * repeatable field groups

In order to make field translatable add `.cmb2-qtranslate` class to it. For non-
WYSIWYG fields you may prefer to use `data-cmb2-qtranslate` which is also supported(
since 0.0.3 version).

**Usage example**

**WYSIWYG field:**

    ```
    > $field1 = $cmb_demo2->add_field( array(
    >   'name' => __( 'SECOND Text', $this->plugin_slug ),
    >   'desc' => __( 'field description (optional)', $this->plugin_slug ),
    >   'id' => $prefix . $this->plugin_slug . '_second_text',
    >   'class' => 'cmb2',
    >   'type' => 'wysiwyg',
    >   'options' => array(
    >     'editor_class' => 'cmb2-qtranslate'
    >   )
    > ) );
    ```

**Other fields:**

    ```
    > $field2 = $cmb_demo->add_field( array(
    >   'name' => __( 'Text Small', $this->plugin_slug ),
    >   'desc' => __( 'field description (optional)', $this->plugin_slug ),
    >   'id' => $prefix . $this->plugin_slug . '_textsmall',
    >   'class' => 'cmb2',
    >   'type' => 'text',
    >   'attributes' => array(
    >     'class' => 'cmb2-qtranslate'
    >   )
    > ) );

    > // You may also use data-attributes instead of class to trigger qTranslate for the field
    > // however it is not supported by WYSIWYG field (WordPress limitation)

    > $field2 = $cmb_demo->add_field( array(
    >  'name' => __( 'Text Small', $this->plugin_slug ),
    >  'desc' => __( 'field description (optional)', $this->plugin_slug ),
    >  'id' => $prefix . $this->plugin_slug . '_textsmall',
    >  'class' => 'cmb2',
    >  'type' => 'text',
    >  'attributes' => array(
    >    'data-cmb2-qtranslate' => true
    >  )
    > ) );
    ```

Detailed info about field creation could be found in CMB2 project documentation (
https://github.com/WebDevStudios/CMB2/wiki).

**Usage on custom Theme Options Page:**

See https://github.com/qTranslate-Team/qtranslate-x/wiki/Custom-page-(plugin)-integration

You should define at least one form field in `$admin-config` array to trigger qTranslate
LSB on your custom Theme Options Page. In other case you will end up with not working
LSB. It happens because by default qTranslate is available only on specific pages:
content pages, general options and maybe some others, but not your custom page (
if you will create one).

**Requirements/Dependencies**

 * CMB2 (https://pl.wordpress.org/plugins/cmb2/)
 * qTranslateX (https://pl.wordpress.org/plugins/qtranslate-x/)

**Links**

 * [Github project page](https://github.com/jmarceli/integration-cmb2-qtranslate)

## Instalacija

Install as usual from wordpress.org plugins page

**or**

 1. Download Github repository
 2. Upload the entire `integration_cmb2_qtranslate/` directory to the `/wp-content/
    plugins/` directory.
 3. Activate CMB2-qTranslate through the ‘Plugins’ menu in WordPress.

**or**

 1. Place the `integration_cmb2_qtranslate/` directory inside of your theme or plugin.
 2. Enqueue JavaScript file `dist/scripts/main.js` with `wp_enqueue_script` function

## Pitanja i odgovori

 * none at the moment

## Recenzije

![](https://secure.gravatar.com/avatar/826125a97187d0c1844ddcb3ef5582ad292722bebe00c63276d70666e4fc8b60?
s=60&d=retro&r=g)

### 󠀁[Still works! Just make these modifications.](https://wordpress.org/support/topic/still-works-just-make-these-modifications-2/)󠁿

 [armino](https://profiles.wordpress.org/armino/) 22. travnja 2025.

Great plugin!Still works with latest version of qTranslate-XT. In main.js just comment
this out on line: 55, 56, 57: // var langSwitchWrap = cmb2qtranslate.createSetOfLSB();//
add switch buttons before each multilanguage input// $field.closest(cmb2_field_wrapper_class).
prepend(langSwitchWrap);Then in cmb2-qtranslate.php change the "enqueue_scripts"
function to use that file, instead of the minified one in /dist/ folder: public 
function enqueue_scripts() {wp_enqueue_script( $this->get_plugin_slug() . '-plugin-
script', plugins_url( 'assets/scripts/main.js', __FILE__ ), array( 'jquery' ), self::
VERSION );}

![](https://secure.gravatar.com/avatar/4b65be7ee87d04f0ed618490cf14d7a4b021b982df928ac2d84b8eea499a505a?
s=60&d=retro&r=g)

### 󠀁[Perfect](https://wordpress.org/support/topic/perfect-4481/)󠁿

 [christer_f](https://profiles.wordpress.org/christer_f/) 26. listopada 2017.

Very useful and seems to work perfectly. All my thanks to the developer!

![](https://secure.gravatar.com/avatar/52d5621220a9afcf2b1cfe60038100e195af1b90105d71f6b4382e38c9e27334?
s=60&d=retro&r=g)

### 󠀁[works just fine](https://wordpress.org/support/topic/works-just-fine-90/)󠁿

 [Pedro Carvalho](https://profiles.wordpress.org/pcarvalho/) 11. svibnja 2017.

works just fine with latest wp version. thanks for your effort!

 [ Pročitajte sve 2 recenzije ](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/reviews/)

## Suradnici i Programeri

“Integration-CMB2-qTranslate” je softver otvorenog koda. Sljedeće osobe su doprinijele
ovom dodatku.

Suradnici

 *   [ jmarceli ](https://profiles.wordpress.org/jmarceli/)

[Prevedite “Integration-CMB2-qTranslate” na svoj jezik.](https://translate.wordpress.org/projects/wp-plugins/integration-cmb2-qtranslate)

### Zainteresirani ste za razvoj?

[Pregledajte kôd](https://plugins.trac.wordpress.org/browser/integration-cmb2-qtranslate/),
pogledajte [SVN spremište](https://plugins.svn.wordpress.org/integration-cmb2-qtranslate/)
ili se pretplatite na [dnevnik razvoja](https://plugins.trac.wordpress.org/log/integration-cmb2-qtranslate/)
od [RSS](https://plugins.trac.wordpress.org/log/integration-cmb2-qtranslate/?limit=100&mode=stop_on_copy&format=rss).

## Dnevnik promjena

#### 0.1.0

 * fixed issues (see Github project page)

#### 0.0.4

 * readme update

#### 0.0.3

 * add support for `data-cmb2-qtranslate`

#### 0.0.2

 * readme update

#### 0.0.1

 * first release

## Meta

 *  Version **0.1.1**
 *  Zadnje ažuriranje **prije 11 godina**
 *  Aktivnih instalacija **100+**
 *  WordPress inačica ** 4.0 ili viša **
 *  Testirano do **4.3.34**
 *  Language
 * [English (US)](https://wordpress.org/plugins/integration-cmb2-qtranslate/)
 * Oznake
 * [cmb2](https://hr.wordpress.org/plugins/tags/cmb2/)[integration](https://hr.wordpress.org/plugins/tags/integration/)
   [qtranslate](https://hr.wordpress.org/plugins/tags/qtranslate/)[qtranslatex](https://hr.wordpress.org/plugins/tags/qtranslatex/)
 *  [Napredni pogled](https://hr.wordpress.org/plugins/integration-cmb2-qtranslate/advanced/)

## Ocjena

 5 out of 5 stars.

 *  [  3 5-star reviews     ](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/reviews/?filter=5)
 *  [  0 4-star reviews     ](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/reviews/?filter=4)
 *  [  0 3-star reviews     ](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/reviews/?filter=3)
 *  [  0 2-star reviews     ](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/reviews/?filter=2)
 *  [  0 1-star reviews     ](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/reviews/?filter=1)

[Your review](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/reviews/#new-post)

[See all reviews](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/reviews/)

## Suradnici

 *   [ jmarceli ](https://profiles.wordpress.org/jmarceli/)

## Podrška

Želite nešto reći? Potrebna vam je pomoć?

 [Pregledaj forum za podršku](https://wordpress.org/support/plugin/integration-cmb2-qtranslate/)

## Doniraj

Želite li podržati napredak ovog dodatka?

 [ Donirajte ovom dodatku ](http://grzegorowski.com/)