Summary
- This is a summary of your chores
+ {t('summaryOfChores')}
diff --git a/src/views/components/AutocompleteInput.jsx b/src/views/components/AutocompleteInput.jsx
index cc889f5..27cee2f 100644
--- a/src/views/components/AutocompleteInput.jsx
+++ b/src/views/components/AutocompleteInput.jsx
@@ -1,7 +1,9 @@
import { Chip, List, ListItem, ListItemButton, Textarea } from '@mui/joy'
+import { useTranslation } from 'react-i18next'
import React, { useEffect, useRef, useState } from 'react'
const AutocompleteInput = ({ options, ref, value, onChange, ...props }) => {
+ const { t } = useTranslation('common')
const [filteredOptions, setFilteredOptions] = useState([])
const [menuVisible, setMenuVisible] = useState(false)
const [highlightedIndex, setHighlightedIndex] = useState(-1)
@@ -82,7 +84,7 @@ const AutocompleteInput = ({ options, ref, value, onChange, ...props }) => {
value={value}
onChange={onChange}
onKeyDown={handleKeyDown}
- placeholder='Type here...'
+ placeholder={t('autocompletePlaceholder')}
/>
{menuVisible && (
diff --git a/src/views/components/Loading.jsx b/src/views/components/Loading.jsx
index bb70e0e..a8087f3 100644
--- a/src/views/components/Loading.jsx
+++ b/src/views/components/Loading.jsx
@@ -1,31 +1,29 @@
import { Box, Button, CircularProgress, Container } from '@mui/joy'
import { Typography } from '@mui/material'
import { useEffect, useState } from 'react'
+import { useTranslation } from 'react-i18next'
import Logo from '../../Logo'
import { networkManager } from '../../hooks/NetworkManager'
const LoadingComponent = () => {
- const [message, setMessage] = useState('Loading...')
+ const { t } = useTranslation('common')
+ const [message, setMessage] = useState(t('loading'))
const [subMessage, setSubMessage] = useState('')
const [isOnline, setIsOnline] = useState(networkManager.isOnline)
useEffect(() => {
if (!isOnline) {
- setMessage('You are offline')
- setSubMessage(
- 'This not available while offline. Please check your internet connection and try again.',
- )
+ setMessage(t('loadingOffline'))
+ setSubMessage(t('loadingOfflineSub'))
}
- }, [isOnline])
+ }, [isOnline, t])
useEffect(() => {
networkManager.registerNetworkListener(isOnline => setIsOnline(isOnline))
// if loading took more than 5 seconds update submessage to mention there might be an error:
const timeout = setTimeout(() => {
if (networkManager.isOnline) {
- setSubMessage(
- 'This is taking longer than usual. There might be an issue.',
- )
+ setSubMessage(t('loadingSlow'))
}
}, 5000)
return () => clearTimeout(timeout)
@@ -67,7 +65,7 @@ const LoadingComponent = () => {
window.location.href = '/' // navigate back to the home page
}}
>
- Navigate Back
+ {t('navigateBack')}
diff --git a/src/views/components/NavBarMobile.jsx b/src/views/components/NavBarMobile.jsx
index 5fb1100..3792c66 100644
--- a/src/views/components/NavBarMobile.jsx
+++ b/src/views/components/NavBarMobile.jsx
@@ -1,4 +1,5 @@
import * as React from 'react'
+import { useTranslation } from 'react-i18next'
import Box from '@mui/joy/Box'
import ListItemDecorator from '@mui/joy/ListItemDecorator'
import Tabs from '@mui/joy/Tabs'
@@ -10,6 +11,7 @@ import Search from '@mui/icons-material/Search'
import Person from '@mui/icons-material/Person'
export default function NavBarMobile() {
+ const { t } = useTranslation('common')
const [index, setIndex] = React.useState(0)
const colors = ['primary', 'danger', 'success', 'warning']
return (
@@ -32,7 +34,7 @@ export default function NavBarMobile() {
>
setIndex(value)}
sx={theme => ({
@@ -98,7 +100,7 @@ export default function NavBarMobile() {
- Profile
+ {t('profile')}