Skip to content

Commit 33e27d8

Browse files
committed
Messages: Support scope
1 parent 2e4cb3c commit 33e27d8

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/message.js

+7
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import "globalize/plural";
77
function messageSetup(componentProps, instance, args) {
88
var defaultMessage, path;
99
var children = componentProps.children;
10+
var scope = componentProps.scope;
1011

1112
function extractFromFnComments(fn) {
1213
return fn.toString().replace(/(function \(\) \{\/\*|\*\/\})/g, "");
@@ -54,6 +55,12 @@ function messageSetup(componentProps, instance, args) {
5455
path = [args[0]];
5556
}
5657

58+
// Scope path.
59+
if (scope) {
60+
args[0] = scope + "/" + args[0];
61+
path = scope.split("/").concat(path);
62+
}
63+
5764
// Development mode only.
5865
if (instance.cldr) {
5966
if (!getMessage()) {

0 commit comments

Comments
 (0)