Skip to content

[Enhancement Request] Handle key levels with the command @kuaizi: $i (CTRL + i)  #5

@rdhainaut

Description

@rdhainaut

Firstly, thanks for your work. The extension is great and enhance a lot the experience with vue i18n.

I would like to know if you could generate expanded translation from 'key.levels' with @kuaizi: $i command (CTRL + i) ?

Indeed, I organize some translations keys in levels (example: $t('meta.title'), $t('meta.description'))
Then i use the magic 'CTRL + i' to auto generate vue i18n translations keys but the the key is flatten.
I would like that the auto generated translation to be expanded in <i18n> tag
Note: I use the "." (dot) as level separator

<template>
      <table>
        <tr>
          <th>title</th>
          <td>{{ $t('meta.title') }}</td>
        </tr>
        <tr>
          <th>desciption</th>
          <td>{{ $t('meta.description') }}</td>
        </tr>
      </table>
</template>

<i18n>
{
  "en": {
    "meta.description": "" // [Actual behavior: flatten] Key generated after CTRL + i command,
    "meta": {
      "title": "Kuaizi i18n plugin", // [Enhancement request: expanded] Key with 2 levels after CTRL + i command
    }
  },
  "fr": {
    "meta.description": "",
    "meta": {
      "title": "Kuaizi i18n module d'extension"
    }
  }
}
</i18n>

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