Skip to content

Commit

Permalink
i18n: mark missing translations for AdminForm
Browse files Browse the repository at this point in the history
  • Loading branch information
Samk13 committed Oct 23, 2024
1 parent e01251c commit f943af5
Showing 1 changed file with 11 additions and 4 deletions.
Original file line number Diff line number Diff line change
@@ -1,3 +1,10 @@
// This file is part of InvenioAdministration
// Copyright (C) 2022 CERN.
// Copyright (C) 2024 KTH Royal Institute of Technology.
//
// Invenio RDM Records is free software; you can redistribute it and/or modify it
// under the terms of the MIT License; see LICENSE file for more details.

import React, { Component } from "react";
import PropTypes from "prop-types";
import { Form, Formik } from "formik";
Expand Down Expand Up @@ -58,7 +65,7 @@ export class AdminForm extends Component {
}
} catch (e) {
console.error(`Error parsing JSON for field ${key}:`, e);
actions.setFieldError(key, "Invalid JSON format");
actions.setFieldError(key, i18next.t("Invalid JSON format"));
throw e;
}
}
Expand All @@ -81,8 +88,8 @@ export class AdminForm extends Component {
actions.setSubmitting(false);
actions.resetForm({ values: { ...values } });
addNotification({
title: "Success",
content: "Your changes were successfully submitted",
title: i18next.t("Success"),
content: i18next.t("Your changes were successfully submitted"),
type: "success",
});
successCallback(response.data);
Expand All @@ -100,7 +107,7 @@ export class AdminForm extends Component {
}

this.setState({
error: { header: "Form error", content: errorMessage, id: e.code },
error: { header: i18next.t("Form error"), content: errorMessage, id: e.code },
});
}
};
Expand Down

0 comments on commit f943af5

Please sign in to comment.