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鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve Symbols using the original fallback locale #591

Merged
merged 1 commit into from Jan 25, 2022
Merged

Resolve Symbols using the original fallback locale #591

merged 1 commit into from Jan 25, 2022

Conversation

movermeyer
Copy link
Contributor

@movermeyer movermeyer commented Dec 15, 2021

What are you trying to accomplish?

Proof of concept solution to #590

What approach did you choose and why?

I added a new fallback_original_locale reserved option, and make use of it in the new I18n::Backends::Fallbacks#resolve method.

Seemed like a reasonable way to deal with it? 馃し

What should reviewers focus on?

This changes the behaviour of resolve when using the Fallbacks backend, when a Symbol is resolved.

This is probably a bad idea, since it is probably considered a breaking change?

I'm not sure if there is any documentation describing the "Why?" of the "resolve Symbols" feature. It might be the case that this is exactly the desired behaviour, and therefore this is actually "just a bug fix". cc @svenfuchs, who may have more context?

I mostly threw it together to start a conversation about how we might support this behaviour.

The impact of these changes

Fixes #590

@radar
Copy link
Collaborator

radar commented Jan 3, 2022

This change seems like it would solve the overall problem, and so I think it's worth the (potential) breakage here.

The test suite for i18n is quite robust, and so I think it would do a good job of catching 99% of things that would break when new changes are introduced. For the 1%, that's inevitable and people can file new issues and we can write new tests (and patches) to address those issues if/when they arise.


Could you please rebase this branch against master so that you pick up the latest GH Actions changes there?

@movermeyer movermeyer requested a review from radar January 4, 2022 16:55
@movermeyer movermeyer marked this pull request as draft January 4, 2022 18:40
@movermeyer movermeyer changed the title Resolve Symbols using the original fallback locale WIP: Resolve Symbols using the original fallback locale Jan 4, 2022
@movermeyer movermeyer changed the title WIP: Resolve Symbols using the original fallback locale Resolve Symbols using the original fallback locale Jan 4, 2022
@movermeyer movermeyer marked this pull request as ready for review January 4, 2022 19:25
@radar radar merged commit be5a8e0 into ruby-i18n:master Jan 25, 2022
@radar
Copy link
Collaborator

radar commented Jan 25, 2022

Thank you @movermeyer!

radar added a commit that referenced this pull request Feb 11, 2022
movermeyer added a commit to movermeyer/rails that referenced this pull request Feb 13, 2022
Adjusts to change introduced in v1.9.0 of i18n

Ref: ruby-i18n/i18n#591
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.

[QUESTION] Resolve Symbols based on original fallback locale?
2 participants