Repository navigation
Conversation
icambron
reviewed
Oct 19, 2017
| if (locales[name] != null) { | ||
| parentConfig = locales[name]._config; | ||
| } | ||
| else { |
Contributor
There was a problem hiding this comment.
How about:
tmpLocale = locales[name] || loadLocale(name);
if (locale != null) {
parentConfig = tmpLocale._config;
}
Contributor
Author
There was a problem hiding this comment.
Looks good, I've committed with the suggested refactor.
Contributor
|
@cmyers Can you add a test? |
Contributor
Author
|
@icambron new to qunit but I'll give it a go. |
Contributor
|
Actually, another thought: I looked at the |
Contributor
Author
|
That's a good catch, I'll revisit then add a test. |
Contributor
|
LGTM. Thanks! |
Contributor
|
So basically try to load it if its not loaded already? That's mostly for node.js, I guess. |
Contributor
|
Yup |
Contributor
|
Merged in d26f97e |
ichernev
added a commit
that referenced
this pull request
Nov 11, 2017
[bugfix] updateLocale now tries to load parent, fixes #3626
This was referenced Nov 12, 2017
This was referenced Mar 12, 2021
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This addresses #3626.
A fix was suggested in the comments but a PR wasn't submitted. I've refactored the suggested fix which will check if the locale to update exists (if not found in the currently loaded locales) and load it before merging. This mitigates the merge with the current set locale if the submitted locale isn't found in the loaded locales array.
Not sure if it should continue to merge if the locale to merge with can't be loaded, but this could be another issue to discuss.