Skip to content

Translation support? #60

Answered by sa-si-dev
noum asked this question in Q&A
Discussion options

You must be logged in to vote

You can do translation by initiating the Virtual Select with all text-related properties (Refer Text Properties for available properties)

To avoid code duplicates, create a project-level util function to initiate the dropdown, and define all Text Properties there.

function initDropdown(options) {
  return VirtualSelect.init(Object.assign({
    placeholder: 'Select',
    noOptionsText: 'No options found',

    /** define all text related properties and project-level common properties here */

  }, options));
}

initDropdown({
  ele: '#sample-select',
  options: [
    { label: 'Options 1', value: '1' },
    { label: 'Options 2', value: '2' },
    { label: 'Options 3', value: '3' },
  ],
});

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by sa-si-dev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants