99 "github.com/microsoft/typescript-go/internal/astnav"
1010 "github.com/microsoft/typescript-go/internal/checker"
1111 "github.com/microsoft/typescript-go/internal/compiler"
12+ "github.com/microsoft/typescript-go/internal/locale"
1213)
1314
1415var (
@@ -78,6 +79,7 @@ type Diagnostic struct {
7879
7980type diagnosticList struct {
8081 diagnostics []* Diagnostic
82+ locale locale.Locale
8183}
8284
8385func (d * diagnosticList ) addDiagnostic (diagnostic * ast.Diagnostic , ls * LanguageService , shouldAdd bool ) * Diagnostic {
@@ -102,7 +104,7 @@ func (d *diagnosticList) addDiagnostic(diagnostic *ast.Diagnostic, ls *LanguageS
102104 SourceLine : sourceLine ,
103105 Code : diagnostic .Code (),
104106 Category : diagnostic .Category ().Name (),
105- Message : diagnostic .Message ( ),
107+ Message : diagnostic .Localize ( d . locale ),
106108 MessageChain : make ([]* Diagnostic , 0 , len (diagnostic .MessageChain ())),
107109 RelatedInformation : make ([]* Diagnostic , 0 , len (diagnostic .RelatedInformation ())),
108110 }
@@ -137,6 +139,7 @@ func (l *LanguageService) GetDiagnostics(ctx context.Context, fileNames []string
137139 }
138140 diagnosticList := & diagnosticList {
139141 diagnostics : make ([]* Diagnostic , 0 ),
142+ locale : program .CommandLine ().Locale (),
140143 }
141144 diagnostics := make ([]* ast.Diagnostic , 0 , len (sourceFiles ))
142145 for _ , sourceFile := range sourceFiles {
0 commit comments