Skip to content

Add option to support working with flattened json using dot ('.') as separator #271

Open
@RobinB-Gbanga

Description

@RobinB-Gbanga

Currently, if I look up this key:
$t('mainMenu.buttonStart')

The key is only found if I use a nested json:

{
  "mainMenu": {
    "buttonStart": "Start!"
  }
}

But not if I use a flat json representation:

{
  "mainMenu.buttonStart": "Start!"
}

For a current project, we are interfacing with a translation source that can only output flat json files. At the same time, however, we'd like to have the benefits of a namespaced/scoped key naming convention. For example, the tool we use in VSCode offers a nice tree view when using dots as namespace/scope separators.

It would be great if vue-i18n would offer a setting to support flattened json files (or, in other words, to treat the dot ('.') as a normal/literal character).

Thanks!

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions