Skip to content

How to translate available languages list? #131

@7iomka

Description

@7iomka

Hi.
Docs say:

You can use vm.$language.current and vm.$language.available to e.g. easily build a language switch component with a single template:

<template>
  <div>
    <select name="language" v-model="$language.current">
      <option v-for="(language, key) in $language.available" :value="key">{{ language }}</option>
    </select>
  </div>
</template>

My language list is

["English", "Simplified Chinese", "Spanish", "Indonesian", "Portuguese", "Russian", "Japanese", "Hindi", "Vietnamese", "Italian", "Korean", "Thai", "Turkish", "Polish", "Nepali", "Greek", "Serbian"]

I need translation for each of this language to it own language version.
For example, for Simplified Chinese

["英语","简体中文","西班牙语","印度尼西亚语","葡萄牙语","俄语","日语","印地语","越南语","意大利语","韩语","泰语", "土耳其语","波兰语","尼泊尔语","希腊语","塞尔维亚语"]

How to do that?

What I tried:

Object.values(this.$language.available).map((lang) =>this.$gettext(lang));

This only produces

#: src/pages/Index.vue:18
msgid "lang"
msgstr ""

Also I'm tried all variants from https://github.com/Polyconseil/vue-gettext#caveat-when-using-either-the-component-translate-or-directive-v-translate-with-interpolation-inside-v-for
Nothing not working.

Help me please.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions