Skip to content

Commit

Permalink
⚡ traductions added
Browse files Browse the repository at this point in the history
  • Loading branch information
Joliwood committed May 29, 2024
1 parent f04cd45 commit 0788732
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
6 changes: 5 additions & 1 deletion public/locales/en/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"COOKIE_BANNER_TXT": "By continuing to browse this site, you accept the use of cookies to provide you with a better browsing experience. By clicking on \"Accept\", you allow us to store optional cookies on your device, in order to give you the best possible experience. By clicking on \"Decline\", you refuse the use of optionnal cookies. No personal data is stored and cookies are not used for advertising content.",
"CREATE_ALBUM_HEADER": "Create an album",
"CREATE_ALBUM_MISSING_TITLE_ERROR": "Enter an album title.",
"CREATE_ALBUM_NO_TRACKS": "You don't have any songs in your album yet.",
"CREATE_ALBUM_NO_TRACKS_ADDED": "You haven't added any songs yet. To create your first album you need to upload at least one song.",
"CREATE_ALBUM_NO_TRACKS_ERROR": "Add at least one song to your album.",
"CREATE_ALBUM_NO_TRACKS": "You don't have any songs in your album yet.",
"CREATE_ALBUM_ORDER_INPUT": "Order :",
"CREATE_ALBUM_ORDER_LABEL": "You can change the order of the songs by dragging and dropping them",
"CREATE_ALBUM_SONGS_INPUT": "Songs selection* :",
Expand Down Expand Up @@ -37,6 +37,8 @@
"DELETE_ACCOUNT_CONFIRM": "Are you sure you want to delete your account ? This action is irreversible.",
"DELETE_ACCOUNT_ERROR": "An error occured, please try again later",
"DELETE_ACCOUNT_SUCCESS": "Your account has been deleted successfully",
"DELETE_ALBUM_ERROR": "An error occured, please try again later",
"DELETE_ALBUM_SUCCESS": "The album has been deleted successfully",
"DELETE_SONG_ERROR": "An error occured, please try again later",
"DELETE_SONG_SUCCESS": "The song has been deleted successfully",
"FAVORITES_PAGE_EMPTY": "You haven't added songs to your favorites yet, click on the button bellow and start exploring our catalog.",
Expand Down Expand Up @@ -72,6 +74,8 @@
"SIGNUP_MODAL_SUCCESS": "Your account has been created successfully, you can now log in.",
"SIGNUP_MODAL_TITLE": "Create an account on Soundy",
"TEST": "This is a test for the translation",
"UPDATE_ALBUM_ERROR": "An error occured, please try again later",
"UPDATE_ALBUM_SUCCESS": "The album has been updated successfully",
"UPDATE_SONG_SUCCESS": "The song has been updated successfully",
"WELCOME": "Welcome to Soundy"
}
6 changes: 5 additions & 1 deletion public/locales/fr/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@
"COOKIE_BANNER_TXT": "Nous utilisons des cookies pour vous offrir la meilleure expérience possible lors de votre visite sur notre site Internet. En cliquant sur \"Accepter\", vous nous autorisez à stocker des cookies supplémentaires sur votre navigateur afin de rendre votre expérience plus agréable. En cliquant sur \"Refuser\", vous n'utiliserez pas de cookies optionnels. Aucune données personnelles n'est stockées et ces cookies ne sont pas utilisés à des fins publicitaires",
"CREATE_ALBUM_HEADER": "Créer un album",
"CREATE_ALBUM_MISSING_TITLE_ERROR": "Titre d'album requis.",
"CREATE_ALBUM_NO_TRACKS": "Vous n'avez pas encore ajouté de titres à votre album",
"CREATE_ALBUM_NO_TRACKS_ADDED": "Vous n'avez pas encore ajouté de chansons. Veuillez en ajouter une au minimum pour pouvoir créer votre premier album.",
"CREATE_ALBUM_NO_TRACKS_ERROR": "Ajoutez au moins un titre à votre album",
"CREATE_ALBUM_NO_TRACKS": "Vous n'avez pas encore ajouté de titres à votre album",
"CREATE_ALBUM_ORDER_INPUT": "Ordre :",
"CREATE_ALBUM_ORDER_LABEL": "Vous pouvez choisir l'ordre des chansons en les déplaçant",
"CREATE_ALBUM_SONGS_INPUT": "Sélection des titres* :",
Expand Down Expand Up @@ -37,6 +37,8 @@
"DELETE_ACCOUNT_CONFIRM": "Êtes-vous sûr de vouloir supprimer votre compte ? Cette action est irréversible.",
"DELETE_ACCOUNT_ERROR": "Une erreur est survenue lors de la suppression de votre compte. Veuillez réessayer plus tard.",
"DELETE_ACCOUNT_SUCCESS": "Votre compte a bien été supprimé",
"DELETE_ALBUM_ERROR": "Une erreur est survenue lors de la suppression de l'album. Veuillez réessayer plus tard.",
"DELETE_ALBUM_SUCCESS": "L'album a bien été supprimé",
"DELETE_SONG_ERROR": "Une erreur est survenue lors de la suppression du son. Veuillez réessayer plus tard.",
"DELETE_SONG_SUCCESS": "Le son a bien été supprimé",
"FAVORITES_PAGE_EMPTY": "Vous n'avez pas encore ajouté de titres à vos favoris. Cliquez sur le bouton ci-dessous pour commencer à explorer notre catalogue.",
Expand Down Expand Up @@ -74,6 +76,8 @@
"SIGNUP_MODAL_SUCCESS": "Votre compte a bien été créé ! Vous pouvez maintenant vous connecter.",
"SIGNUP_MODAL_TITLE": "Créez un compte sur Soundy",
"TEST": "C'est un test pour la traduction",
"UPDATE_ALBUM_ERROR": "Une erreur est survenue lors de la mise à jour de l'album. Veuillez réessayer plus tard.",
"UPDATE_ALBUM_SUCCESS": "L'album a bien été mis à jour",
"UPDATE_SONG_SUCCESS": "Le son a bien été mis à jour",
"WELCOME": "Bienvenue sur Soundy"
}
4 changes: 2 additions & 2 deletions src/components/profilePage/ProfileDeleteAlbum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const ProfileDeleteSong = (props: Props) => {
const response = await DeleteAlbumAction();

if (response) {
newToast('success', t('DELETE_SONG_SUCCESS', { ns: 'translation' }));
newToast('success', t('DELETE_ALBUM_SUCCESS', { ns: 'translation' }));
closeModal();
}
} catch (error) {
Expand All @@ -60,7 +60,7 @@ const ProfileDeleteSong = (props: Props) => {
return;
}

newToast('error', t('DELETE_SONG_ERROR', { ns: 'translation' }));
newToast('error', t('DELETE_ALBUM_ERROR', { ns: 'translation' }));
}
}, [DeleteAlbumAction, closeModal, deleteAlbumError, newToast, t]);

