-
Notifications
You must be signed in to change notification settings - Fork 43
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
Allow prefix to be an array to search in multiple places #53
base: master
Are you sure you want to change the base?
Conversation
Hello @jurienhamaker, Thank you for your PR. {
"routes": {
"about": "over-ons",
"categories": {
"bananas": "bananen"
}
}
} What you want the library do if it find multiple values ? (Actually you PR stop to first one) {
"routes": {
"about": "over-ons"
}
"categories": {
"about": "bananen"
}
} I think it will open the door to multiple usage mistake. |
I use the data for such categories for multiple things (not just routes), it would be a very easy mistake to update one value and forget the other if we we're to ever change the values. For that purpose we want one source of truth for those translations. I am not sure what I would want the library to do if there are multiple values. I could warn the user that multiple entries were found (and not break) and use the first one., but that would also be an issue to performance (iterating more than you have to). |
Alright, I will merge this soon. |
Latest stable. |
For the application I am working on I need multiple types of values to be translated. To keep order in my translations file. I'd like to use multiple prefixes to search in different places for my translation.
Example (dutch);
When prefixes set to
["routes.", "categories."]
I will allow the translate parser to search for both predefined routes & categories.