Skip to content

Commit

Permalink
Merge pull request #1024 from internxt/release/PB-1525-persist-langua…
Browse files Browse the repository at this point in the history
…ge-in-login-and-signup

[PB-1525] feat/persist the language of the website in drive-web
  • Loading branch information
rafijv authored Feb 8, 2024
2 parents 1e88f11 + d167c37 commit 3132178
Show file tree
Hide file tree
Showing 14 changed files with 257 additions and 121 deletions.
1 change: 1 addition & 0 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@
"history": "^4.10.1",
"https-browserify": "^1.0.0",
"i18next": "^22.4.9",
"i18next-browser-languagedetector": "^7.2.0",
"idb": "^6.1.5",
"js-file-download": "^0.4.12",
"jszip": "=3.2.2",
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ export default function InviteAFriend({ className = '' }: { className?: string }
const castedError = errorService.castError(err);
if (castedError.message !== 'Mail invitation daily limit reached') {
notificationsService.show({
text: translate('error.inviteAFriend', { message: castedError.message }),
text: translate('error.inviteAFriendEmpty'),
type: ToastType.Error,
});
setStatus('READY');
Expand Down
5 changes: 2 additions & 3 deletions src/app/core/views/Preferences/tabs/Account/Language.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,9 @@ import dayjs from 'dayjs';
import ItemsDropdown from './components/ItemsDropdown';
import MenuItem from './components/MenuItem';

const localStorageLanguage = localStorageService.get('language');
const localStorageLanguage = localStorageService.get('i18nextLng');

const languages = ['en', 'es', 'fr', 'it', 'cn', 'ru', 'de'];
const languages = ['en', 'es', 'fr', 'it', 'zh', 'ru', 'de'];

export default function Language(): JSX.Element {
const { translate } = useTranslationContext();
Expand All @@ -31,7 +31,6 @@ export default function Language(): JSX.Element {
}, []);

useEffect(() => {
localStorageService.set('language', lang as string);
changeLang(i18next.language);
}, [lang]);
return (
Expand Down
7 changes: 5 additions & 2 deletions src/app/i18n/locales/de.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"es": "Español (Spanisch)",
"fr": "Français (Französisch)",
"it": "Italiano (Italienisch)",
"cn": "简体中文 (Chinesisch)",
"zh": "简体中文 (Chinesisch)",
"ru": "Русский (Russisch)",
"de": "Deutsch (Deutsch)"
},
Expand Down Expand Up @@ -821,6 +821,7 @@
"noFilePreview": "Keine Dateivorschau vorhanden",
"browserNotSupported": "Browser wird nicht unterstützt ({{userAgent}})",
"inviteAFriend": "Fehler beim Senden der Einladung an einen Freund: {{message}}",
"inviteAFriendEmpty": "Fehler beim Senden der Einladung Sie müssen eine E-Mail angeben",
"subscribeToNewsletter": "Fehler beim Abonnieren des Newsletters: {{message}}",
"lastPasswordError": "Das von dir zuletzt eingegebene Passwort scheint ungültig zu sein. Versuche es noch einmal. Wenn das Problem weiterhin besteht, wende dich bitte an unseren Support.",
"incorrectPassword": "Das von dir eingegebene aktuelle Passwort stimmt nicht überein. Achte bitte darauf, dass es richtig ist.",
Expand Down Expand Up @@ -1149,9 +1150,11 @@
},
"dropdown": {
"openPreview": "Öffne Vorschau",
"details": "Einzelheiten",
"shareLink": "Teilen",
"getLink": "Erhalte Link",
"rename": "Umbenennen",
"download": "Download",
"download": "Herunterladen",
"manageLinkAccess": "Zugang verwalten",
"manageAccess": "Zugang verwalten",
"moveToTrash": "In den Papierkorb verschieben",
Expand Down
3 changes: 2 additions & 1 deletion src/app/i18n/locales/en.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@
"es": "Español (Spanish)",
"fr": "Français (French)",
"it": "Italiano (Italian)",
"cn": "简体中文 (Chinese)",
"zh": "简体中文 (Chinese)",
"ru": "Русский (Russian)",
"de": "Deutsch (German)"
},
Expand Down Expand Up @@ -916,6 +916,7 @@
"noFilePreview": "No file preview available",
"browserNotSupported": "Browser not supported ({{userAgent}})",
"inviteAFriend": "Error sending the invitation to a friend: {{message}}",
"inviteAFriendEmpty": "Error sending the invitation: You have to specify an email",
"subscribeToNewsletter": "Error subscribing to newsletter: {{message}}",
"lastPasswordError": "The password you entered as your last seems not to be valid. Try again, and if the problem persists, please contact our support.",
"incorrectPassword": "The current password you introduce doesn't match. Please make sure it is correct.",
Expand Down
6 changes: 4 additions & 2 deletions src/app/i18n/locales/es.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"es": "Español (Español)",
"fr": "Français (Francés)",
"it": "Italiano (Italiano)",
"cn": "简体中文 (Chino)",
"zh": "简体中文 (Chino)",
"ru": "Русский (Ruso)",
"de": "Deutsch (Alemán)"
},
Expand Down Expand Up @@ -894,6 +894,7 @@
"noFilePreview": "No hay vista previa de archivos disponible",
"browserNotSupported": "Navegador no compatible ({{userAgent}})",
"inviteAFriend": "Error al enviar la invitación a un amigo: {{message}}",
"inviteAFriendEmpty": "Error al enviar la invitación: Debe especificar un correo electrónico",
"subscribeToNewsletter": "Error al suscribirse al boletín: {{message}}",
"lastPasswordError": "La contraseña que has introducido como última parece no ser válida. Inténtalo de nuevo y, si el problema persiste, ponte en contacto con nuestro servicio de asistencia.",
"incorrectPassword": "La contraseña no coincide. Asegúrate de que la contraseña que has introducido es correcta.",
Expand Down Expand Up @@ -1242,6 +1243,7 @@
},
"dropdown": {
"openPreview": "Abrir previsualización",
"shareLink": "Compartir",
"getLink": "Copiar enlace",
"details": "Detalles",
"rename": "Renombrar",
Expand Down Expand Up @@ -1346,7 +1348,7 @@
},
"stepTwo": {
"title": "Empecemos...",
"description": "Haga clic en el botón Cargar para cargar su primer archivo."
"description": "Haga clic en el botón Subir archivos para cargar su primer archivo."
}
}
},
Expand Down
113 changes: 67 additions & 46 deletions src/app/i18n/locales/fr.json
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
"es": "Español (Espagnol)",
"fr": "Français (Français)",
"it": "Italiano (Italien)",
"cn": "简体中文 (Chinois)",
"zh": "简体中文 (Chinois)",
"ru": "Русский (Russe)",
"de": "Deutsch (Allemand)"
},
Expand Down Expand Up @@ -136,7 +136,26 @@
"terms": "Termes et conditions",
"contactSupport": "Contacter le support",
"help": "Besoin d'aide ?",
"searchBar": "Rechercher dans ce dossier",
"searchBar": {
"oldSearchBarPlaceholder": "Rechercher dans ce dossier",
"placeholder": "Recherche dans Drive",
"filters": {
"folder": "Dossier",
"pdf": "PDF",
"image": "Image",
"video": "Vidéo",
"audio": "Audio",
"clear": "Clair"
},
"emptyState": {
"title": "Rechercher des fichiers et des dossiers",
"subtitle": "Recherche par nom et par type"
},
"notFoundState": {
"title": "Aucun résultat trouvé",
"subtitle": "Aucun fichier ou dossier ne correspond à la recherche"
}
},
"stage": {
"development": "Développement",
"production": "Production"
Expand Down Expand Up @@ -792,52 +811,53 @@
},
"error": {
"wrongPassword": "Mot de passe incorrect, essayez à nouveau ou contactez le propriétaire.",
"genericError": "There was an error: {{reason}}",
"serverError": "Internal server error. Try again later",
"deleteTeamMember": "Error deleting team member",
"changingName": "Error during name change",
"fileAlreadyExists": "File with the same name already exists",
"folderAlreadyExists": "A folder with the same name already exists",
"folderCannotBeEmpty": "Folder name cannot be empty",
"creatingFolder": "Error during folder creation",
"sendReferralInvitation": "Could not send invitation email",
"sendClaimEmail": "Could not send claim email",
"anyReferralCredit": "You don\t have any credit on your account",
"backupKeyDontMatch": "The backup key inserted does not match your unique backup key",
"shareLinkMissingBucket": "Cannot generate share link due to missing bucket",
"unavailableLink": "Unavailable link",
"invalidActivationCode": "Your activation code is invalid. Maybe you have used this link before and your account is already activated",
"redirectToStripe": "Failed to redirect to Stripe. Please contact us. Reason: {{reason}}",
"deactivatingAccount": "Error deactivating account. Please contact us.",
"fetchingFolderContent": "Error fetching folder content",
"uploadingFolder": "Error uploading folder",
"uploadingFile": "Error uploading file: {{reason}}",
"uploadingItems": "Some of the elements could not be uploaded",
"downloadingFile": "Error downloading file: {{message}}",
"downloadingFolder": "Error downloading folder: {{message}}",
"downloadingItems": "Some of the elements could not be downloaded",
"movingItemInsideItself": "You can't move a folder inside itself",
"movingItem": "Error when moving item/s",
"renamingItem": "Error when renaming item/s",
"linkExpired": "This secure link has expired",
"teamInvitation": "The invitation email could not be sent",
"storageIsFull": "Your storage is full",
"genericError": "Une erreur s'est produite : {{reason}}",
"serverError": "Erreur de serveur interne. Réessayez plus tard",
"deleteTeamMember": "Erreur lors de la suppression d'un membre de l'équipe",
"changingName": "Erreur lors du changement de nom",
"fileAlreadyExists": "Un fichier portant le même nom existe déjà",
"folderAlreadyExists": "Un dossier portant le même nom existe déjà",
"folderCannotBeEmpty": "Le nom du dossier ne peut pas être vide",
"creatingFolder": "Erreur lors de la création d'un dossier",
"sendReferralInvitation": "Impossible d'envoyer le courriel d'invitation",
"sendClaimEmail": "Impossible d'envoyer un courriel de réclamation",
"anyReferralCredit": "Vous n'avez pas de crédit sur votre compte",
"backupKeyDontMatch": "La clé de sauvegarde insérée ne correspond pas à votre clé de sauvegarde unique",
"shareLinkMissingBucket": "Impossible de générer un lien de partage en raison de l'absence d'un panier.",
"unavailableLink": "Lien non disponible",
"invalidActivationCode": "Votre code d'activation n'est pas valide. Vous avez peut-être déjà utilisé ce lien et votre compte est déjà activé.",
"redirectToStripe": "Échec de la redirection vers Stripe. Veuillez nous contacter. Raison : {{reason}}",
"deactivatingAccount": "Erreur lors de la désactivation du compte. Veuillez nous contacter.",
"fetchingFolderContent": "Erreur dans l'extraction du contenu d'un dossier",
"uploadingFolder": "Erreur lors du téléchargement d'un dossier",
"uploadingFile": "Erreur lors du téléchargement du fichier : {{reason}}",
"uploadingItems": "Certains éléments n'ont pas pu être téléchargés",
"downloadingFile": "Erreur de téléchargement du fichier : {{message}}",
"downloadingFolder": "Erreur de téléchargement du dossier : {{message}}",
"downloadingItems": "Certains éléments n'ont pas pu être téléchargés",
"movingItemInsideItself": "Vous ne pouvez pas déplacer un dossier à l'intérieur de lui-même",
"movingItem": "Erreur lors du déplacement d'éléments",
"renamingItem": "Erreur lors du renommage d'éléments",
"linkExpired": "Ce lien sécurisé a expiré",
"teamInvitation": "Le courriel d'invitation n'a pas pu être envoyé",
"storageIsFull": "Votre espace de stockage est plein",
"storageIsFullDescription": "Vous ne pouvez pas télécharger, synchroniser ou sauvegarder des fichiers.",
"noSpaceAvailable": "You’ve reached the limits of your current plan and sync has stopped. Upgrade now to keep your files synced securely.",
"sharedFolderTooBig": "Internxt Drive does not support sharing folders of more than 1GB.",
"titleSharedFolderTooBig": "Unsupported Action",
"workingOnIt": "We are working to bring you a better experience.",
"noFilePreview": "No file preview available",
"browserNotSupported": "Browser not supported ({{userAgent}})",
"inviteAFriend": "Error sending the invitation to a friend: {{message}}",
"subscribeToNewsletter": "Error subscribing to newsletter: {{message}}",
"lastPasswordError": "The password you entered as your last seems not to be valid. Try again, and if the problem persists, please contact our support.",
"incorrectPassword": "The current password you introduce doesn't match. Please make sure it is correct.",
"emptyPassword": "Previous password must not be empty",
"noSpaceAvailable": "Vous avez atteint les limites de votre plan actuel et la synchronisation s'est arrêtée. Mettez-le à jour maintenant pour continuer à synchroniser vos fichiers en toute sécurité.",
"sharedFolderTooBig": "Internxt Drive ne prend pas en charge le partage de dossiers de plus de 1 Go.",
"titleSharedFolderTooBig": "Action non soutenue",
"workingOnIt": "Nous nous efforçons de vous offrir une meilleure expérience.",
"noFilePreview": "Pas d'aperçu de fichier disponible",
"browserNotSupported": "Navigateur non pris en charge ({{userAgent}})",
"inviteAFriend": "Erreur lors de l'envoi de l'invitation à un ami : {{message}}",
"inviteAFriendEmpty": "Erreur lors de l'envoi de l'invitation : Vous devez spécifier un email",
"subscribeToNewsletter": "Erreur d'inscription à la lettre d'information : {{message}}",
"lastPasswordError": "Le mot de passe que vous avez saisi en dernier semble ne pas être valide. Essayez à nouveau, et si le problème persiste, contactez notre support.",
"incorrectPassword": "Le mot de passe actuel que vous avez introduit ne correspond pas. Veuillez vous assurer qu'il est correct.",
"emptyPassword": "Le mot de passe précédent ne doit pas être vide",
"errorMovingToTrash": "Error lors du déplacement des éléments.",
"braveNotSupportMultiplePhotosDowload": "Brave doesn't support multiple photo downloads.",
"maxSizeUploadLimitError": "File too large (greater than 10GB)",
"connectionLostError": "Connexion Internet perdue",
"braveNotSupportMultiplePhotosDowload": "Brave ne prend pas en charge le téléchargement de plusieurs photos.",
"maxSizeUploadLimitError": "Fichier trop volumineux (plus de 10GB)",
"connectionLostError": "Lost Internet connection",
"errorLoadingTrashItems": "Erreur de chargement des éléments de la corbeille"
},
"backups": {
Expand Down Expand Up @@ -1174,6 +1194,7 @@
"openPreview": "Ouvrir la prévisualisation",
"getLink": "Copier le lien",
"details": "Détails",
"shareLink": "Partager",
"rename": "Renommer",
"manageLinkAccess": "Gestion de l'accès",
"manageAccess": "Gestion de l'accès",
Expand Down
Loading

0 comments on commit 3132178

Please sign in to comment.