Skip to content

Commit

Permalink
💫 Correções de traduções
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashu11-A committed Mar 3, 2024
1 parent ae406d7 commit 13c74db
Show file tree
Hide file tree
Showing 79 changed files with 244 additions and 182 deletions.
Empty file modified artisan
100755 → 100644
Empty file.
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@
"xterm-addon-search": "^0.9.0",
"xterm-addon-search-bar": "^0.2.0",
"xterm-addon-web-links": "^0.6.0",
"yup": "^0.29.1"
"yup": "^1.3.3",
"yup-locales": "^1.2.21"
},
"devDependencies": {
"@babel/core": "^7.12.1",
Expand Down
Empty file modified public/assets/svgs/pterodactyl.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Empty file modified resources/scripts/assets/images/pterodactyl.svg
100755 → 100644
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion resources/scripts/components/FlashMessageRender.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ type Props = Readonly<{

const FlashMessageRender = ({ byKey, className }: Props) => {
const flashes = useStoreState((state) =>
state.flashes.items.filter((flash) => (byKey ? flash.key === byKey : true)),
state.flashes.items.filter((flash) => (byKey ? flash.key === byKey : true))
);

return flashes.length ? (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import tw from 'twin.macro';
import * as React from 'react';
import Reaptcha from 'reaptcha';
import { object, string } from 'yup';
import { object, string, setLocale } from 'yup';
import { pt } from 'yup-locales';
import { Link } from 'react-router-dom';
import useFlash from '@/plugins/useFlash';
import { useStoreState } from 'easy-peasy';
Expand All @@ -24,6 +25,8 @@ export default () => {
const { clearFlashes, addFlash } = useFlash();
const { enabled: recaptchaEnabled, siteKey } = useStoreState((state) => state.settings.data!.recaptcha);

setLocale(pt);

useEffect(() => {
clearFlashes();
}, []);
Expand Down
5 changes: 4 additions & 1 deletion resources/scripts/components/auth/LoginContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import tw from 'twin.macro';
import Reaptcha from 'reaptcha';
import login from '@/api/auth/login';
import { object, string } from 'yup';
import { object, string, setLocale } from 'yup';
import { pt } from 'yup-locales';
import useFlash from '@/plugins/useFlash';
import { useStoreState } from 'easy-peasy';
import { Formik, FormikHelpers } from 'formik';
Expand All @@ -26,6 +27,8 @@ const LoginContainer = ({ history }: RouteComponentProps) => {
const { clearFlashes, clearAndAddHttpError } = useFlash();
const { enabled: recaptchaEnabled, siteKey } = useStoreState((state) => state.settings.data!.recaptcha);

setLocale(pt);

useEffect(() => {
clearFlashes();
}, []);
Expand Down
5 changes: 4 additions & 1 deletion resources/scripts/components/auth/RegisterContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import tw from 'twin.macro';
import Reaptcha from 'reaptcha';
import { object, string } from 'yup';
import { object, string, setLocale } from 'yup';
import { pt } from 'yup-locales';
import useFlash from '@/plugins/useFlash';
import register from '@/api/auth/register';
import { useStoreState } from 'easy-peasy';
Expand All @@ -25,6 +26,8 @@ const RegisterContainer = ({ history }: RouteComponentProps) => {
const { clearFlashes, clearAndAddHttpError, addFlash } = useFlash();
const { enabled: recaptchaEnabled, siteKey } = useStoreState((state) => state.settings.data!.recaptcha);

setLocale(pt);

useEffect(() => {
clearFlashes();
}, []);
Expand Down
5 changes: 4 additions & 1 deletion resources/scripts/components/auth/ResetPasswordContainer.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
import tw from 'twin.macro';
import React, { useState } from 'react';
import { Link } from 'react-router-dom';
import { object, ref, string } from 'yup';
import { object, ref, string, setLocale } from 'yup';
import { pt } from 'yup-locales';
import { ApplicationStore } from '@/state';
import { httpErrorToHuman } from '@/api/http';
import { Formik, FormikHelpers } from 'formik';
Expand All @@ -28,6 +29,8 @@ export default ({ match, location }: RouteComponentProps<{ token: string }>) =>
setEmail(parsed.get('email') || '');
}

setLocale(pt);

const submit = ({ password, passwordConfirmation }: Values, { setSubmitting }: FormikHelpers<Values>) => {
clearFlashes();
performPasswordReset(email, {
Expand Down
4 changes: 3 additions & 1 deletion resources/scripts/components/dashboard/CouponContainer.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@ import React, { Fragment } from 'react';
import FlashMessageRender from '@/components/FlashMessageRender';
import ContentBox from '@/components/elements/ContentBox';
import { Form, Formik, FormikHelpers } from 'formik';
import { object, string } from 'yup';
import { object, string, setLocale } from 'yup';
import { pt } from 'yup-locales';
import SpinnerOverlay from '@/components/elements/SpinnerOverlay';
import Field from '@/components/elements/Field';
import { Button } from '@/components/elements/button';
Expand All @@ -19,6 +20,7 @@ const schema = object().shape({
export default () => {
const { clearFlashes, addFlash } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);

setLocale(pt);
const submit = (values: { code: string }, { resetForm, setSubmitting }: FormikHelpers<{ code: string }>) => {
clearFlashes();
redeemCoupon(values.code)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ import Pagination from '@/components/elements/Pagination';
import { usePersistedState } from '@/plugins/usePersistedState';
import PageContentBlock from '@/components/elements/PageContentBlock';

import useWindowDimensions from '@/plugins/useWindowDimensions';

export default () => {
const { search } = useLocation();
const { width } = useWindowDimensions();
const defaultPage = Number(new URLSearchParams(search).get('page') || '1');

const [page, setPage] = useState(!isNaN(defaultPage) && defaultPage > 0 ? defaultPage : 1);
Expand All @@ -34,7 +31,7 @@ export default () => {
getServers({
page,
type: showOnlyAdmin && rootAdmin ? 'admin' : undefined,
}),
})
);

useEffect(() => {
Expand Down
12 changes: 6 additions & 6 deletions resources/scripts/components/dashboard/ServerRow.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ const StatusIndicatorBox = styled(GreyRowBox)<{
!$status || $status === 'offline'
? tw`bg-red-500`
: $status === 'running'
? tw`bg-green-500`
: tw`bg-yellow-500`};
? tw`bg-green-500`
: tw`bg-yellow-500`};
}
&:hover .status-bar {
Expand Down Expand Up @@ -119,10 +119,10 @@ export default ({ server, className }: { server: Server; className?: string }) =
{server.isTransferring
? 'Transferindo'
: server.status === 'installing'
? 'Instalando'
: server.status === 'restoring_backup'
? 'Restaurando Backup'
: 'Não Válido'}
? 'Instalando'
: server.status === 'restoring_backup'
? 'Restaurando Backup'
: 'Não Válido'}
</span>
</div>
) : (
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import * as Yup from 'yup';
import { pt } from 'yup-locales';
import { ApplicationStore } from '@/state';
import { httpErrorToHuman } from '@/api/http';
import { useStoreState } from '@/state/hooks';
Expand All @@ -22,6 +23,7 @@ const schema = Yup.object().shape({
export default () => {
const code = useStoreState((state) => state.user.data!.referralCode);
const { clearFlashes, addFlash } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);
Yup.setLocale(pt);

const submit = (values: Values, { resetForm, setSubmitting }: FormikHelpers<Values>) => {
clearFlashes('account:referral');
Expand All @@ -32,15 +34,15 @@ export default () => {
type: 'success',
key: 'account:referral',
message: 'Agora você está usando o Código de referência.',
}),
})
)
.catch((error) =>
addFlash({
type: 'danger',
key: 'account:referral',
title: 'Erro',
message: httpErrorToHuman(error),
}),
})
)
.then(() => {
resetForm();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import tw from 'twin.macro';
import { object, string } from 'yup';
import { object, string, setLocale } from 'yup';
import { pt } from 'yup-locales';
import React, { useState } from 'react';
import { ApplicationStore } from '@/state';
import styled from 'styled-components/macro';
Expand All @@ -26,6 +27,7 @@ const CustomTextarea = styled(Textarea)`
export default ({ onKeyCreated }: { onKeyCreated: (key: ApiKey) => void }) => {
const [apiKey, setApiKey] = useState('');
const { addError, clearFlashes } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);
setLocale(pt);

const submit = (values: Values, { setSubmitting, resetForm }: FormikHelpers<Values>) => {
clearFlashes('account');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import React from 'react';
import tw from 'twin.macro';
import { object, string } from 'yup';
import { object, string, setLocale } from 'yup';
import { pt } from 'yup-locales';
import styled from 'styled-components/macro';
import { useFlashKey } from '@/plugins/useFlash';
import { Button } from '@/components/elements/button/index';
Expand All @@ -22,6 +23,7 @@ const CustomTextarea = styled(Textarea)`
export default () => {
const { clearAndAddHttpError } = useFlashKey('account');
const { mutate } = useSSHKeys();
setLocale(pt);

const submit = (values: Values, { setSubmitting, resetForm }: FormikHelpers<Values>) => {
clearAndAddHttpError();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import * as Yup from 'yup';
import { pt } from 'yup-locales';
import tw from 'twin.macro';
import { ApplicationStore } from '@/state';
import { httpErrorToHuman } from '@/api/http';
Expand All @@ -25,6 +26,8 @@ export default () => {

const { clearFlashes, addFlash } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);

Yup.setLocale(pt);

const submit = (values: Values, { resetForm, setSubmitting }: FormikHelpers<Values>) => {
clearFlashes('account:email');

Expand All @@ -34,15 +37,15 @@ export default () => {
type: 'success',
key: 'account:email',
message: 'O seu E-mail principal foi atualizado.',
}),
})
)
.catch((error) =>
addFlash({
type: 'danger',
key: 'account:email',
title: 'Erro',
message: httpErrorToHuman(error),
}),
})
)
.then(() => {
resetForm();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import * as Yup from 'yup';
import { pt } from 'yup-locales';
import tw from 'twin.macro';
import { ApplicationStore } from '@/state';
import { httpErrorToHuman } from '@/api/http';
Expand All @@ -24,7 +25,7 @@ const schema = Yup.object().shape({
'A confirmação da senha não corresponde à senha que você digitou.',
function (value) {
return value === this.parent.password;
},
}
),
});

Expand All @@ -36,6 +37,8 @@ export default () => {
return null;
}

Yup.setLocale(pt);

const submit = (values: Values, { setSubmitting }: FormikHelpers<Values>) => {
clearFlashes('account:password');
updateAccountPassword({ ...values })
Expand All @@ -49,7 +52,7 @@ export default () => {
type: 'danger',
title: 'Error',
message: httpErrorToHuman(error),
}),
})
)
.then(() => setSubmitting(false));
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
import React from 'react';
import * as Yup from 'yup';
import { pt } from 'yup-locales';
import tw from 'twin.macro';
import { ApplicationStore } from '@/state';
import { httpErrorToHuman } from '@/api/http';
Expand All @@ -23,6 +24,8 @@ const schema = Yup.object().shape({
export default () => {
const { clearFlashes, addFlash } = useStoreActions((actions: Actions<ApplicationStore>) => actions.flashes);

Yup.setLocale(pt);

const submit = (values: Values, { resetForm, setSubmitting }: FormikHelpers<Values>) => {
clearFlashes('account:email');

Expand All @@ -32,15 +35,15 @@ export default () => {
type: 'success',
key: 'account:username',
message: 'O seu usuário foi alterado.',
}),
})
)
.catch((error) =>
addFlash({
type: 'danger',
key: 'account:username',
title: 'Erro',
message: httpErrorToHuman(error),
}),
})
)
.then(() => {
resetForm();
Expand Down
7 changes: 5 additions & 2 deletions resources/scripts/components/dashboard/search/SearchModal.tsx
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
import tw from 'twin.macro';
import debounce from 'debounce';
import { object, string } from 'yup';
import { object, string, setLocale } from 'yup';
import { pt } from 'yup-locales';
import { ip } from '@/lib/formatters';
import { Link } from 'react-router-dom';
import getServers from '@/api/getServers';
Expand Down Expand Up @@ -50,9 +51,11 @@ export default ({ ...props }: Props) => {
const isAdmin = useStoreState((state) => state.user.data!.rootAdmin);
const [servers, setServers] = useState<Server[]>([]);
const { clearAndAddHttpError, clearFlashes } = useStoreActions(
(actions: Actions<ApplicationStore>) => actions.flashes,
(actions: Actions<ApplicationStore>) => actions.flashes
);

setLocale(pt);

const search = debounce(({ term }: Values, { setSubmitting }: FormikHelpers<Values>) => {
clearFlashes('search');

Expand Down
2 changes: 1 addition & 1 deletion resources/scripts/components/elements/Checkbox.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const Checkbox = ({ name, value, className, ...props }: Props & InputProps) => (
{({ field, form }: FieldProps) => {
if (!Array.isArray(field.value)) {
console.error(
'Tentativa de montar uma caixa de seleção usando um valor de campo que não é uma matriz.',
'Tentativa de montar uma caixa de seleção usando um valor de campo que não é uma matriz.'
);

return null;
Expand Down
2 changes: 1 addition & 1 deletion resources/scripts/components/elements/Field.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ const Field = forwardRef<HTMLInputElement, Props>(
</div>
)}
</FormikField>
),
)
);
Field.displayName = 'Field';

Expand Down
4 changes: 1 addition & 3 deletions resources/scripts/components/elements/Input.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -21,9 +21,7 @@ const checkboxStyle = css<Props>`
${tw`bg-neutral-500 cursor-pointer appearance-none inline-block align-middle select-none flex-shrink-0 w-4 h-4 text-primary-400 border border-neutral-300 rounded-sm`};
color-adjust: exact;
background-origin: border-box;
transition:
all 75ms linear,
box-shadow 25ms linear;
transition: all 75ms linear, box-shadow 25ms linear;
&:checked {
${tw`border-transparent bg-no-repeat bg-center`};
Expand Down
10 changes: 5 additions & 5 deletions resources/scripts/components/elements/Spinner.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,11 @@ const SpinnerComponent = styled.div<Props>`
props.size === 'small'
? tw`w-4 h-4 border-2`
: props.size === 'large'
? css`
${tw`w-16 h-16`};
border-width: 6px;
`
: null};
? css`
${tw`w-16 h-16`};
border-width: 6px;
`
: null};
border-color: ${(props) => (!props.isBlue ? 'rgba(255, 255, 255, 0.2)' : 'hsla(212, 92%, 43%, 0.2)')};
border-top-color: ${(props) => (!props.isBlue ? 'rgb(255, 255, 255)' : 'hsl(212, 92%, 43%)')};
Expand Down
Loading

0 comments on commit 13c74db

Please sign in to comment.