Skip to content

Commit 71441af

Browse files
committed
Add some additional translations
1 parent eb53279 commit 71441af

File tree

5 files changed

+12
-4
lines changed

5 files changed

+12
-4
lines changed

src/App.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -234,7 +234,7 @@ const App: React.FC = (): React.JSX.Element => {
234234
const tabs: Tabs.TabItem[] = [
235235
{
236236
key: projectData.robot.modulePath,
237-
title: 'Robot',
237+
title: t('ROBOT'),
238238
type: TabType.ROBOT,
239239
},
240240
];

src/i18n/locales/en/translation.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,6 +34,9 @@
3434
"SPANISH": "Spanish",
3535
"HELP": "Help",
3636
"ABOUT": "About",
37+
"BLOCKS": "Blocks",
38+
"CODE": "Code",
39+
"COPY": "Copy",
3740
"BLOCKLY":{
3841
"OF_TYPE": "of type",
3942
"WITH": "with",

src/i18n/locales/es/translation.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,9 @@
2929
"SPANISH": "Español",
3030
"HELP": "Ayuda",
3131
"ABOUT": "Acerca de",
32+
"BLOCKS": "Bloques",
33+
"CODE": "Código",
34+
"COPY": "Copiar",
3235
"addTabDialog": {
3336
"title": "Agregar Pestaña",
3437
"newItemPlaceholder": "Agregar Módulo",

src/reactComponents/CodeDisplay.tsx

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ import { Prism as SyntaxHighlighter } from 'react-syntax-highlighter';
2525
import { dracula, oneLight } from 'react-syntax-highlighter/dist/esm/styles/prism';
2626

2727
import type { MessageInstance } from 'antd/es/message/interface';
28+
import { useTranslation } from 'react-i18next';
2829

2930
/** Function type for setting string values. */
3031
type StringFunction = (input: string) => void;
@@ -64,6 +65,7 @@ export default function CodeDisplay(props: CodeDisplayProps): React.JSX.Element
6465
}
6566

6667
const { token } = Antd.theme.useToken();
68+
const { t } = useTranslation();
6769
const syntaxStyle = syntaxHighligherFromTheme(props.theme);
6870

6971
/** Handles copying the generated code to clipboard. */
@@ -90,8 +92,8 @@ export default function CodeDisplay(props: CodeDisplayProps): React.JSX.Element
9092
/** Renders the header section with title and copy button. */
9193
const renderHeader = (): React.JSX.Element => (
9294
<Antd.Space>
93-
<Antd.Typography.Title level={3}>Code</Antd.Typography.Title>
94-
<Antd.Tooltip title="Copy">
95+
<Antd.Typography.Title level={3}>{t("CODE")}</Antd.Typography.Title>
96+
<Antd.Tooltip title={t("COPY")}>
9597
<Antd.Button
9698
icon={<CopyIcon />}
9799
size="small"

src/reactComponents/Header.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -97,7 +97,7 @@ export default function Header(props: HeaderProps): React.JSX.Element {
9797
fontWeight: TITLE_FONT_WEIGHT,
9898
}}
9999
>
100-
Blocks
100+
{t("BLOCKS")}
101101
</Antd.Typography>
102102
<Antd.Typography
103103
style={{

0 commit comments

Comments
 (0)