Expand Down
16 changes: 7 additions & 9 deletions src/components/profilePage/ProfileUpdateAlbum.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,6 @@ const ProfileUpdateAlbum = (props: Props): JSX.Element => {
},
);

// WIP - Il reste le tri avec le drag and drop

useEffect(() => {
if (data?.songs != null) {
setSongsUserHas(data.songs);
Expand Down Expand Up @@ -87,7 +85,7 @@ const ProfileUpdateAlbum = (props: Props): JSX.Element => {
const response = await updateAlbumAction();

if (response) {
newToast('success', t('UPDATE_SONG_SUCCESS', { ns: 'translation' }));
newToast('success', t('UPDATE_ALBUM_SUCCESS', { ns: 'translation' }));
closeModal();
}
} catch (error) {
Expand All @@ -108,7 +106,7 @@ const ProfileUpdateAlbum = (props: Props): JSX.Element => {
return;
}

newToast('error', t('DELETE_ACCOUNT_ERROR', { ns: 'translation' }));
newToast('error', t('UPDATE_ALBUM_ERROR', { ns: 'translation' }));
}
}, [updateAlbumAction, newToast, t, updateAlbumError]);

Expand Down Expand Up @@ -173,7 +171,7 @@ const ProfileUpdateAlbum = (props: Props): JSX.Element => {
return (
<label htmlFor="songs" className="mb-5">
<div className="label">
<span className="label-text text-lg font-semibold">{t('CREATE_ALBUM_SONGS_INPUT')}</span>
<span className="label-text text-lg font-semibold">{t('CREATE_ALBUM_SONGS_INPUT', { ns: 'translation' })}</span>
</div>
<div className="divider my-0 mb-4" />
<CreateAlbumSongsSelection
Expand All @@ -191,7 +189,7 @@ const ProfileUpdateAlbum = (props: Props): JSX.Element => {
return (
<label htmlFor="selected_songs" className="">
<div className="label">
<span className="label-text text-lg font-semibold">{t('CREATE_ALBUM_ORDER_INPUT')}</span>
<span className="label-text text-lg font-semibold">{t('CREATE_ALBUM_ORDER_INPUT', { ns: 'translation' })}</span>
</div>
<div className="divider my-0 mb-4" />
<CreateAlbumSongsOrder
Expand All @@ -201,7 +199,7 @@ const ProfileUpdateAlbum = (props: Props): JSX.Element => {
<p className="label-text font-semibold mt-4 text-center">
{selectedSongs.length}
{' '}
{t('CREATE_ALBUM_TRACKS_NUMBER')}
{t('CREATE_ALBUM_TRACKS_NUMBER', { ns: 'translation' })}
{' - '}
{secondsToFormatedDuration(selectedSongs.reduce((acc, song) => acc + song.duration, 0))}
</p>
Expand All @@ -211,10 +209,10 @@ const ProfileUpdateAlbum = (props: Props): JSX.Element => {
return (
<div className="">
<div className="label">
<span className="label-text text-lg font-semibold">{t('CREATE_ALBUM_ORDER_INPUT')}</span>
<span className="label-text text-lg font-semibold">{t('CREATE_ALBUM_ORDER_INPUT', { ns: 'translation' })}</span>
</div>
<div className="divider my-0 mb-4" />
<p className="mt-4 font-semibold text-center">{t('CREATE_ALBUM_NO_TRACKS')}</p>
<p className="mt-4 font-semibold text-center">{t('CREATE_ALBUM_NO_TRACKS', { ns: 'translation' })}</p>
</div>
);
}, [selectedSongs, songsAlbumHas, t]);
Expand Down

0 comments on commit 0788732

Please sign in to comment.