Skip to content

Commit d37749c

Browse files
fix: fix mixed languages in response to client (#502)
Signed-off-by: Fredrik Nordlander <fredrik.nordlander@digg.se>
1 parent 548d334 commit d37749c

File tree

2 files changed

+7
-7
lines changed

2 files changed

+7
-7
lines changed

src/routes/validate.ts

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -100,8 +100,8 @@ export const registerValidationRoutes = (app: Express) => {
100100
//0.5 Check input
101101
if (!body.spec) {
102102
throw new RapLPBaseApiError(
103-
'Invalid request',
104-
'Missing required field: spec',
103+
'Ogiltig request',
104+
'Obligatoriskt fält saknas: spec',
105105
ERROR_TYPE.BAD_REQUEST,
106106
);
107107
}
@@ -131,9 +131,9 @@ export const registerValidationRoutes = (app: Express) => {
131131
return res.status(400).json(
132132
new ProblemDetailsDTO({
133133
type: 'https://rap-lp./problems/semantic-validation',
134-
title: 'Rule validation failed',
134+
title: 'Regelvalideringen misslyckades',
135135
status: 400,
136-
detail: 'The specification contains structural or semantic errors',
136+
detail: 'Specifikationen innehåller strukturella eller semantiska fel',
137137
instance: req.originalUrl,
138138

139139
// Put in kind field to indicate violation
@@ -159,9 +159,9 @@ export const registerValidationRoutes = (app: Express) => {
159159
return res.status(400).json(
160160
new ProblemDetailsDTO({
161161
type: 'https://rap-lp./problems/rule-validation',
162-
title: 'Rule validation failed',
162+
title: 'Regelvalideringen misslyckades',
163163
status: 400,
164-
detail: 'The api specification violates one or more rules according to the Swedish REST API-profile',
164+
detail: 'API-specifikationen bryter mot en eller flera regler enligt den svenska REST API-profilen.',
165165
instance: req.originalUrl,
166166

167167
// Put in kind field to indicate violation

src/util/RapLPBaseApiErrorHandling.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ const errorHandler = (err: any, req: Request, res: Response, next: NextFunction)
3434
if (err instanceof SpecParseError) {
3535
const problemDetails = new ProblemDetailsDTO({
3636
type: 'https://rap-lp./problems/spec-parse-error',
37-
title: 'Specification parse error',
37+
title: 'Okänt fel vid parsning av API-specifikationen',
3838
status: ERROR_TYPE.BAD_REQUEST,
3939
detail: err.message,
4040
instance: req.originalUrl,

0 commit comments

Comments
 (0)