Skip to content

Commit

Permalink
[frontend] add traduction
Browse files Browse the repository at this point in the history
  • Loading branch information
savacano28 committed Jun 5, 2024
1 parent 887d7c5 commit df71c8e
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 3 deletions.
6 changes: 4 additions & 2 deletions openbas-front/src/components/fields/MarkDownField.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import MDEditor, { commands } from '@uiw/react-md-editor/nohighlight';
import { Box, FormHelperText, InputLabel, Typography } from '@mui/material';
import { ICommand } from '@uiw/react-md-editor';
import TextFieldAskAI from '../../admin/components/common/form/TextFieldAskAI';
import { useFormatter } from '../i18n';

interface Props {
name: string;
Expand All @@ -24,6 +25,7 @@ const MarkDownField: React.FC<Props> = ({
inInject,
inArticle,
}) => {
const { t } = useFormatter();
const { control } = useFormContext();
const {
field: { onChange, value },
Expand Down Expand Up @@ -57,7 +59,7 @@ const MarkDownField: React.FC<Props> = ({
border: isEdit ? '1px solid' : '',
}}
>
<Typography>Write</Typography>
<Typography>{t('Write')}</Typography>
</div>
),
execute: () => setIsEdit(true),
Expand All @@ -76,7 +78,7 @@ const MarkDownField: React.FC<Props> = ({
border: !isEdit ? '1px solid' : '',
}}
>
<Typography>Preview</Typography>
<Typography>{t('Preview')}</Typography>
</div>
),
execute: () => setIsEdit(false),
Expand Down
6 changes: 5 additions & 1 deletion openbas-front/src/utils/Localization.js
Original file line number Diff line number Diff line change
Expand Up @@ -571,7 +571,6 @@ const i18n = {
'Reset answers': 'Réinitialiser les réponses',
hours: 'heures',
Apply: 'Appliquer',

players: 'joueurs',
Explanation: 'Explication',
Category: 'Catégorie',
Expand Down Expand Up @@ -1104,6 +1103,11 @@ const i18n = {
'Cleanup executor': 'Exécuteur de nettoyage',
'Cleanup command': 'Commande de nettoyage',
Document: 'Document',
// -- Policies
'Platform login message': 'Messages de connexion',
'Platform consent message': 'Message de consentement à la plate-forme',
'Platform consent confirm text': 'Texte de confirmation du consentement à la plate-forme',
Write: 'Ecriture',
},
en: {
openbas_email: 'Email',
Expand Down

0 comments on commit df71c8e

Please sign in to comment.