Skip to content

Commit

Permalink
fix: Adds missing translations on upload page
Browse files Browse the repository at this point in the history
  • Loading branch information
StepanLebedevTheodo committed Aug 9, 2023
1 parent 42892b4 commit b679e3f
Show file tree
Hide file tree
Showing 5 changed files with 29 additions and 16 deletions.
25 changes: 13 additions & 12 deletions frontend/app/upload/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ const requiredRolesForUpload: BrainRoleType[] = ["Editor", "Owner"];
const UploadPage = (): JSX.Element => {
const { currentBrain } = useBrainContext();
const { session } = useSupabase();
const { t } = useTranslation(["translation","upload"]);
const { t } = useTranslation(["translation", "upload"]);

if (session === null) {
redirectToLogin();
Expand All @@ -29,9 +29,11 @@ const UploadPage = (): JSX.Element => {
return (
<div className="flex justify-center items-center mt-5">
<div className="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative max-w-md">
<strong className="font-bold mr-1">Oh no!</strong>
<strong className="font-bold mr-1">
{t("ohNo", { ns: "upload" })}
</strong>
<span className="block sm:inline">
{"You need to select a brain first. 🧠💡🥲"}
{t("selectBrainFirst", { ns: "upload" })}
</span>
</div>
</div>
Expand All @@ -44,11 +46,11 @@ const UploadPage = (): JSX.Element => {
return (
<div className="flex justify-center items-center mt-5">
<div className="bg-red-100 border border-red-400 text-red-700 px-4 py-3 rounded relative max-w-md">
<strong className="font-bold mr-1">Oh no!</strong>
<strong className="font-bold mr-1">
{t("ohNo", { ns: "upload" })}
</strong>
<span className="block sm:inline">
{
"You don't have the necessary role to upload content to the selected brain. 🧠💡🥲"
}
{t("missingNecessaryRole", { ns: "upload" })}
</span>
</div>
</div>
Expand All @@ -59,8 +61,8 @@ const UploadPage = (): JSX.Element => {
return (
<main className="pt-10">
<PageHeading
title={t("title",{"ns":"upload"})}
subtitle={t("subtitle",{"ns":"upload"})}
title={t("title", { ns: "upload" })}
subtitle={t("subtitle", { ns: "upload" })}
/>
<FileUploader />
<Divider text={t("or")} className="m-5" />
Expand All @@ -73,14 +75,13 @@ const UploadPage = (): JSX.Element => {
</Link>
</div>
</main>
);
}
);
};

return (
<Suspense fallback="Loading...">
<Upload />
</Suspense>

);
};

Expand Down
5 changes: 4 additions & 1 deletion frontend/public/locales/en/upload.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"addFiles": "Please, add files to upload",
"selectBrain": "Please, select or create a brain to upload a file",
"invalidUrl": "Invalid URL",
"crawlFailed": "Failed to crawl website: {{message}}"
"crawlFailed": "Failed to crawl website: {{message}}",
"ohNo": "Oh no!",
"selectBrainFirst": "You need to select a brain first. 🧠💡🥲",
"missingNecessaryRole": "You don't have the necessary role to upload content to the selected brain. 🧠💡🥲"
}
5 changes: 4 additions & 1 deletion frontend/public/locales/es/upload.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"addFiles": "Por favor, agregar archivos a subir",
"selectBrain": "Por favor, seleccione o cree un cerebro antes de subir un archivo",
"invalidUrl": "URL inválido",
"crawlFailed": "Error al rastrear sitio web: {{message}}"
"crawlFailed": "Error al rastrear sitio web: {{message}}",
"ohNo": "¡Oh no!",
"selectBrainFirst": "Primero debes seleccionar un cerebro. 🧠💡🥲",
"missingNecessaryRole": "No tienes el rol necesario para cargar contenido en el cerebro seleccionado. 🧠💡🥲"
}
5 changes: 4 additions & 1 deletion frontend/public/locales/fr/upload.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"addFiles": "Veuillez ajouter des fichiers à télécharger",
"selectBrain": "Veuillez sélectionner ou créer un cerveau pour télécharger un fichier",
"invalidUrl": "URL invalide",
"crawlFailed": "Échec de l'exploration du site web : {{message}}"
"crawlFailed": "Échec de l'exploration du site web : {{message}}",
"ohNo": "Oh non !",
"selectBrainFirst": "Vous devez d'abord sélectionner un cerveau. 🧠💡🥲",
"missingNecessaryRole": "Vous n'avez pas le rôle nécessaire pour télécharger du contenu dans le cerveau sélectionné. 🧠💡🥲"
}
5 changes: 4 additions & 1 deletion frontend/public/locales/ru/upload.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,5 +11,8 @@
"addFiles": "Пожалуйста, добавьте файлы для загрузки",
"selectBrain": "Пожалуйста, выберите или создайте мозг для загрузки файла",
"invalidUrl": "Неверный URL",
"crawlFailed": "Не удалось извлечь информацию из сайта: {{message}}"
"crawlFailed": "Не удалось извлечь информацию из сайта: {{message}}",
"ohNo": "О нет!",
"selectBrainFirst": "Сначала вам нужно выбрать мозг. 🧠💡🥲",
"missingNecessaryRole": "У вас нет необходимой роли для загрузки контента в выбранный мозг. 🧠💡🥲"
}

0 comments on commit b679e3f

Please sign in to comment.