Skip to content

Commit f39ef99

Browse files
authored
Merge pull request #31 from timonmdy/v2.2/hotfix-1
Apply language correclty
2 parents cb1c34b + 733caeb commit f39ef99

4 files changed

Lines changed: 14 additions & 5 deletions

File tree

languages/de.json

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,9 @@
1111
"general.close": "Schließen",
1212
"general.retry": "Erneut versuchen",
1313
"general.copy": "Kopieren",
14+
"general.cut": "Ausschneiden",
15+
"general.paste": "Einfügen",
16+
"general.selectAll": "Alles auswählen",
1417
"general.enabled": "Aktiviert",
1518
"general.disabled": "Deaktiviert",
1619
"general.on": "An",

src/main/shared/config/DefaultLanguage.config.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,9 @@ const ENGLISH_STRINGS = {
99
'general.close': 'Close',
1010
'general.retry': 'Retry',
1111
'general.copy': 'Copy',
12+
'general.cut': 'Cut',
13+
'general.paste': 'Paste',
14+
'general.selectAll': 'Select All',
1215
'general.enabled': 'Enabled',
1316
'general.disabled': 'Disabled',
1417
'general.on': 'On',

src/renderer/components/settings/sections/AppearanceSection.tsx

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ import { useTranslation } from '../../../i18n/I18nProvider';
55
import { VscSync, VscCheck } from 'react-icons/vsc';
66
import type { ThemeDefinition } from '../../../../main/shared/types/Theme.types';
77
import type { LanguageDefinition } from '../../../../main/shared/types/Language.types';
8+
import { ENGLISH } from '../../../../main/shared/config/DefaultLanguage.config';
89
import type { JRCEnvironment } from '../../../../main/shared/types/App.types';
910

1011
type FetchState = 'idle' | 'loading' | 'done' | 'error';
@@ -85,7 +86,7 @@ export function AppearanceSection() {
8586

8687
// Active theme/lang always shown first; session entries fill the rest
8788
const allThemes = [theme, ...sessionThemes.filter((th) => th.id !== theme.id)];
88-
const allLangs = [language, ...sessionLangs.filter((l) => l.id !== language.id)];
89+
const allLangs = mergeById([language, ENGLISH], sessionLangs, (l) => l.id);
8990

9091
return (
9192
<>

src/renderer/hooks/useInputContextMenu.tsx

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
import React, { useCallback, useState } from 'react';
22
import { MdContentCopy, MdContentCut, MdContentPaste, MdSelectAll } from 'react-icons/md';
33
import { ContextMenu } from '../components/common/ContextMenu';
4+
import { useTranslation } from '../i18n/I18nProvider';
45

56
type InputEl = HTMLInputElement | HTMLTextAreaElement;
67

@@ -15,6 +16,7 @@ interface State {
1516
let closeActiveMenu: (() => void) | null = null;
1617

1718
export function useInputContextMenu() {
19+
const { t } = useTranslation();
1820
const [state, setState] = useState<State | null>(null);
1921

2022
const onContextMenu = useCallback((e: React.MouseEvent<InputEl>) => {
@@ -42,7 +44,7 @@ export function useInputContextMenu() {
4244
onClose={handleClose}
4345
items={[
4446
{
45-
label: 'Cut',
47+
label: t('general.cut'),
4648
icon: <MdContentCut size={12} />,
4749
disabled: !state.hasSelection,
4850
onClick: () => {
@@ -51,7 +53,7 @@ export function useInputContextMenu() {
5153
},
5254
},
5355
{
54-
label: 'Copy',
56+
label: t('general.copy'),
5557
icon: <MdContentCopy size={12} />,
5658
disabled: !state.hasSelection,
5759
onClick: () => {
@@ -60,7 +62,7 @@ export function useInputContextMenu() {
6062
},
6163
},
6264
{
63-
label: 'Paste',
65+
label: t('general.paste'),
6466
icon: <MdContentPaste size={12} />,
6567
onClick: () => {
6668
state.el.focus();
@@ -70,7 +72,7 @@ export function useInputContextMenu() {
7072
{ type: 'separator' as const },
7173
{
7274
icon: <MdSelectAll size={12} />,
73-
label: 'Select All',
75+
label: t('general.selectAll'),
7476
onClick: () => {
7577
state.el.focus();
7678
state.el.select();

0 commit comments

Comments
 (0)