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

proposal: major version - ordered directories (multiple overrides), json or yaml content #14

Closed
rosskevin opened this issue Sep 23, 2017 · 3 comments

Comments

@rosskevin
Copy link

These are features I'll need so I'm going to build it either way. I'm wondering if you'll want the changes:

  1. Allow for multiple locale directories e.g. dirs[0] is a base dir, whereas dirs[5] would be the most specialized dir
  2. json or yaml content parsing - default to json, but allow for a type to specify yaml parsing.

I'll fork and build it, I can PR it and see if you are interested. If you have any other thoughts, please let me know.

@rosskevin
Copy link
Author

I've actually found that I need to remove the basename from the structure created. The basename comes from the json filename. I need to remove it because in our i18n, it would require us to create far more files (something like 5x vs the structure we have).

Given that, I think I'll be maintaining a permanent fork with the breaking changes. If you do look over it and want me to merge it, I'm happy to PR.

@de-robat
Copy link
Collaborator

Maybe if you could elaborate a little more on why you'd need several dirs, and whats the specificity is supposed to determine. Than i could think about its worth to the library form a "general purpose" point of view. And just to let you know: As far as i know there is a yaml fork for the loader already.

@rosskevin
Copy link
Author

rosskevin commented Sep 24, 2017

Thanks @de-robat. The yaml fork wasn't up to date. I've just finished my changes and need move on to using it, but ultimately I think I broke compatibility in too many ways:

  1. basename (filename) is no longer included in the structure. We have one contact.yml for a variety of widgets, and we scope our keys to the react component name. Since we have 6 components, using the basename structure we would have to split our files into 6, and name each for the widget. Neither way is bad/wrong, we have just too few keys for it to be worth it to have a dedicated file for each widget.
  2. Changed include/exclude to be glob based (good in general)
  3. Allow app/locales to override any number of lib/locales (not just one override)

I'll submit PR and close it just so you have an idea. If you do decide you want to merge it, please let me know.

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