Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

462
Views
How translate select options with vuejs

I want to translate the options found inside the contract_project_type array,

this is my select code:

<b-form-select
              :options="contract_project_types"
              v-model="form.contract_data.contract_project_type"
              id="contract_project_types"
              :state="validate(form.contract_data.contract_project_type)"

          ></b-form-select>

and my Data is :

data: {
contract_project_types: [
      'digital_work_city',
      'general_company'
      ]
}

i don't know how to translate these two options. I tried to put this.$t('digital_work_city') this.$t('general_company') but it doesn't work

over 4 years ago · Santiago Trujillo
2 answers
Answer question

0

Try to get $t from the this context when outside of a template.

data() {
    return { contract_project_types: [
      this.$t('digital_work_city'),
      this.$t('general_company')
      ]
    }
}

You may also try

this.$i18n.t('digital_work_city')
over 4 years ago · Santiago Trujillo Report

0

Try this. May be, it hasn't reacted to change a language.

computed: {
    contract_project_types() {
         return [
           this.$t('digital_work_city'),
           this.$t('general_company')
      ];
    }
}
over 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!