>However when I try to use the same technique with drop-downs
Dropdown is not an input field. Please, describe more what you mean. Those “id” work on <input> and <textarea> only.
>when I add a comma delimited
Yes, the default separator is space, it is ok.
Thanks John,
cmb2 (and other custom field methods like ACF) allow you to create a select (dropdown) as a way to describe a meta value.
Currently if I switch the selection on English, it also switches it on other languages, I’m trying to find a way to keep them separate, as they are for text inputs and textareas (when used in conjunction with their ids).
These selects all have ids. And would look something like this.
<select class="cmb2_select" name="drink_ingredients[0][units]" id="drink_ingredients_0_units">
<option value="taste" >To Taste</option>
<option value="shot" >Shot</option>
<option value="shots" >Shots</option>
<option value="pint" >Pint</option>
<option value="pints" >Pints</option>
<option value="floz" >Ounces</option>
<option value="Lt" >Liter</option>
<option value="" >No Unit</option>
</select>
Do you mean that you wish to have
<option value="taste" >[:en]To Taste[:fr]French text[:]</option>
and LSB will show one of the texts? This is “‘encode’:’display'” in the new integration capabilities: https://qtranslatexteam.wordpress.com/integration/ (latest version on GitHub).
Alternatively, it can be done with a plugin, example of a plugin which makes <option> translatable is WooCommerce & qTranslate-X.
Currently if I switch the selection on English, it also switches it on other languages
I am not quite sure what is meant here. Is ‘switch’ meant pressing on LSB or switch admin language, or frontend language? ‘also switches’ where? input fields, frontend, admin side?
Please, give steps instructions to reproduce, unless you figure it out from the draft of Integration Guide.
What I meant by switching, was in the admin screen. My original thought was to supply both the English and the French options in the select. In that scenario I would want to be able to choose different options on the English admin post page as opposed to when I switch to French.
However I’m going to try to use the custom-config.json file approach described in the custom integration guide to integrating cmb2 into my theme. I’ll need to review those docs further as the structure of the json file is not totally clear to me yet.
I just realized that to add configuration files I need to use the “Configuration Files” not “Custom Configuration” option.
Do you mean that you wish to have
<option value=”taste” >[:en]To Taste[:fr]French text[:]</option>
and LSB will show one of the texts? This is “‘encode’:’display'” in the new integration capabilities: https://qtranslatexteam.wordpress.com/integration/ (latest version on GitHub).
Thanks, I found that putting [:en]To Taste[:fr]French text[:]
in the post-type array used for the select was all that was required to have the proper translations show up on the front end.
In this custom case the backend is only required in one language so there was really no need to integrate any further.