Skip to content

Commit

Permalink
Merge pull request #117 from DRincs-Productions/116-italian-translation
Browse files Browse the repository at this point in the history
116 italian translation
  • Loading branch information
BlackRam-oss authored Jan 2, 2024
2 parents 341bf5a + 3bc32d7 commit d5da699
Show file tree
Hide file tree
Showing 16 changed files with 430 additions and 413 deletions.
2 changes: 1 addition & 1 deletion .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ body:
- Linux
- MacOS
- Android
- IOS
- iOS
validations:
required: true
- type: dropdown
Expand Down
17 changes: 8 additions & 9 deletions src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import Support from 'page/Support';
import Translations from 'page/Translations';
import Wiki from 'page/Wiki';
import { useState } from 'react';
import { useTranslation } from 'react-i18next';
import { BrowserRouter, Route, Routes } from 'react-router-dom';
import { RecoilRoot } from 'recoil';
import { geturlwebapi } from 'services/BaseRestService';
Expand All @@ -24,24 +25,22 @@ axios.get(geturlwebapi() + "/discord/awakens").catch((err) => {
})

function App() {
// if (process.env.NODE_ENV !== 'production') {
// console.log('🛠️Looks like we are in development mode!');
// }
const { t } = useTranslation(["translation"]);
const routes = [
{ title: "about", path: "/", element: <About /> },
{ title: "⬇️download", path: "/download", element: <Download /> },
{ title: t("about").toLocaleLowerCase(), path: "/", element: <About /> },
{ title: "⬇️" + t("download").toLocaleLowerCase(), path: "/download", element: <Download /> },
// { title: "🗞️news", path: "/news", element: <News /> },
{ title: "🌍translations", path: "/translations", element: <Translations /> },
{ title: "📖wiki", path: "/wiki", element: <Wiki routeLink="wiki" urlRepo={ABFDrepo} /> },
{ title: "🐞bug/request", path: "/report", element: <Report /> },
{ title: "🌍" + t("translations").toLocaleLowerCase(), path: "/translations", element: <Translations /> },
{ title: "📖" + t("wiki").toLocaleLowerCase(), path: "/wiki", element: <Wiki routeLink="wiki" urlRepo={ABFDrepo} /> },
{ title: "🐞" + t("bug/requests").toLocaleLowerCase(), path: "/report", element: <Report /> },
];
const extern_link: IPageDRNavbar[] = [
{ title: "💬discord", path: discordLink },
{
title: "GitHub", path: gitHubLink
},
];
const supportRoute = { title: "support me", path: "/support", element: <Support /> }
const supportRoute = { title: t("support_me"), path: "/support", element: <Support /> }
const [openLogin, setOpenLogin] = useState(false);
const queryClient = new QueryClient()
useI18n()
Expand Down
10 changes: 6 additions & 4 deletions src/components/DRNavbar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ import Fab from '@mui/material/Fab';
import Zoom from '@mui/material/Zoom';
import { materialUseTheme } from 'Theme';
import React from 'react';
import { useTranslation } from 'react-i18next';
import { To, useLocation, useNavigate } from 'react-router-dom';
import AuthService, { getUserName, isLoggedIn } from 'services/AuthService';
import DRErrorComponent from './DRErrorComponent';
Expand All @@ -29,12 +30,13 @@ type IDRNavbarProps = {

function DRNavbar(props: IDRNavbarProps) {
const materialTheme = materialUseTheme();
const { t } = useTranslation(["translation"]);
const location = useLocation();
let navigate = useNavigate();
const { pages = [], supportPage, extern_link = [], openLogin } = props;
const [anchorElNav, setAnchorElNav] = React.useState(null);
const [anchorElUser, setAnchorElUser] = React.useState<null | HTMLElement>(null);
const loginTitle = "login";
const loginTitle = t("login");

const transitionDuration = {
enter: materialTheme.transitions.duration.enteringScreen,
Expand Down Expand Up @@ -238,7 +240,7 @@ function DRNavbar(props: IDRNavbarProps) {
{/* PC and Mobile */}
{isLoggedIn() &&
<>
<Tooltip title="Open settings">
<Tooltip title={t("expand")}>
<IconButton onClick={handleOpenUserMenu} sx={{ p: 0 }}>
<Avatar alt={getUserName()} src="/static/images/avatar/2.jpg" />
</IconButton>
Expand All @@ -264,7 +266,7 @@ function DRNavbar(props: IDRNavbarProps) {
authService.logOut()
handleCloseUserMenu()
}}>
<Typography textAlign="center">Log Out</Typography>
<Typography textAlign="center">{t("log_out")}</Typography>
</MenuItem>
</Menu>
</>
Expand All @@ -287,7 +289,7 @@ function DRNavbar(props: IDRNavbarProps) {
<Fab
variant="extended"
color="primary"
aria-label="add"
aria-label={supportPage?.title}
size="large"
onClick={goToSupport}
sx={{
Expand Down
247 changes: 125 additions & 122 deletions src/components/DRTranslationGrid.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@ import * as locales from '@mui/x-data-grid/locales';
import { useQueryClient } from '@tanstack/react-query';
import { myUseTheme } from 'Theme';
import { ProjectsEnum } from 'enum/ProjectsEnum';
import { TFunction } from 'i18next';
import { GitHubTranslationRelease, TargetLanguages, TranslationResultItem } from 'model/Translation/TranslationResult';
import { useSnackbar } from 'notistack';
import * as React from 'react';
Expand All @@ -23,131 +24,133 @@ import { getLanguageDataGrid } from './DRDataGrid';
import DRErrorComponent from './DRErrorComponent';
import DRIconButton from './DRIconButton';

const columns: GridColDef<TranslationResultItem>[] = [
{
field: 'targetLanguages',
headerName: 'Language',
flex: 1,
minWidth: 100,
renderCell: (params: GridRenderCellParams<TranslationResultItem, TargetLanguages>) => (
<strong>
<Grid
container
direction={{ xs: "column", sm: "row" }}
justifyContent="center"
alignItems="center"
spacing={{ xs: 0, sm: 2, md: 2 }}
>
<Grid sx={{ display: { xs: 'flex', md: 'none' } }} >
<FlagIcon code={params.value?.twoLettersCode.toUpperCase() as FlagIconCode} size={50} height={40} alt={params.value?.name} />
</Grid>
<Grid sx={{ display: { xs: 'none', md: 'flex' } }} >
<FlagIcon code={params.value?.twoLettersCode.toUpperCase() as FlagIconCode} size={65} height={50} alt={params.value?.name} />
</Grid>
<Grid>
{params.value?.name}
</Grid>
</Grid>
</strong >
),
},
{
field: 'release',
headerName: 'Download',
flex: 1,
minWidth: 150,
renderCell: (params: GridRenderCellParams<TranslationResultItem, GitHubTranslationRelease>) => (
<strong>
{params.value &&
<DRButton
color="primary"
size="sm"
marginLeft={0}
marginBottom={0}
marginRight={0}
marginTop={0}
onClick={() => {
window.open(params.value?.downloadUrl)
}}
startDecorator={<DownloadIcon />}
function columns(t: TFunction<[string]>): GridColDef<TranslationResultItem>[] {
return [
{
field: 'targetLanguages',
headerName: t('language'),
flex: 1,
minWidth: 100,
renderCell: (params: GridRenderCellParams<TranslationResultItem, TargetLanguages>) => (
<strong>
<Grid
container
direction={{ xs: "column", sm: "row" }}
justifyContent="center"
alignItems="center"
spacing={{ xs: 0, sm: 2, md: 2 }}
>
{params.value?.version}
</DRButton>
}
</strong>
),
},
{
field: 'translated',
headerName: 'Translated',
flex: 1,
minWidth: 50,
renderCell: (params: GridRenderCellParams<TranslationResultItem, number>) => (
<strong>
{params.value !== 100 &&
<Box sx={{ position: 'relative', display: 'inline-flex' }}>
<CircularProgress
determinate
value={params.value}
/>
<Box
sx={{
top: 0,
left: 0,
bottom: 0,
right: 0,
position: 'absolute',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
<Grid sx={{ display: { xs: 'flex', md: 'none' } }} >
<FlagIcon code={params.value?.twoLettersCode.toUpperCase() as FlagIconCode} size={50} height={40} alt={params.value?.name} />
</Grid>
<Grid sx={{ display: { xs: 'none', md: 'flex' } }} >
<FlagIcon code={params.value?.twoLettersCode.toUpperCase() as FlagIconCode} size={65} height={50} alt={params.value?.name} />
</Grid>
<Grid>
{params.value?.name}
</Grid>
</Grid >
</strong >
),
},
{
field: 'release',
headerName: t('download'),
flex: 1,
minWidth: 150,
renderCell: (params: GridRenderCellParams<TranslationResultItem, GitHubTranslationRelease>) => (
<strong>
{params.value &&
<DRButton
color="primary"
size="sm"
marginLeft={0}
marginBottom={0}
marginRight={0}
marginTop={0}
onClick={() => {
window.open(params.value?.downloadUrl)
}}
startDecorator={<DownloadIcon />}
>
{params.value ? `${Math.round(params.value)}%` : ""}
{params.value?.version}
</DRButton>
}
</strong>
),
},
{
field: 'translated',
headerName: t('translated'),
flex: 1,
minWidth: 50,
renderCell: (params: GridRenderCellParams<TranslationResultItem, number>) => (
<strong>
{params.value !== 100 &&
<Box sx={{ position: 'relative', display: 'inline-flex' }}>
<CircularProgress
determinate
value={params.value}
/>
<Box
sx={{
top: 0,
left: 0,
bottom: 0,
right: 0,
position: 'absolute',
display: 'flex',
alignItems: 'center',
justifyContent: 'center',
}}
>
{params.value ? `${Math.round(params.value)}%` : ""}
</Box>
</Box>
</Box>
}
{params.value === 100 &&
<CheckIcon sx={{ color: "springgreen" }} />
}
</strong>
),
},
// {
// field: 'approved',
// headerName: 'Approved',
// flex: 1,
// minWidth: 50,
// renderCell: (params: GridRenderCellParams<TranslationResultItem, number>) => (
// <strong>
// {params.value !== 100 &&
// <Box sx={{ position: 'relative', display: 'inline-flex' }}>
// <CircularProgress
// determinate
// value={params.value}
// />
// <Box
// sx={{
// top: 0,
// left: 0,
// bottom: 0,
// right: 0,
// position: 'absolute',
// display: 'flex',
// alignItems: 'center',
// justifyContent: 'center',
// }}
// >
// {params.value ? `${Math.round(params.value)}%` : ""}
// </Box>
// </Box>
// }
// {params.value === 100 &&
// <CheckIcon sx={{ color: "springgreen" }} />
// }
// </strong>
// ),
// },
];
}
{params.value === 100 &&
<CheckIcon sx={{ color: "springgreen" }} />
}
</strong>
),
},
// {
// field: 'approved',
// headerName: 'Approved',
// flex: 1,
// minWidth: 50,
// renderCell: (params: GridRenderCellParams<TranslationResultItem, number>) => (
// <strong>
// {params.value !== 100 &&
// <Box sx={{ position: 'relative', display: 'inline-flex' }}>
// <CircularProgress
// determinate
// value={params.value}
// />
// <Box
// sx={{
// top: 0,
// left: 0,
// bottom: 0,
// right: 0,
// position: 'absolute',
// display: 'flex',
// alignItems: 'center',
// justifyContent: 'center',
// }}
// >
// {params.value ? `${Math.round(params.value)}%` : ""}
// </Box>
// </Box>
// }
// {params.value === 100 &&
// <CheckIcon sx={{ color: "springgreen" }} />
// }
// </strong>
// ),
// },
];
}

type IDRTranslationGridProps = {
projectId: ProjectsEnum,
Expand Down Expand Up @@ -264,7 +267,7 @@ function DRTranslationGrid(props: IDRTranslationGridProps) {
{data?.list && <div style={{ height: height, width: '100%' }}>
<DataGrid
rows={data.list}
columns={columns}
columns={columns(t)}
rowHeight={rowHeight}
localeText={
getLanguageDataGrid(locales)
Expand Down
Loading

0 comments on commit d5da699

Please sign in to comment.