No More Posting New Topics!

If you have a question or an issue, please start a thread in our Github Discussions Forum.
This forum is closed for new threads/ topics.

Navigation

    Quasar Framework

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search

    How do I translate Quasar component?

    Help
    2
    2
    678
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • T
      TNSaturday last edited by

      I have a Vue/Quasar application in which I use i18n but now I’m facing a problem: table footer doesn’t get translated. In the table headers, for example, I do something like this to translate column names:

      {
        align: 'left',
        field: (val) => val,
        label: this.$t('locale.column'),
        name: 'column',
        required: true,
        sortable: true,
      },
      

      where $t is 18n function, locale is my component and the column is actually’s column’s name. I don’t have direct access to the footer of the table (where the pagination an the total number of the elements are) and it doesn’t get translated. I also use Quasar language packs, quasar.js goes like this:

      import en from 'quasar/lang/en-us.js'
      /*
        import other languages
      */
      import {
        state,
      } from '@state/modules/i18n';
      
      const locale = state.locale;
      const langDictionary = {
        // all the imported langs go here
      };
      
      Vue.use(Quasar, {
        config: {},
        components: { /* not needed if importStrategy is not 'manual' */ },
        directives: { /* not needed if importStrategy is not 'manual' */ },
        plugins: {
          Cookies,
          Dialog,
          Loading,
          Notify,
        },
        lang: langDictionary[locale]
      });
      
      export {langDictionary}; 
      

      How do I translate the table footer?
      a984e1cb-be73-43a1-af48-d4a6215c4e5f-image.png

      1 Reply Last reply Reply Quote 0
      • s.molinari
        s.molinari last edited by

        https://medium.com/quasar-framework/adding-full-i18n-to-quasar-150da2d5bba4

        Scott

        1 Reply Last reply Reply Quote 0
        • First post
          Last post