Skip to content

Commit

Permalink
add fr/en locales to movies/:id
Browse files Browse the repository at this point in the history
  • Loading branch information
mirsella committed Dec 22, 2024
1 parent 3e3e43c commit bd56798
Show file tree
Hide file tree
Showing 3 changed files with 101 additions and 77 deletions.
78 changes: 44 additions & 34 deletions i18n/locales/en.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
{
"modifyProfiles": {
"changePassword": "Change Password",
"changeUsername": "Change Username",
"changeEmail": "Change Email",
"changeName": "Change your First and Last Name",
"changePicture": "Change your Profile Picture",
"modifyUsernames": "Modify Username",
"modifyName": "Modify Name",
"modifyEmail": "Modify Email",
"modifyPassword": "Modify Password",
"modifyPicture": "Modify Picture",
"uploadpicture": "Upload Picture",
"CondtionsPassword": "Password must be at least 8 characters long, include an uppercase letter, a number, and a special character.",
"PasswordValid": "Password valid",
"ClickOrDrag": "Click or drag a file here to upload",
"CompleteUrProfil": "Complete your Profile",
"Register": "Register",
"Submit": "Submit"
},
"modifyProfiles": {
"changePassword": "Change Password",
"changeUsername": "Change Username",
"changeEmail": "Change Email",
"changeName": "Change your First and Last Name",
"changePicture": "Change your Profile Picture",
"modifyUsernames": "Modify Username",
"modifyName": "Modify Name",
"modifyEmail": "Modify Email",
"modifyPassword": "Modify Password",
"modifyPicture": "Modify Picture",
"uploadpicture": "Upload Picture",
"CondtionsPassword": "Password must be at least 8 characters long, include an uppercase letter, a number, and a special character.",
"PasswordValid": "Password valid",
"ClickOrDrag": "Click or drag a file here to upload",
"CompleteUrProfil": "Complete your Profile",
"Register": "Register",
"Submit": "Submit"
},

"userProfiles": {
"username": "Username",
"fullname": "Full Name",
"profilepicture": "Profile Picture",
"comments": "Comments",
"fullnamePlaceholder": "Search by Full Name",
"fullusername": "Search by Username",
"lastname": "Last Name",
"firstname": "First Name"
},
"boutton": {
"UserProfiles": "User Profiles",
"ModifyProfiles": "Modify Profiles",
"SignOut": "Sign Out"
}
"userProfiles": {
"username": "Username",
"fullname": "Full Name",
"profilepicture": "Profile Picture",
"comments": "Comments",
"fullnamePlaceholder": "Search by Full Name",
"fullusername": "Search by Username",
"lastname": "Last Name",
"firstname": "First Name"
},
"boutton": {
"UserProfiles": "User Profiles",
"ModifyProfiles": "Modify Profiles",
"SignOut": "Sign Out"
},
"movies": {
"AddAComment": "add a comment...",
"Comments": "Comments",
"Character": "Character",
"Popularity": "Popularity",
"Companies": "Companies",
"Director": "Director",
"Runtime": "Runtime",
"ReleaseDate": "Release date"
}
}
78 changes: 44 additions & 34 deletions i18n/locales/fr.json
Original file line number Diff line number Diff line change
@@ -1,37 +1,47 @@
{
"modifyProfiles": {
"changePassword": "Changer le mot de passe",
"changeUsername": "Changer le pseudonyme",
"changeEmail": "Changer l'Email",
"changeName": "Changer ton nom et prénom",
"changePicture": "Changer ta photo de profil",
"modifyUsernames": "Modifie ton Pseudonyme",
"modifyName": "Modifie ton Nom",
"modifyEmail": "Modifie ton mail",
"modifyPassword": "Modifie ton Mot de passe",
"modifyPicture": "Modifie ta Photo",
"uploadpicture": "Télécharger une photo",
"CondtionsPassword": "Le mot de passe doit comporter au moins 8 caractères, inclure une lettre majuscule, un chiffre et un caractère spécial.",
"PasswordValid": "Mot de passe valide",
"CompleteUrProfil": "Complétez votre profil",
"ClickOrDrag": "Cliquez ou glissez un fichier ici pour le télécharger",
"Register": "S'inscrire",
"Submit": "Soumettre"
},
"modifyProfiles": {
"changePassword": "Changer le mot de passe",
"changeUsername": "Changer le pseudonyme",
"changeEmail": "Changer l'Email",
"changeName": "Changer ton nom et prénom",
"changePicture": "Changer ta photo de profil",
"modifyUsernames": "Modifie ton Pseudonyme",
"modifyName": "Modifie ton Nom",
"modifyEmail": "Modifie ton mail",
"modifyPassword": "Modifie ton Mot de passe",
"modifyPicture": "Modifie ta Photo",
"uploadpicture": "Télécharger une photo",
"CondtionsPassword": "Le mot de passe doit comporter au moins 8 caractères, inclure une lettre majuscule, un chiffre et un caractère spécial.",
"PasswordValid": "Mot de passe valide",
"CompleteUrProfil": "Complétez votre profil",
"ClickOrDrag": "Cliquez ou glissez un fichier ici pour le télécharger",
"Register": "S'inscrire",
"Submit": "Soumettre"
},

"userProfiles": {
"username": "Pseudonyme",
"fullname": "Nom et Prénom",
"profilepicture": "Photo de profil",
"comments": "Commentaires",
"fullnamePlaceholder": "Rechercher par nom et prénom",
"fullusername": "Rechercher par pseudonyme",
"lastname": "Nom de famille",
"firstname": "Prénom"
},
"boutton": {
"UserProfiles": "Profils d'utilisateurs",
"ModifyProfiles": "Modifier ton profil",
"SignOut": "Deconnexion"
}
"userProfiles": {
"username": "Pseudonyme",
"fullname": "Nom et Prénom",
"profilepicture": "Photo de profil",
"comments": "Commentaires",
"fullnamePlaceholder": "Rechercher par nom et prénom",
"fullusername": "Rechercher par pseudonyme",
"lastname": "Nom de famille",
"firstname": "Prénom"
},
"boutton": {
"UserProfiles": "Profils d'utilisateurs",
"ModifyProfiles": "Modifier ton profil",
"SignOut": "Deconnexion"
},
"movies": {
"AddAComment": "ajouter un commentaire...",
"Comments": "Commentaires",
"Character": "Acteurs",
"Popularity": "Popularité",
"Companies": "Companies",
"Director": "Directeur",
"Runtime": "Durée",
"ReleaseDate": "Date de sorti"
}
}
22 changes: 13 additions & 9 deletions pages/movies/[id].vue
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,7 @@ function video_error() {
const comment_textarea = ref("");
const comments_input = ref<{ [id: string]: string }>({});
watchEffect(() =>
comments.value?.forEach(
(v) => (comments_input.value[v.comments.id] = v.comments.content),
Expand Down Expand Up @@ -97,16 +98,19 @@ async function update_comment(comment_id: string) {
</figure>
<div class="card-body">
<p>{{ infos.overview }}</p>
<p>release date: {{ new Date(infos.release_date).toDateString() }}</p>
<p>runtime: {{ infos.runtime }}m</p>
<p>
{{ $t("movies.ReleaseDate") }}:
{{ new Date(infos.release_date).toDateString() }}
</p>
<p>{{ $t("movies.Runtime") }}: {{ infos.runtime }}m</p>
<p>
note: {{ infos.vote_average }}/10 ({{ infos.vote_count }} votes)
</p>
<p v-if="infos.director && infos.director[0]">
director: {{ infos.director[0].name }}
{{ $t("movies.Director") }}: {{ infos.director[0].name }}
</p>
<p>
companies:
{{ $t("movies.Companies") }}:
{{ infos.production_companies.map((e: any) => e.name).join(", ") }}
</p>
</div>
Expand All @@ -127,23 +131,23 @@ async function update_comment(comment_id: string) {
<p class="card-title mx-auto mt-1">{{ cast.name }}</p>
<div class="card-body !pt-2 gap-0">
<p>
character: <b>{{ cast.character }}</b>
{{ $t("movies.Character") }}: <b>{{ cast.character }}</b>
</p>
<p>popularity: {{ cast.popularity }}</p>
<p>{{ $t("movies.Popularity") }}: {{ cast.popularity }}</p>
</div>
</div>
</div>
</div>

<div class="card bg-base-100 shadow-md shadow-secondary w-full">
<div class="card-body">
<p class="card-title">Comments</p>
<p class="card-title">{{ $t("movies.Comments") }}</p>
<div class="flex md:flex-nowrap flex-wrap items-end gap-4 mt-2">
<textarea
v-model="comment_textarea"
class="textarea textarea-bordered grow"
maxlength="1024"
placeholder="add a comment..."
:placeholder="$t('movies.AddAComment')"
></textarea>
<button
class="btn btn-secondary"
Expand All @@ -161,7 +165,7 @@ async function update_comment(comment_id: string) {
:class="[true ? 'chat-end' : 'chat-start']"
>
<div class="chat-header text-lg ml-1">
user <b>{{ comment.users?.name || "deleted" }}</b> on
user <b>{{ comment.users?.username || "deleted" }}</b> on
<ClientOnly>
{{
new Date(comment.comments.updated_at).toLocaleDateString()
Expand Down

0 comments on commit bd56798

Please sign in to comment.