Skip to content

@lobehub/i18n-cli converts numeric-keyed objects to arrays with null gaps, breaking vue-i18n #163

@coderabbitai

Description

@coderabbitai

Problem

When translating locale files, @lobehub/i18n-cli (GPT-4.1) is converting numeric-keyed objects like:

{
  "0": {...},
  "1": {...}
}

into JSON arrays with null gaps:

[
  null,
  null,
  {...},
  {...}
]

Impact

This corruption causes vue-i18n path resolution to crash when trying to access these translated node definitions.

Workaround

We've implemented a post-processing script to convert arrays back to objects after translation as a temporary workaround.

References

Metadata

Metadata

Assignees

No one assigned

    Labels

    InactiveNo response in 30 days | 超过 30 天未活跃

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions