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

feat: add option to add default locale #1

Closed

Conversation

jreppnow
Copy link
Collaborator

No description provided.

Copy link
Owner

@tronicboy1 tronicboy1 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this! You may be right that add_resource_overriding might do it but I think its much better to have a convenience behavior like this. If you were to add a German l10n, it would be cool to have it automatically go to the English version.

Maybe it might be a good idea to log something to tracing debug if the FTL key was missing from the target locale? That might make it easier to debug.

@jreppnow
Copy link
Collaborator Author

@tronicboy1 I think it would be more flexible to change this line into add_resource_overriding (should be backwards-compatible, as this was a hard error before, although it does change behavior):

bundle.add_resource(ftl).map_err(|err| {

Reason: By doing this, you can have multiple back-ups, instead of just one.

@tronicboy1
Copy link
Owner

@jreppnow
That's a very good idea too! I don't see an issue with allowing the override behavior.

Yes it is a behavior change but not a breaking change so I think it's fair game. You're more than welcome to make another PR for that change!

@jreppnow
Copy link
Collaborator Author

As discussed, superseded by #2.

@jreppnow jreppnow closed this May 22, 2024
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

Successfully merging this pull request may close these issues.

2 participants