fix message lookup for core nodes in case of i18 locales directory ex… #1616
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.
…ists
Before you hit that Submit button....
Please read our contribution guidelines
before submitting a pull-request.
Types of changes
What types of changes does your code introduce?
Put an
x
in the boxes that applyIf you want to raise a pull-request with a new feature, or a refactoring
of existing code, it may well get rejected if it hasn't been discussed on
the mailing list or
slack team first.
Proposed changes
Describe the nature of this change. What problem does it address?
As reported by issue #1615, message catalogue lookup for core nodes become failed when i18n locales directory (
nodes/core/<category>/locales
) exists.This is caused by
loadNodeConfig
function inred/runtime/nodes/registry/loader.js
.If a
locales
directory exists,loadNodeConfig
try to look up message catalogue (.json) for nodes in modules under the directory. Because the combined message catalogue for core nodes are placed at different location, this look up fails and message catalogue is corrupted.This PR fixes this problem by skipping message catalogue look up for core nodes in
loadNodeConfig
.My proposal is to place info text of core nodes under
nodes/core/locales
(or separate message catalogue of core nodes frommessages.json
). But, this may needs more discussion. So, this PR expects to place info text undernodes/core/<category>/locales
.Checklist
Put an
x
in the boxes that applygrunt
to verify the unit tests pass