2021-03-16 01:33:19 +01:00
|
|
|
import { FC } from "react";
|
2021-06-12 22:44:56 +02:00
|
|
|
import Head from "next/head";
|
2021-04-08 22:28:45 +02:00
|
|
|
import NextLink from "next/link";
|
2021-03-16 23:58:12 +01:00
|
|
|
import { Flex, HStack, IconButton, Link, useColorModeValue } from "@chakra-ui/react";
|
2021-03-16 01:33:19 +01:00
|
|
|
import { FaGithub } from "react-icons/fa";
|
feat: add admin panel, Replicate AI translation, and document translation
- Admin panel (/admin) with JWT auth: configure Replicate API token,
JigsawStack API key, model version, enable/disable AI translation,
change admin password. Settings persisted in data/settings.json.
- Replicate AI translation: POST /api/translate/replicate uses
JigsawStack text-translate model via Replicate API. Main page
switches to client-side AI translation when enabled.
- Document translation tab: supports PDF, DOCX, XLSX, XLS, CSV.
Excel/Word formatting fully preserved (SheetJS + JSZip XML manipulation).
PDF uses pdf-parse extraction + pdf-lib reconstruction.
Column selector UI for tabular data (per-sheet, All/None toggles).
- Updated README with full implementation documentation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 07:43:54 +01:00
|
|
|
import { FiSettings } from "react-icons/fi";
|
2021-03-16 01:33:19 +01:00
|
|
|
import Image from "next/image";
|
2021-06-12 22:44:56 +02:00
|
|
|
import { ColorModeToggler } from ".";
|
2021-03-16 01:33:19 +01:00
|
|
|
|
|
|
|
|
type Props = {
|
|
|
|
|
[key: string]: any
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
const Header: FC<Props> = (props) => (
|
2021-06-12 22:44:56 +02:00
|
|
|
<>
|
|
|
|
|
<Head>
|
|
|
|
|
<link rel="prefetch" href="/banner_light.svg" />
|
|
|
|
|
<link rel="prefetch" href="/banner_dark.svg" />
|
|
|
|
|
</Head>
|
|
|
|
|
|
|
|
|
|
<Flex
|
|
|
|
|
as="header"
|
|
|
|
|
px={1}
|
|
|
|
|
py={3}
|
|
|
|
|
justify="space-around"
|
|
|
|
|
align="center"
|
|
|
|
|
w="full"
|
|
|
|
|
{...props}
|
|
|
|
|
>
|
|
|
|
|
<NextLink href="/" passHref={true}>
|
|
|
|
|
<Link display="flex">
|
|
|
|
|
<Image
|
|
|
|
|
src={useColorModeValue("/banner_light.svg", "/banner_dark.svg")}
|
|
|
|
|
alt="Logo"
|
|
|
|
|
width={110}
|
|
|
|
|
height={64}
|
|
|
|
|
/>
|
|
|
|
|
</Link>
|
|
|
|
|
</NextLink>
|
|
|
|
|
<HStack spacing={3}>
|
|
|
|
|
<ColorModeToggler
|
|
|
|
|
variant={useColorModeValue("outline", "solid")}
|
|
|
|
|
/>
|
feat: add admin panel, Replicate AI translation, and document translation
- Admin panel (/admin) with JWT auth: configure Replicate API token,
JigsawStack API key, model version, enable/disable AI translation,
change admin password. Settings persisted in data/settings.json.
- Replicate AI translation: POST /api/translate/replicate uses
JigsawStack text-translate model via Replicate API. Main page
switches to client-side AI translation when enabled.
- Document translation tab: supports PDF, DOCX, XLSX, XLS, CSV.
Excel/Word formatting fully preserved (SheetJS + JSZip XML manipulation).
PDF uses pdf-parse extraction + pdf-lib reconstruction.
Column selector UI for tabular data (per-sheet, All/None toggles).
- Updated README with full implementation documentation.
Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2026-03-10 07:43:54 +01:00
|
|
|
<NextLink href="/admin" passHref={true}>
|
|
|
|
|
<IconButton
|
|
|
|
|
as={Link}
|
|
|
|
|
aria-label="Admin settings"
|
|
|
|
|
icon={<FiSettings />}
|
|
|
|
|
colorScheme="lingva"
|
|
|
|
|
variant={useColorModeValue("outline", "solid")}
|
|
|
|
|
/>
|
|
|
|
|
</NextLink>
|
2021-06-12 22:44:56 +02:00
|
|
|
<IconButton
|
|
|
|
|
as={Link}
|
2022-06-15 23:37:15 +02:00
|
|
|
href="https://github.com/thedaviddelta/lingva-translate"
|
2021-06-12 22:44:56 +02:00
|
|
|
isExternal={true}
|
|
|
|
|
aria-label="GitHub"
|
|
|
|
|
icon={<FaGithub />}
|
|
|
|
|
colorScheme="lingva"
|
|
|
|
|
variant={useColorModeValue("outline", "solid")}
|
2021-04-08 22:28:45 +02:00
|
|
|
/>
|
2021-06-12 22:44:56 +02:00
|
|
|
</HStack>
|
|
|
|
|
</Flex>
|
|
|
|
|
</>
|
2021-03-16 01:33:19 +01:00
|
|
|
);
|
|
|
|
|
|
|
|
|
|
export default Header;
|