Skip to content

Commit 559689f

Browse files
committed
Localize more Extract Function/Constant strings
Fixes #18899
1 parent 37723f1 commit 559689f

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

src/compiler/diagnosticMessages.json

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3733,5 +3733,15 @@
37333733
"Extract constant": {
37343734
"category": "Message",
37353735
"code": 95006
3736+
},
3737+
3738+
"enclosing scope": {
3739+
"category": "Message",
3740+
"code": 95007
3741+
},
3742+
3743+
"{0} scope": {
3744+
"category": "Message",
3745+
"code": 95008
37363746
}
37373747
}

src/services/refactors/extractSymbol.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -557,7 +557,7 @@ namespace ts.refactor.extractSymbol {
557557
description: getDescriptionForConstantInScope(scope),
558558
errors: constantErrorsPerScope[i],
559559
scopeDescription: (i === 0 && !isClassLike(scope))
560-
? "enclosing scope" // Like "global scope" and "module scope", this is not localized.
560+
? Diagnostics.enclosing_scope.message
561561
: scopeDescription,
562562
},
563563
};
@@ -630,7 +630,7 @@ namespace ts.refactor.extractSymbol {
630630
function getDescriptionForModuleLikeDeclaration(scope: SourceFile | ModuleBlock): string {
631631
return scope.kind === SyntaxKind.ModuleBlock
632632
? `namespace '${scope.parent.name.getText()}'`
633-
: scope.externalModuleIndicator ? "module scope" : "global scope";
633+
: formatStringFromArgs(Diagnostics._0_scope.message, [scope.externalModuleIndicator ? "module" : "global"]);
634634
}
635635

636636
function getUniqueName(baseName: string, fileText: string): string {

0 commit comments

Comments
 (0)