diff --git a/build-all.sh b/build-all.sh index 4ea903f..e977862 100755 --- a/build-all.sh +++ b/build-all.sh @@ -34,6 +34,7 @@ OUTPUT="${ROOT}/dist/TorrServer" #### Build web echo "Build web" cd "${ROOT}/web" || exit 1 +npm install --silent npm run --silent build-js cp "${ROOT}/web/dest/index.html" "${ROOT}/server/web/pages/template/pages/" diff --git a/web/package.json b/web/package.json index 67224e3..51d7989 100644 --- a/web/package.json +++ b/web/package.json @@ -8,6 +8,8 @@ "axios": "^0.21.1", "clsx": "^1.1.1", "fontsource-roboto": "^4.0.0", + "i18next": "^20.3.1", + "i18next-browser-languagedetector": "^6.1.1", "konva": "^8.0.1", "lodash": "^4.17.21", "material-ui-image": "^3.3.2", @@ -16,6 +18,7 @@ "react-copy-to-clipboard": "^5.0.3", "react-div-100vh": "^0.6.0", "react-dom": "^17.0.2", + "react-i18next": "^11.10.0", "react-konva": "^17.0.2-4", "react-measure": "^2.5.2", "react-scripts": "4.0.3", diff --git a/web/public/index.html b/web/public/index.html index 1fe47d0..41b4208 100644 --- a/web/public/index.html +++ b/web/public/index.html @@ -2,7 +2,7 @@
- + diff --git a/web/src/App/Sidebar.jsx b/web/src/App/Sidebar.jsx index 0f911c8..b6cf730 100644 --- a/web/src/App/Sidebar.jsx +++ b/web/src/App/Sidebar.jsx @@ -11,21 +11,23 @@ import UploadDialog from 'components/Upload' import { CreditCard as CreditCardIcon, List as ListIcon } from '@material-ui/icons' import List from '@material-ui/core/List' import CloseServer from 'components/CloseServer' +import { useTranslation } from 'react-i18next' import { AppSidebarStyle } from './style' export default function Sidebar({ isDrawerOpen, setIsDonationDialogOpen }) { + const { t } = useTranslation() return (