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

Fallback Locale #19

Closed
subpx opened this issue Nov 19, 2019 · 9 comments
Closed

Fallback Locale #19

subpx opened this issue Nov 19, 2019 · 9 comments
Assignees
Labels
enhancement New feature or request

Comments

@subpx
Copy link

subpx commented Nov 19, 2019

My main use case for i18n, is supporting multiple versions of English. For example US and AU.
Many words have different spelling, but they are both English so mainly the same.

Instead of having duplicate dictionaries with some minor differences, It would be useful to have a fallback dictionary, so that only the differences would need to be in the 'other' english dictionaries.

Thoughts on this?

@ralyodio
Copy link

I think that's why you can merge in objects to the dictionary. So en_AU can merge in en_US and you can override with the differences.

@subpx
Copy link
Author

subpx commented Nov 19, 2019

Just looks like that is for adding another dictionary.

@ralyodio
Copy link

ralyodio commented Nov 19, 2019

you can merge two objects before you set the au one.

au: Object.merge(us, { Hello: 'Howdy mate! Toss another shrimp on the barbie!' })

@subpx
Copy link
Author

subpx commented Nov 19, 2019

You could always use JS to write less code and merge dictionary objects. It would still result in duplicate code and a little bit of unnecessary handling of the dictionary objects.

@subpx
Copy link
Author

subpx commented Nov 19, 2019

Hhahahahha we would never say Toss or shrimp!

@ralyodio
Copy link

Not according to Crocodile Dundee.

@kaisermann kaisermann self-assigned this Nov 19, 2019
@kaisermann kaisermann added the enhancement New feature or request label Nov 19, 2019
@kaisermann
Copy link
Owner

I completely agree that also looking for the message in the more generic locale should be the default behaviour. Duly noted for v2.0.0 😁

@subpx
Copy link
Author

subpx commented Nov 19, 2019

@kaisermann awesome!

@kaisermann
Copy link
Owner

Fixed on v2.0.0 🎉

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

No branches or pull requests

3 participants