Home › Forums › Backend Issues (wp-admin) › ACF Javascript API – Dynamically Update select2 Field Options › Reply To: ACF Javascript API – Dynamically Update select2 Field Options
I found a “more easy” solution for the translation problem of select 2 without using acf.addAction('select2_init'
.
I changed:
$.fn.select2.amd.define('select2/i18n/xx',[],function () {
to this:
$.fn.select2.amd.define('select2/i18n/' + your-var-array.your-locale-2-char-languange,[],function () {
and now it works perfect by using the acf.__('no results found');
-function and pulling the right translations direct from my plugin mo/po files.
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.