Fix #19959 and #19958: Remove un-localizable messages (#20019)

* Fix #19959 and #19958: Remove un-localizable messages

* Update message

* Update diagnostic messages
This commit is contained in:
Mohamed Hegazy 2017-11-24 22:02:48 -08:00 committed by GitHub
parent 568e52d550
commit 6b3cfc7008
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
11 changed files with 12 additions and 26 deletions

View file

@ -3766,7 +3766,7 @@
"category": "Error",
"code": 90010
},
"Import '{0}' from \"{1}\".": {
"Import '{0}' from module \"{1}\".": {
"category": "Message",
"code": 90013
},
@ -3886,13 +3886,5 @@
"Install '{0}'": {
"category": "Message",
"code": 95014
},
"Import '{0}' = require(\"{1}\").": {
"category": "Message",
"code": 95015
},
"Import * as '{0}' from \"{1}\".": {
"category": "Message",
"code": 95016
}
}

View file

@ -276,17 +276,11 @@ namespace ts.codefix {
}
});
const actionFormat = kind === ImportKind.Equals
? Diagnostics.Import_0_require_1
: kind === ImportKind.Namespace
? Diagnostics.Import_Asterisk_as_0_from_1
: Diagnostics.Import_0_from_1;
// if this file doesn't have any import statements, insert an import statement and then insert a new line
// between the only import statement and user code. Otherwise just insert the statement because chances
// are there are already a new line seperating code and import statements.
return createCodeAction(
actionFormat,
Diagnostics.Import_0_from_module_1,
[symbolName, moduleSpecifierWithoutQuotes],
changes,
"NewImport",

View file

@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
verify.applyCodeActionFromCompletion("", {
name: "foo",
source: "/a",
description: `Import 'foo' from "./a".`,
description: `Import 'foo' from module "./a".`,
// TODO: GH#18445
newFileContent: `import f_o_o from "./a";
import foo from "./a";\r

View file

@ -21,7 +21,7 @@ verify.completionListContains({ name: "fooBar", source: "/src/foo-bar" }, "(prop
verify.applyCodeActionFromCompletion("1", {
name: "fooBar",
source: "/src/foo-bar",
description: `Import 'fooBar' from "./foo-bar".`,
description: `Import 'fooBar' from module "./foo-bar".`,
// TODO: GH#18445
newFileContent: `import fooBar from "./foo-bar";\r
\r

View file

@ -17,7 +17,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
verify.applyCodeActionFromCompletion("", {
name: "foo",
source: "/a",
description: `Import 'foo' from "./a".`,
description: `Import 'foo' from module "./a".`,
// TODO: GH#18445
newFileContent: `import foo from "./a";\r
\r

View file

@ -11,7 +11,7 @@
verify.applyCodeActionFromCompletion("", {
name: "x",
source: "m",
description: `Import 'x' from "m".`,
description: `Import 'x' from module "m".`,
// TODO: GH#18445
newFileContent: `import { x } from "m";\r
\r

View file

@ -22,7 +22,7 @@ verify.completionListContains({ name: "foo", source: "/b" }, "const foo: 1", "",
verify.applyCodeActionFromCompletion("", {
name: "foo",
source: "/b",
description: `Import 'foo' from "./b".`,
description: `Import 'foo' from module "./b".`,
// TODO: GH#18445
newFileContent: `import { foo } from "./b";\r
\r

View file

@ -16,7 +16,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "function foo(): vo
verify.applyCodeActionFromCompletion("", {
name: "foo",
source: "/a",
description: `Import 'foo' from "./a".`,
description: `Import 'foo' from module "./a".`,
// TODO: GH#18445
newFileContent: `import * as a from "./a";
import { foo } from "./a";\r

View file

@ -28,7 +28,7 @@ verify.not.completionListContains({ name: "foo", source: "/a_reexport_2" }, unde
verify.applyCodeActionFromCompletion("", {
name: "foo",
source: "/a",
description: `Import 'foo' from "./a".`,
description: `Import 'foo' from module "./a".`,
// TODO: GH#18445
newFileContent: `import { foo } from "./a";\r
\r

View file

@ -23,7 +23,7 @@ verify.not.completionListContains({ name: "foo", source: "/foo/index" }, undefin
verify.applyCodeActionFromCompletion("", {
name: "foo",
source: "/foo/lib/foo",
description: `Import 'foo' from "./foo".`,
description: `Import 'foo' from module "./foo".`,
// TODO: GH#18445
newFileContent: `import { foo } from "./foo";\r
\r

View file

@ -22,7 +22,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "",
verify.applyCodeActionFromCompletion("b", {
name: "foo",
source: "/a",
description: `Import 'foo' from "./a".`,
description: `Import 'foo' from module "./a".`,
// TODO: GH#18445
newFileContent: `import { foo } from "./a";\r
\r
@ -39,7 +39,7 @@ verify.completionListContains({ name: "foo", source: "/a" }, "const foo: 0", "",
verify.applyCodeActionFromCompletion("c", {
name: "foo",
source: "/a",
description: `Import 'foo' from "./a".`,
description: `Import 'foo' from module "./a".`,
// TODO: GH#18445
newFileContent: `import { foo } from "./a";\r
\r