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

data-as alternative #8

Closed
dionysiosarvanitis opened this issue Aug 29, 2016 · 4 comments
Closed

data-as alternative #8

dionysiosarvanitis opened this issue Aug 29, 2016 · 4 comments

Comments

@dionysiosarvanitis
Copy link

Instead of using data-as for the field names substitution it would be more handy if we could just use a dedicated attributes array inside dictionary. This is the Laravel's approach to this.

const dictionary = {
    en: { 
        email: () => 'Some English Message', 
        attributes: { 
            email: () => 'Email address'
        }
    },
    ar:
};
@logaretm
Copy link
Owner

@dionysiosarvanitis I think I prefer what you suggested, I will work on it in the next couple of days. I would keep data-as though.

@dionysiosarvanitis
Copy link
Author

That would be great! You should definitely keep data-as as well.

@logaretm
Copy link
Owner

Okay I just tagged a release (1.0.0-beta.0 and 2.0.0-beta.6) with this, I changed the structure to be more appropriate:

const dictionary = {
    en: {
        messages: {
            email: () => 'Some English Message', 
        },
        attributes: { 
            email: 'Email Address'
        }
    },
    ar: { ... }
};

@dionysiosarvanitis
Copy link
Author

Better that way!

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

No branches or pull requests

2 participants