Skip to content

Commit 497f7ce

Browse files
authored
Merge pull request #3637 from cassiano/adding-new-translations-in-enUS-and-ptBR-for-sketch-visibility
Extracting english texts from source code and replacing by translation entries for the recent "sketch visibility" feature, for both en-US and pt-BR locales
2 parents 2336986 + 96f8056 commit 497f7ce

File tree

4 files changed

+31
-5
lines changed

4 files changed

+31
-5
lines changed

client/modules/IDE/components/SketchList.jsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -148,7 +148,8 @@ const SketchList = ({
148148
context: mobile ? 'mobile' : ''
149149
})
150150
)}
151-
{userIsOwner && renderFieldHeader('visibility', 'Visibility')}
151+
{userIsOwner &&
152+
renderFieldHeader('visibility', t('Visibility.Label'))}
152153
<th scope="col"></th>
153154
</tr>
154155
</thead>

client/modules/User/components/VisibilityDropdown.jsx

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
import React, { useState, useRef, useEffect } from 'react';
22
import PropTypes from 'prop-types';
3+
import { useTranslation } from 'react-i18next';
34
import LockIcon from '../../../images/lock.svg';
45
import EarthIcon from '../../../images/earth.svg';
56
import CheckmarkIcon from '../../../images/checkmark.svg';
@@ -8,18 +9,20 @@ const VisibilityDropdown = ({ sketch, onVisibilityChange, location }) => {
89
const [isOpen, setIsOpen] = useState(false);
910
const dropdownRef = useRef(null);
1011

12+
const { t } = useTranslation();
13+
1114
const visibilityOptions = [
1215
{
1316
value: 'Public',
14-
label: 'Public',
17+
label: t('Visibility.Public.Label'),
1518
icon: <EarthIcon className="visibility-icon" />,
16-
description: 'Anyone can see this sketch'
19+
description: t('Visibility.Public.Description')
1720
},
1821
{
1922
value: 'Private',
20-
label: 'Private',
23+
label: t('Visibility.Private.Label'),
2124
icon: <LockIcon className="visibility-icon" />,
22-
description: 'Only you can see this sketch'
25+
description: t('Visibility.Private.Description')
2326
}
2427
];
2528

translations/locales/en-US/translations.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -675,5 +675,16 @@
675675
},
676676
"SkipLink": {
677677
"PlaySketch": "Skip to Play Sketch"
678+
},
679+
"Visibility": {
680+
"Label": "Visibility",
681+
"Public": {
682+
"Description": "Anyone can see this sketch.",
683+
"Label": "Public"
684+
},
685+
"Private": {
686+
"Description": "Only you can see this sketch.",
687+
"Label": "Private"
688+
}
678689
}
679690
}

translations/locales/pt-BR/translations.json

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,5 +606,16 @@
606606
},
607607
"SkipLink": {
608608
"PlaySketch": "Pule para reproduzir o esboço"
609+
},
610+
"Visibility": {
611+
"Label": "Visibilidade",
612+
"Public": {
613+
"Description": "Qualquer um pode ver este esboço.",
614+
"Label": "Público"
615+
},
616+
"Private": {
617+
"Description": "Apenas você pode ver este esboço.",
618+
"Label": "Privado"
619+
}
609620
}
610621
}

0 commit comments

Comments
 (0)