The New Way to Build with AI! Introducing ReUI — the developer platform for agentic UI with shadcn/ui
Browse ReUI Pro

Select2 Internationalization


Hello, how are you? I wanted to know how to translate the text 'No results found' from Select2 using Metronic 8.

https://preview.keenthemes.com/html/metronic/docs/forms/select2

Is there an example

$(".js-example-language").select2({
language: "es"
});


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(

Replies (4)

 
Deleted comment
 
Deleted comment
 
Deleted comment

So if I just do this, it will work?

select2: {
styles: [
"{$config.path.node_modules}/select2/dist/css/select2.css",
],
scripts: [
"{$config.path.node_modules}/select2/dist/js/select2.full.js",
"{$config.path.node_modules}/select2/dist/js/i18n/es.js",
"{$config.path.node_modules}/select2/dist/js/i18n/pt-BR.js",
"{$config.path.common_src}/js/vendors/plugins/select2.init.js",
],
},

And to use it, would I have to add this code too?

$(".form-select").select2({
language: "pt-BR"
});



Hi,

Yes, you just need to modify the gulp config, recompile the assets, and use the below select2 init code with the required lang.

Regards.



Hi,

Please add the required language's source in the select2 plugin build:


select2: {
styles: [
"{$config.path.node_modules}/select2/dist/css/select2.css",
],
scripts: [
"{$config.path.node_modules}/select2/dist/js/select2.full.js",
"{$config.path.node_modules}/select2/dist/js/i18n/es.js",
"{$config.path.common_src}/js/vendors/plugins/select2.init.js",
],
},


in tools/gulp.config.js and recompile assets with gulp as explained in the docs.

Regards.



I want to be able to add another language "es and pt-BR"


Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
Text formatting options
Submit
Click any option to insert into your comment. Select text first to wrap it.
  • **text** to make things bold
  • *text* to emphasize
  • ### Heading to make headings
  • [link text](url) for links
  • ![alt text](image-url) to paste in an image
  • - item to make a list
  • 1. item to make an ordered list
  • > quote to quote somebody
  • `code` for single line of code
  • ```js ... ``` for JS code block
  • ```html ... ``` for HTML code block
  • ```scss ... ``` for SCSS code block
  • ```php ... ``` for PHP code block
  • --- for a horizontal rule
  • happy  :)
  • shocked  :|
  • sad  :(
buy metronic keenthemes mega bundle

ReUI

Open-source React components, blocks and templates built on shadcn/ui and Tailwind CSS by Keenthemes.