Spaces:
Running
Running
Tai Truong
commited on
Commit
·
3b75641
1
Parent(s):
402282a
translate to norsk
Browse files- src/frontend/src/components/core/folderSidebarComponent/components/sideBarFolderButtons/index.tsx +3 -2
- src/frontend/src/i18n/locales/en/translation.json +1 -0
- src/frontend/src/i18n/locales/no/translation.json +1 -0
- src/frontend/src/pages/MainPage/components/header/index.tsx +1 -1
- src/frontend/src/pages/MainPage/oldComponents/myCollectionComponent/components/inputSearchComponent/index.tsx +5 -3
- src/frontend/src/pages/MainPage/pages/emptyPage/index.tsx +4 -2
src/frontend/src/components/core/folderSidebarComponent/components/sideBarFolderButtons/index.tsx
CHANGED
|
@@ -21,7 +21,7 @@ import { getObjectsFromFilelist } from "@/helpers/get-objects-from-filelist";
|
|
| 21 |
import useUploadFlow from "@/hooks/flows/use-upload-flow";
|
| 22 |
import { useIsMobile } from "@/hooks/use-mobile";
|
| 23 |
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
| 24 |
-
import { useEffect, useRef, useState } from "react";
|
| 25 |
import { useLocation, useParams } from "react-router-dom";
|
| 26 |
import { FolderType } from "../../../../../pages/MainPage/entities";
|
| 27 |
import useAlertStore from "../../../../../stores/alertStore";
|
|
@@ -66,6 +66,7 @@ const SideBarFoldersButtonsComponent = ({
|
|
| 66 |
const folderIdDragging = useFolderStore((state) => state.folderIdDragging);
|
| 67 |
const myCollectionId = useFolderStore((state) => state.myCollectionId);
|
| 68 |
const takeSnapshot = useFlowsManagerStore((state) => state.takeSnapshot);
|
|
|
|
| 69 |
|
| 70 |
const folderId = useParams().folderId ?? myCollectionId ?? "";
|
| 71 |
|
|
@@ -191,7 +192,7 @@ const SideBarFoldersButtonsComponent = ({
|
|
| 191 |
mutateAddFolder(
|
| 192 |
{
|
| 193 |
data: {
|
| 194 |
-
name: "
|
| 195 |
parent_id: null,
|
| 196 |
description: "",
|
| 197 |
},
|
|
|
|
| 21 |
import useUploadFlow from "@/hooks/flows/use-upload-flow";
|
| 22 |
import { useIsMobile } from "@/hooks/use-mobile";
|
| 23 |
import { useIsFetching, useIsMutating } from "@tanstack/react-query";
|
| 24 |
+
import { useEffect, useRef, useState, useTransition } from "react";
|
| 25 |
import { useLocation, useParams } from "react-router-dom";
|
| 26 |
import { FolderType } from "../../../../../pages/MainPage/entities";
|
| 27 |
import useAlertStore from "../../../../../stores/alertStore";
|
|
|
|
| 66 |
const folderIdDragging = useFolderStore((state) => state.folderIdDragging);
|
| 67 |
const myCollectionId = useFolderStore((state) => state.myCollectionId);
|
| 68 |
const takeSnapshot = useFlowsManagerStore((state) => state.takeSnapshot);
|
| 69 |
+
const { t } = useTransition()
|
| 70 |
|
| 71 |
const folderId = useParams().folderId ?? myCollectionId ?? "";
|
| 72 |
|
|
|
|
| 192 |
mutateAddFolder(
|
| 193 |
{
|
| 194 |
data: {
|
| 195 |
+
name: t("folder.newFolder"),
|
| 196 |
parent_id: null,
|
| 197 |
description: "",
|
| 198 |
},
|
src/frontend/src/i18n/locales/en/translation.json
CHANGED
|
@@ -257,6 +257,7 @@
|
|
| 257 |
"keyboardShortcut": "Keyboard Shortcut"
|
| 258 |
},
|
| 259 |
"folder": {
|
|
|
|
| 260 |
"empty": "Empty folder",
|
| 261 |
"startBuilding": "Start building",
|
| 262 |
"beginTemplate": "Begin with a template, or start from scratch",
|
|
|
|
| 257 |
"keyboardShortcut": "Keyboard Shortcut"
|
| 258 |
},
|
| 259 |
"folder": {
|
| 260 |
+
"newFolder": "New Folder",
|
| 261 |
"empty": "Empty folder",
|
| 262 |
"startBuilding": "Start building",
|
| 263 |
"beginTemplate": "Begin with a template, or start from scratch",
|
src/frontend/src/i18n/locales/no/translation.json
CHANGED
|
@@ -250,6 +250,7 @@
|
|
| 250 |
}
|
| 251 |
},
|
| 252 |
"folder": {
|
|
|
|
| 253 |
"empty": "Tom mappe",
|
| 254 |
"startBuilding": "Start å bygge",
|
| 255 |
"beginTemplate": "Begynn med en mal, eller start fra bunnen av.",
|
|
|
|
| 250 |
}
|
| 251 |
},
|
| 252 |
"folder": {
|
| 253 |
+
"newFolder": "Ny Mappe",
|
| 254 |
"empty": "Tom mappe",
|
| 255 |
"startBuilding": "Start å bygge",
|
| 256 |
"beginTemplate": "Begynn med en mal, eller start fra bunnen av.",
|
src/frontend/src/pages/MainPage/components/header/index.tsx
CHANGED
|
@@ -150,7 +150,7 @@ const HeaderComponent = ({
|
|
| 150 |
className="h-4 w-4"
|
| 151 |
/>
|
| 152 |
<span className="hidden whitespace-nowrap font-semibold md:inline">
|
| 153 |
-
|
| 154 |
</span>
|
| 155 |
</Button>
|
| 156 |
</ShadTooltip>
|
|
|
|
| 150 |
className="h-4 w-4"
|
| 151 |
/>
|
| 152 |
<span className="hidden whitespace-nowrap font-semibold md:inline">
|
| 153 |
+
{t("flows.newFlow")}
|
| 154 |
</span>
|
| 155 |
</Button>
|
| 156 |
</ShadTooltip>
|
src/frontend/src/pages/MainPage/oldComponents/myCollectionComponent/components/inputSearchComponent/index.tsx
CHANGED
|
@@ -1,6 +1,7 @@
|
|
| 1 |
import { ChangeEvent, KeyboardEvent } from "react";
|
| 2 |
import ForwardedIconComponent from "../../../../../../components/common/genericIconComponent";
|
| 3 |
import { Input } from "../../../../../../components/ui/input";
|
|
|
|
| 4 |
|
| 5 |
type InputSearchComponentProps = {
|
| 6 |
loading: boolean;
|
|
@@ -20,14 +21,15 @@ const InputSearchComponent = ({
|
|
| 20 |
onKeyDown,
|
| 21 |
}: InputSearchComponentProps) => {
|
| 22 |
const pagePath = window.location.pathname;
|
|
|
|
| 23 |
|
| 24 |
const getSearchPlaceholder = () => {
|
| 25 |
if (pagePath.includes("flows")) {
|
| 26 |
-
return "
|
| 27 |
} else if (pagePath.includes("components")) {
|
| 28 |
-
return "
|
| 29 |
} else {
|
| 30 |
-
return "
|
| 31 |
}
|
| 32 |
};
|
| 33 |
|
|
|
|
| 1 |
import { ChangeEvent, KeyboardEvent } from "react";
|
| 2 |
import ForwardedIconComponent from "../../../../../../components/common/genericIconComponent";
|
| 3 |
import { Input } from "../../../../../../components/ui/input";
|
| 4 |
+
import { useTranslation } from "react-i18next";
|
| 5 |
|
| 6 |
type InputSearchComponentProps = {
|
| 7 |
loading: boolean;
|
|
|
|
| 21 |
onKeyDown,
|
| 22 |
}: InputSearchComponentProps) => {
|
| 23 |
const pagePath = window.location.pathname;
|
| 24 |
+
const { t } = useTranslation();
|
| 25 |
|
| 26 |
const getSearchPlaceholder = () => {
|
| 27 |
if (pagePath.includes("flows")) {
|
| 28 |
+
return t("flows.search");
|
| 29 |
} else if (pagePath.includes("components")) {
|
| 30 |
+
return t("components.search");
|
| 31 |
} else {
|
| 32 |
+
return t("mainPage.header.search");
|
| 33 |
}
|
| 34 |
};
|
| 35 |
|
src/frontend/src/pages/MainPage/pages/emptyPage/index.tsx
CHANGED
|
@@ -3,6 +3,7 @@ import ForwardedIconComponent from "@/components/common/genericIconComponent";
|
|
| 3 |
import { Button } from "@/components/ui/button";
|
| 4 |
import { ENABLE_NEW_LOGO } from "@/customization/feature-flags";
|
| 5 |
import { useFolderStore } from "@/stores/foldersStore";
|
|
|
|
| 6 |
|
| 7 |
type EmptyPageProps = {
|
| 8 |
setOpenModal: (open: boolean) => void;
|
|
@@ -10,6 +11,7 @@ type EmptyPageProps = {
|
|
| 10 |
|
| 11 |
export const EmptyPage = ({ setOpenModal }: EmptyPageProps) => {
|
| 12 |
const folders = useFolderStore((state) => state.folders);
|
|
|
|
| 13 |
|
| 14 |
return (
|
| 15 |
<div className="m-0 h-full w-full bg-secondary p-0">
|
|
@@ -27,7 +29,7 @@ export const EmptyPage = ({ setOpenModal }: EmptyPageProps) => {
|
|
| 27 |
{folders?.length > 1 ? "Empty folder" : "Start building"}
|
| 28 |
</h3>
|
| 29 |
<p className="pb-5 text-sm text-secondary-foreground">
|
| 30 |
-
|
| 31 |
</p>
|
| 32 |
<Button
|
| 33 |
variant="default"
|
|
@@ -40,7 +42,7 @@ export const EmptyPage = ({ setOpenModal }: EmptyPageProps) => {
|
|
| 40 |
className="h-4 w-4"
|
| 41 |
/>
|
| 42 |
<span className="hidden whitespace-nowrap font-semibold md:inline">
|
| 43 |
-
|
| 44 |
</span>
|
| 45 |
</Button>
|
| 46 |
</div>
|
|
|
|
| 3 |
import { Button } from "@/components/ui/button";
|
| 4 |
import { ENABLE_NEW_LOGO } from "@/customization/feature-flags";
|
| 5 |
import { useFolderStore } from "@/stores/foldersStore";
|
| 6 |
+
import { useTranslation } from "react-i18next";
|
| 7 |
|
| 8 |
type EmptyPageProps = {
|
| 9 |
setOpenModal: (open: boolean) => void;
|
|
|
|
| 11 |
|
| 12 |
export const EmptyPage = ({ setOpenModal }: EmptyPageProps) => {
|
| 13 |
const folders = useFolderStore((state) => state.folders);
|
| 14 |
+
const { t } = useTranslation();
|
| 15 |
|
| 16 |
return (
|
| 17 |
<div className="m-0 h-full w-full bg-secondary p-0">
|
|
|
|
| 29 |
{folders?.length > 1 ? "Empty folder" : "Start building"}
|
| 30 |
</h3>
|
| 31 |
<p className="pb-5 text-sm text-secondary-foreground">
|
| 32 |
+
{t("folder.beginTemplate")}
|
| 33 |
</p>
|
| 34 |
<Button
|
| 35 |
variant="default"
|
|
|
|
| 42 |
className="h-4 w-4"
|
| 43 |
/>
|
| 44 |
<span className="hidden whitespace-nowrap font-semibold md:inline">
|
| 45 |
+
{t("flows.newFlow")}
|
| 46 |
</span>
|
| 47 |
</Button>
|
| 48 |
</div>
|