Answer the question
In order to leave comments, you need to log in
How to change data language in Yii2 Select2 widget?
https://github.com/kartik-v/yii2-widget-select2
In the drop-down menu there is a list of countries in English, when you change the language, the list should change, for example, to Russian.
Answer the question
In order to leave comments, you need to log in
The list of countries is content. And the server part should be engaged in the translation of content (no matter what widget you use). Use standard internationalization tools for this.
When you change the language, the page usually reloads and the url changes. This means that the page is re-formed in php, so you just need to submit data to the widget depending on the current language.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question