Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Duplicate keys in the Localicipe should result in an error #42

Open
LcTwisk opened this issue Jul 27, 2020 · 0 comments
Open

Duplicate keys in the Localicipe should result in an error #42

LcTwisk opened this issue Jul 27, 2020 · 0 comments

Comments

@LcTwisk
Copy link
Member

LcTwisk commented Jul 27, 2020

Currently, if you by mistake define duplicate keys in the Localicipe, the previous entries will always be overwritten by the last key in the file.

The problem:
Let's say there's a Localicipe that looks like:

COLLECTION-A:
  Onboarding:
    Login:
      InputField: 
        Placeholder: 
          COPY:
            en: "Username"
      InputField: 
        Placeholder: 
          COPY:
            en: "E-mail"

The key Onboarding.Login.InputField.Placeholder is defined twice, as a result, the second entry will be overwritten by the first one. This behaviour might be confusing, entries that accidentally have duplicated keys will get lost.

Proposal
Improve the validation by throwing a proper error that indicates that duplicated entries are not allowed in the Localicipe.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant