Skip to content

i18n-json/valid-message-syntax: Add possibility to allow Arrays #54

@Taucher2003

Description

@Taucher2003

Currently it is hardcoded that Arrays can't be a valid translation. However, based on the setup, there are some legitimate usages of Arrays and this is blocking it for no reason.

} else if (Array.isArray(value)) {
invalidMessages.push({
value: ARRAY,
key,
path,
error: new TypeError('An Array cannot be a translation value.')
});
} else {

The problem is, that we can't bypass this check with a custom validator which would allow Arrays for some specific keys

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