Translation in vue 3

Translation in vue 3

josenildo2010josenildo2010 Posts: 2Questions: 0Answers: 0

Is there any way to translate using vue 3 already available?

Replies

  • colincolin Posts: 15,237Questions: 1Answers: 2,599

    I'm not sure what you mean by 'translate', but there are a few Vue3 examples on this forum, such as this thread. It would be worth searching around and seeing if the topic has been asked before.

    Colin

  • allanallan Posts: 63,280Questions: 1Answers: 10,425 Site admin

    The DataTables Vue component documentation shows how you can use initialisation options. So all the options there, and the examples on this site can be applied in that way - e.g.:

    <script setup>
    import DataTable from 'datatables.net-vue3';
    import DataTablesCore from 'datatables.net';
     
    DataTable.use(DataTablesCore);
    
    const options = {
      language: {
        ...
      }
    };
    
    <template>
        <DataTable
            :options="options"
            ajax="/data.json"
            class="display nowrap"
        />
    </template>
    

    See the translations plug-ins for translations provided by the community. And the examples for how to use them.

    Allan

  • josenildo2010josenildo2010 Posts: 2Questions: 0Answers: 0

    Solved, thank you

    const options = {
        language: {
            url: 'https://cdn.datatables.net/plug-ins/1.13.6/i18n/pt-BR.json'
        }
    };
    
Sign In or Register to comment.