Skip to content

Add Support for Nested Classes #8

@Maskoe

Description

@Maskoe

Hello, very cool library.

I would like to have just one Locale.json file per language.
I would structure it like this

Messages/T.json

{
  "Password": {
    "Uppercase": "Password needs at least one uppercase letter.",
    "Digit": "Password needs at least one number.",
    "Length": "Password must be at least 8 characters long."
  },
  "CreateUser": {
    "EmailInUse": "Email is already in use.",
    "InvalidRole": "Invalid role. Allowed roles are {roles}."
  }
}

I would like that to lead to

var err = T.Password.Uppercase;

Is that doable? If you dont want to do it, can you point me in a direction so I can give it a try?
Obviously while at it, it should probably work with any level of nesting. So I can really go ham and do T.Errors.CreateUser.InvalidRole.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions