Skip to content

Commit

Permalink
Merge pull request #92 from Dreallers/avatar
Browse files Browse the repository at this point in the history
Avatar pour trad site anglais
  • Loading branch information
Dreallers authored Jan 29, 2024
2 parents 1ccff1b + 7f1ab31 commit 3c3e3fb
Show file tree
Hide file tree
Showing 20 changed files with 78 additions and 81 deletions.
2 changes: 1 addition & 1 deletion backend/src/controllers/avatarControllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const browse = async (request, response, next) => {
if (avatars) {
response.status(200).json(avatars);
} else {
response.status(404).json({ error: "Aucun avatar trouvé" });
response.status(404).json({ error: "No avatar found" });
}
} catch (error) {
// Pass any errors to the error-handling middleware
Expand Down
8 changes: 3 additions & 5 deletions backend/src/controllers/filmControllers.js
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ const add = async (req, res, next) => {
req.body.miniature_filename = miniature;
req.body.cover_filename = cover;
} else {
res.status(403).send({ message: "Fichier manquant" });
res.status(403).send({ message: "Missing file" });
}

const film = req.body;
Expand Down Expand Up @@ -81,12 +81,10 @@ const add = async (req, res, next) => {
if (response) {
res.status(200).json({ insertId });
} else {
res
.status(500)
.send({ message: "Erreur lors de l'insertion de la categorie" });
res.status(500).send({ message: "Error inserting category" });
}
} else {
res.status(500).send({ message: "Erreur lors de l'insertion du film" });
res.status(500).send({ message: "Error inserting film" });
}
} catch (err) {
next(err);
Expand Down
10 changes: 5 additions & 5 deletions frontend/src/components/CommentsSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -126,11 +126,11 @@ function CommentsSection({ filmId }) {
return (
<section className="CommentsSection">
<div className="CommentsSectionTitle">
<h3 className="Commentaires">Commentaires</h3>
<h3 className="Commentaires">Comments</h3>
</div>
<div className="CommentsWrapper" ref={commentsWrapperRef}>
{comments.length === 0 ? (
<h4>Soyez le premier à commenter ce film !</h4>
<h4>Be the first to comment on this movie !</h4>
) : (
comments.map((comment) => {
const formattedDate = comment.date.slice(0, 19).replace("T", " ");
Expand Down Expand Up @@ -243,11 +243,11 @@ function CommentsSection({ filmId }) {
return (
<section className="CommentsSection">
<div className="CommentsSectionTitle">
<h3 className="Commentaires">Commentaires</h3>
<h3 className="Commentaires">Comments</h3>
</div>
<div className="CommentsWrapper" ref={commentsWrapperRef}>
{comments.length === 0 ? (
<h4>Connectez-vous pour laisser un commentaires.</h4>
<h4>Log in to leave a comment.</h4>
) : (
comments.map((comment) => {
const formattedDate = comment.date.slice(0, 19).replace("T", " ");
Expand Down Expand Up @@ -290,7 +290,7 @@ function CommentsSection({ filmId }) {
<div className="CommentInputContainer">
<textarea
className="CommentInput"
placeholder="Connectez-vous pour laisser un commentaire"
placeholder="Log in to leave a comment"
disabled
/>
<button type="button" className="SendSvgrepoCom2" disabled>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/components/ModalInscription.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ function ModalInscription() {
return (
<div className="modal">
<div className="modal-content">
<p>Votre inscription a été effectuée avec succès</p>
<p>Your registration has been done successfully</p>
</div>
</div>
);
Expand All @@ -17,7 +17,7 @@ function ModalInscription() {
return (
<div className="modal">
<div className="modal-content">
<p>Votre compte a été modifié avec succès</p>
<p>Your account has been successfully modified</p>
</div>
</div>
);
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MovieDescription.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ function MovieDescription({ movie }) {
const { user } = useUser();
const { movieId } = useParams();
if (!movieId) {
return <h1>Aucun film trouvé.</h1>;
return <h1>No films found.</h1>;
}
if (movie.IsAvailable || user) {
return <FreeMovie movie={movie} />;
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/components/MovieLoginRequired.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ function MovieLoginRequired({ movie }) {
<div className="upper-layer">
<div className="registration-invitation-container">
<p className="registration-invitation">
Connectez-vous pour regarder ce film.
Log in to watch this movie.
</p>
</div>
</div>
Expand Down
6 changes: 3 additions & 3 deletions frontend/src/components/NavBarDesktop.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -25,10 +25,10 @@ function NavBarDesktop() {
<div className="links-container">
<div className="links-wrapper">
<NavLink className="link" to="/">
<p className="link-text">Accueil</p>
<p className="link-text">Home</p>
</NavLink>
<NavLink className="link" to="/search">
<p className="link-text">Recherche</p>
<p className="link-text">Research</p>
</NavLink>
</div>
{user && user.IsAdmin ? (
Expand All @@ -44,7 +44,7 @@ function NavBarDesktop() {
!location.pathname.includes("/category/") &&
!location.pathname.includes("favorites") && (
<>
<h6>Mode admin :</h6>
<h6>Admin mode :</h6>
<ToggleSwitch user={user} />
</>
)}
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/AddSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ function AddSection() {
/>
</div>
<div className="titleContainer">
<h2 className="title">Ajouter une section</h2>
<h2 className="title">Add a section</h2>
</div>
{user && user.IsAdmin && (
<div className="sort-container">
Expand Down
25 changes: 13 additions & 12 deletions frontend/src/pages/AddVideos.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -89,14 +89,14 @@ function AddVideos() {
headers: { "Content-Type": "multipart/form-data" },
})
.then(() => {
toast.success("Film ajouté avec succès");
toast.success("Movie added successfully");
setTimeout(() => {
fetchMovies();
}, 1);
navigate("/");
})
.catch(() => {
toast.error("Erreur lors de l'ajout du film");
toast.error("Error adding movie");
setTimeout(() => {
fetchMovies();
}, 1);
Expand Down Expand Up @@ -132,7 +132,7 @@ function AddVideos() {
return (
<form className="ProfileDisplaySection2" onSubmit={submit}>
<div className="SearchBarContainer">
<h2 className="AjouterUneVideo">Ajouter une video</h2>
<h2 className="AjouterUneVideo">Add a video</h2>
</div>
<div className="Emptyfieldscontainer">
<div className="Imageuploadercontainer">
Expand All @@ -147,7 +147,7 @@ function AddVideos() {
</div>
<div className="Outlineimageuploader">
<div className="Frame4">
<h4 className="AjouterUneMiniature">Ajouter une miniature</h4>
<h4 className="AjouterUneMiniature">Add a thumbnail</h4>
<div className="imageContainer">
{previewFile && <img src={previewFile} alt="miniature" />}
</div>
Expand All @@ -161,7 +161,7 @@ function AddVideos() {
</div>
<div className="Outlineimageuploader">
<div className="Frame4">
<h4 className="AjouterUneMiniature">Ajouter une cover</h4>
<h4 className="AjouterUneMiniature">Add a cover</h4>
<div className="imageContainer2">
{previewCover && <img src={previewCover} alt="cover" />}
</div>
Expand All @@ -180,7 +180,8 @@ function AddVideos() {
name="name"
className="input"
onChange={(e) => setTitle(e.target.value)}
placeholder="Titre du film"
placeholder="
Movie title"
/>
</div>
<div className="inputContainer">
Expand All @@ -189,7 +190,7 @@ function AddVideos() {
name="name"
className="input"
onChange={(e) => setDuration(e.target.value)}
placeholder="Durée du film"
placeholder="Duration of the movie"
/>
</div>
<div className="inputContainer">
Expand All @@ -198,7 +199,7 @@ function AddVideos() {
name="name"
className="input"
onChange={(e) => setYear(e.target.value)}
placeholder="Année de sortie"
placeholder="Release year"
/>
</div>
<h4>Catégorie du film</h4>
Expand Down Expand Up @@ -231,7 +232,7 @@ function AddVideos() {
</div>
</div>
</div>
<div className="DescriptifDuFilm">Descriptif du film</div>
<div className="DescriptifDuFilm">Description of the film</div>
<div className="Titleinputcontainer4">
<div className="Input">
<textarea
Expand All @@ -243,7 +244,7 @@ function AddVideos() {
</div>
</div>
<div className="Grantingscontainer">
<div className="Autorisation">Autorisation</div>
<div className="Autorisation">Authorisation</div>
<div className="Input">
<input
name="visiteur"
Expand All @@ -254,7 +255,7 @@ function AddVideos() {
checked={isAvailable === "0" || ""}
onChange={(e) => setIsAvailable(e.target.value)}
/>
<div className="Visiteur">Visiteur</div>
<div className="Visiteur">Visitor</div>
</div>
<div className="Input">
<input
Expand All @@ -266,7 +267,7 @@ function AddVideos() {
checked={isAvailable === "1" || ""}
onChange={(e) => setIsAvailable(e.target.value)}
/>
<div className="Visiteur">Utilisateur</div>
<div className="Visiteur">User</div>
</div>
</div>
<div className="Titleinputcontainer">
Expand Down
8 changes: 4 additions & 4 deletions frontend/src/pages/AjoutAdmin.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ function AjoutAdmin() {

const handleClick = async (user) => {
if (currentUser.id === user.id) {
toast.error("Vous ne pouvez pas supprimer votre propre compte");
toast.error("You cannot delete your own account");
return;
}
if (user !== null) {
Expand All @@ -35,9 +35,9 @@ function AjoutAdmin() {
}
);
if (user.IsAdmin) {
toast.success("Admin supprimé");
toast.success("Admin deleted");
} else {
toast.success("Admin ajouté");
toast.success("Admin added");
}

fetch();
Expand All @@ -55,7 +55,7 @@ function AjoutAdmin() {
<div className="ContainerAjoutAdmin">
<LogoContainer />
<div className="NamePage">
<h3>Ajouter des Administrateurs</h3>
<h3>Add Administrators</h3>
</div>
<div className="containerUser">
{users.map((userItem) => (
Expand Down
2 changes: 1 addition & 1 deletion frontend/src/pages/Categories.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Categories() {
<input
className="search-bar"
type="search"
placeholder="Rechercher un film"
placeholder="Search for a movie"
value={searchValue}
onChange={handleSearchChange}
/>
Expand Down
16 changes: 7 additions & 9 deletions frontend/src/pages/Connection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ function Connection() {
navigate("/");
}
} catch (err) {
toast.error("Email ou mot de passe incorrect");
toast.error("Incorrect email or password");
console.error("Incorrect email or password");
}
};
Expand All @@ -57,7 +57,7 @@ function Connection() {
className="input"
name="email"
value={user.email}
placeholder="Adresse Mail :"
placeholder="Mail address :"
onChange={handleInputChange}
/>
</div>
Expand All @@ -67,30 +67,28 @@ function Connection() {
name="password"
value={user.password}
className="input"
placeholder="Mot de passe :"
placeholder="Password :"
onChange={handleInputChange}
/>
</div>
<div className="buttonContainer">
<div className="connectionButton">
<button type="submit" className="connexion">
connexion
connection
</button>
</div>
</div>
</div>
<div className="signUpText">
<p className="tuNAsPasDeCompte">
Tu n’as pas de compte ?<span> </span>
You don't have an account ?<span> </span>
<span>
<NavLink to="/Inscription" className="inscrisToiIci">
Inscris toi ici
Register here
</NavLink>
</span>
<span> </span>
<span className="catalogue">
pour débloquer l’entièreté du catalogue.
</span>
<span className="catalogue">to unlock the entire catalog.</span>
</p>
</div>
</form>
Expand Down
4 changes: 2 additions & 2 deletions frontend/src/pages/EditSection.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -150,14 +150,14 @@ function EditSection() {
<input
className="search-bar"
type="search"
placeholder="Rechercher un film"
placeholder="Search for a movie"
value={searchValue || ""}
onChange={handleSearchChange}
/>
</div>
<div className="titleContainer">
<h2 className="title">
Modification de la section '
Editing the section '
{(categoryName && categoryName) ||
(originalCategoryName && originalCategoryName) ||
""}
Expand Down
12 changes: 6 additions & 6 deletions frontend/src/pages/EditVideo.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,10 @@ function EditVideo() {
video
);
if (response.status === 204) {
toast.success("Video modifié");
toast.success("Edited video");
navigate("/");
} else {
toast.error("Aie un soucis est apparue");
toast.error("A problem appeared");
}
} catch (e) {
console.error("Error for editing");
Expand Down Expand Up @@ -233,7 +233,7 @@ function EditVideo() {
type="button"
onClick={() => handleDeleteCategorie(categorie.unique_key)}
>
<img className="imgCroix" src={croixRouge} alt="croix-rouge" />
<img className="imgCroix" src={croixRouge} alt="Red Cross" />
</button>
</div>
))}
Expand All @@ -243,7 +243,7 @@ function EditVideo() {
name="category"
value={video.categorie}
>
<option value="">Choisir une catégorie</option>
<option value="">Choose a category</option>
{categories
.filter(
(category) =>
Expand All @@ -260,10 +260,10 @@ function EditVideo() {
</form>
<div className="containerButtonEdit">
<button className="editButton" type="button" onClick={handleEditClick}>
Éditer
Edit
</button>
<button className="delete" type="button" onClick={handleDelete}>
Supprimer
Delete
</button>
</div>
</div>
Expand Down
Loading

0 comments on commit 3c3e3fb

Please sign in to comment.