mirror of
https://github.com/ajnart/homarr.git
synced 2025-11-09 06:55:51 +01:00
Adding some translations
This commit is contained in:
@@ -4,6 +4,7 @@
|
|||||||
"text": "Tiles are the main element of homarr. They allow you to configure the dashboard and display the information you want."
|
"text": "Tiles are the main element of homarr. They allow you to configure the dashboard and display the information you want."
|
||||||
},
|
},
|
||||||
"widgetDescription": "Widgets interact with your apps, to provide you with more control over your applications. They usually require a few configurations before use.",
|
"widgetDescription": "Widgets interact with your apps, to provide you with more control over your applications. They usually require a few configurations before use.",
|
||||||
|
"goBack": "Go back to the previous step",
|
||||||
"actionIcon": {
|
"actionIcon": {
|
||||||
"tooltip": "Add a tile"
|
"tooltip": "Add a tile"
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
{
|
{
|
||||||
"tooltip": "The edit mode enables you to configure your dashboard",
|
"tooltip": "The edit mode enables you to configure your dashboard",
|
||||||
|
"description": "In edit mode, you can adjust the size and position of your tiles.",
|
||||||
"button": {
|
"button": {
|
||||||
"disabled": "Enter Edit Mode",
|
"disabled": "Enter Edit Mode",
|
||||||
"enabled": "Exit and Save"
|
"enabled": "Exit and Save"
|
||||||
|
|||||||
8
public/locales/en/layout/modals/change-position.json
Normal file
8
public/locales/en/layout/modals/change-position.json
Normal file
@@ -0,0 +1,8 @@
|
|||||||
|
{
|
||||||
|
"xPosition": "X axis position",
|
||||||
|
"width": "Width",
|
||||||
|
"height": "Height",
|
||||||
|
"yPosition": "Y axis position",
|
||||||
|
"zeroOrHigher": "0 or higher",
|
||||||
|
"betweenXandY": "Between {{mim}} and {{max}}"
|
||||||
|
}
|
||||||
@@ -1,5 +1,10 @@
|
|||||||
{
|
{
|
||||||
"fallback": {
|
"fallback": {
|
||||||
"title": "You currently do not have any tools"
|
"title": "You currently do not have any tools"
|
||||||
|
},
|
||||||
|
"iconPicker": {
|
||||||
|
"textInputPlaceholder": "Search for icons...",
|
||||||
|
"searchLimitationTitle": "Search is limited to {{max}} icons",
|
||||||
|
"searchLimitationMessage": "To keep things snappy and fast, the search is limited to {{max}} icons. Use the search box to find more icons"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -45,7 +45,7 @@ export const ChangePositionModal = ({
|
|||||||
onSubmit(form.values.x, form.values.y, form.values.width, form.values.height);
|
onSubmit(form.values.x, form.values.y, form.values.width, form.values.height);
|
||||||
};
|
};
|
||||||
|
|
||||||
const { t } = useTranslation('common');
|
const { t } = useTranslation(['layout/modals/change-position', 'common']);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<form onSubmit={form.onSubmit(handleSubmit)}>
|
<form onSubmit={form.onSubmit(handleSubmit)}>
|
||||||
@@ -54,8 +54,8 @@ export const ChangePositionModal = ({
|
|||||||
<NumberInput
|
<NumberInput
|
||||||
max={99}
|
max={99}
|
||||||
min={0}
|
min={0}
|
||||||
label="X Position"
|
label={t('xPosition')}
|
||||||
description="0 or higher"
|
description={t('layout/modals/change-position:zeroOrHigher')}
|
||||||
{...form.getInputProps('x')}
|
{...form.getInputProps('x')}
|
||||||
/>
|
/>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -64,8 +64,8 @@ export const ChangePositionModal = ({
|
|||||||
<NumberInput
|
<NumberInput
|
||||||
max={99}
|
max={99}
|
||||||
min={0}
|
min={0}
|
||||||
label="Y Position"
|
label={t('layout/modals/change-position:yPosition')}
|
||||||
description="0 or higher"
|
description={t('layout/modals/change-position:zeroOrHigher')}
|
||||||
{...form.getInputProps('y')}
|
{...form.getInputProps('y')}
|
||||||
/>
|
/>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -77,8 +77,11 @@ export const ChangePositionModal = ({
|
|||||||
data={widthData}
|
data={widthData}
|
||||||
max={24}
|
max={24}
|
||||||
min={1}
|
min={1}
|
||||||
label="Width"
|
label={t('layout/modals/change-position:width')}
|
||||||
description={`Between ${widthData.at(0)?.label} and ${widthData.at(-1)?.label}`}
|
description={t('layout/modals/change-position:betweenXandY', {
|
||||||
|
min: widthData.at(0)?.label,
|
||||||
|
max: widthData.at(-1)?.label,
|
||||||
|
})}
|
||||||
{...form.getInputProps('width')}
|
{...form.getInputProps('width')}
|
||||||
/>
|
/>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -88,8 +91,11 @@ export const ChangePositionModal = ({
|
|||||||
data={heightData}
|
data={heightData}
|
||||||
max={24}
|
max={24}
|
||||||
min={1}
|
min={1}
|
||||||
label="Height"
|
label={t('layout/modals/change-position:height')}
|
||||||
description={`Between ${heightData.at(0)?.label} and ${heightData.at(-1)?.label}`}
|
description={t('layout/modals/change-position:betweenXandY', {
|
||||||
|
min: heightData.at(0)?.label,
|
||||||
|
max: heightData.at(-1)?.label,
|
||||||
|
})}
|
||||||
{...form.getInputProps('height')}
|
{...form.getInputProps('height')}
|
||||||
/>
|
/>
|
||||||
</Grid.Col>
|
</Grid.Col>
|
||||||
@@ -97,9 +103,9 @@ export const ChangePositionModal = ({
|
|||||||
|
|
||||||
<Flex justify="end" gap="sm" mt="md">
|
<Flex justify="end" gap="sm" mt="md">
|
||||||
<Button onClick={() => onCancel()} variant="light" color="gray">
|
<Button onClick={() => onCancel()} variant="light" color="gray">
|
||||||
{t('cancel')}
|
{t('common:cancel')}
|
||||||
</Button>
|
</Button>
|
||||||
<Button type="submit">{t('save')}</Button>
|
<Button type="submit">{t('common:save')}</Button>
|
||||||
</Flex>
|
</Flex>
|
||||||
</form>
|
</form>
|
||||||
);
|
);
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ import { UseFormReturnType } from '@mantine/form';
|
|||||||
import { useDebouncedValue } from '@mantine/hooks';
|
import { useDebouncedValue } from '@mantine/hooks';
|
||||||
import { IconSearch, IconX } from '@tabler/icons';
|
import { IconSearch, IconX } from '@tabler/icons';
|
||||||
import { useEffect, useState } from 'react';
|
import { useEffect, useState } from 'react';
|
||||||
|
import { useTranslation } from 'next-i18next';
|
||||||
import { ICON_PICKER_SLICE_LIMIT } from '../../../../../../../../data/constants';
|
import { ICON_PICKER_SLICE_LIMIT } from '../../../../../../../../data/constants';
|
||||||
import { IconSelectorItem } from '../../../../../../../types/iconSelector/iconSelectorItem';
|
import { IconSelectorItem } from '../../../../../../../types/iconSelector/iconSelectorItem';
|
||||||
import { WalkxcodeRepositoryIcon } from '../../../../../../../types/iconSelector/repositories/walkxcodeIconRepository';
|
import { WalkxcodeRepositoryIcon } from '../../../../../../../types/iconSelector/repositories/walkxcodeIconRepository';
|
||||||
@@ -72,6 +73,8 @@ export const IconSelector = ({ onChange, allowAppNamePropagation, form }: IconSe
|
|||||||
const isTruncated =
|
const isTruncated =
|
||||||
slicedFilteredItems.length > 0 && slicedFilteredItems.length !== filteredItems.length;
|
slicedFilteredItems.length > 0 && slicedFilteredItems.length !== filteredItems.length;
|
||||||
|
|
||||||
|
const { t } = useTranslation('layout/tools');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Popover width={310}>
|
<Popover width={310}>
|
||||||
<Popover.Target>
|
<Popover.Target>
|
||||||
@@ -88,7 +91,7 @@ export const IconSelector = ({ onChange, allowAppNamePropagation, form }: IconSe
|
|||||||
<TextInput
|
<TextInput
|
||||||
value={searchTerm}
|
value={searchTerm}
|
||||||
onChange={(event) => setSearchTerm(event.currentTarget.value)}
|
onChange={(event) => setSearchTerm(event.currentTarget.value)}
|
||||||
placeholder="Search for icons..."
|
placeholder={t('iconPicker.textInputPlaceholder')}
|
||||||
variant="filled"
|
variant="filled"
|
||||||
rightSection={
|
rightSection={
|
||||||
<ActionIcon onClick={() => setSearchTerm('')}>
|
<ActionIcon onClick={() => setSearchTerm('')}>
|
||||||
@@ -110,11 +113,10 @@ export const IconSelector = ({ onChange, allowAppNamePropagation, form }: IconSe
|
|||||||
<Stack spacing="xs" pr={15}>
|
<Stack spacing="xs" pr={15}>
|
||||||
<Divider mt={35} mx="xl" />
|
<Divider mt={35} mx="xl" />
|
||||||
<Title order={6} color="dimmed" align="center">
|
<Title order={6} color="dimmed" align="center">
|
||||||
Search is limited to {ICON_PICKER_SLICE_LIMIT} icons
|
{t('iconPicker.searchLimitationTitle', { max: ICON_PICKER_SLICE_LIMIT })}
|
||||||
</Title>
|
</Title>
|
||||||
<Text color="dimmed" align="center" size="sm">
|
<Text color="dimmed" align="center" size="sm">
|
||||||
To keep things snappy and fast, the search is limited to {ICON_PICKER_SLICE_LIMIT}{' '}
|
{t('iconPicker.searchLimitationMessage', { max: ICON_PICKER_SLICE_LIMIT })}
|
||||||
icons. Use the search box to find more icons.
|
|
||||||
</Text>
|
</Text>
|
||||||
</Stack>
|
</Stack>
|
||||||
)}
|
)}
|
||||||
|
|||||||
@@ -1,19 +1,23 @@
|
|||||||
import { Button, Text } from '@mantine/core';
|
import { Button, Text } from '@mantine/core';
|
||||||
import { IconArrowNarrowLeft } from '@tabler/icons';
|
import { IconArrowNarrowLeft } from '@tabler/icons';
|
||||||
|
import { useTranslation } from 'next-i18next';
|
||||||
|
|
||||||
interface SelectorBackArrowProps {
|
interface SelectorBackArrowProps {
|
||||||
onClickBack: () => void;
|
onClickBack: () => void;
|
||||||
}
|
}
|
||||||
|
|
||||||
export const SelectorBackArrow = ({ onClickBack }: SelectorBackArrowProps) => (
|
export function SelectorBackArrow({ onClickBack }: SelectorBackArrowProps) {
|
||||||
<Button
|
const { t } = useTranslation('layout/element-selector/selector');
|
||||||
leftIcon={<IconArrowNarrowLeft />}
|
return (
|
||||||
onClick={onClickBack}
|
<Button
|
||||||
styles={{ inner: { width: 'fit-content' } }}
|
leftIcon={<IconArrowNarrowLeft />}
|
||||||
fullWidth
|
onClick={onClickBack}
|
||||||
variant="default"
|
styles={{ inner: { width: 'fit-content' } }}
|
||||||
mb="md"
|
fullWidth
|
||||||
>
|
variant="default"
|
||||||
<Text>See all available elements</Text>
|
mb="md"
|
||||||
</Button>
|
>
|
||||||
);
|
<Text>{t('goBack')}</Text>
|
||||||
|
</Button>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|||||||
@@ -126,41 +126,3 @@ export const WidgetsEditModal = ({
|
|||||||
</Stack>
|
</Stack>
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
// <Stack>
|
|
||||||
// {items.map(([key, value]) => (
|
|
||||||
// <>
|
|
||||||
// {typeof value === 'boolean' ? (
|
|
||||||
// <Switch
|
|
||||||
// label={t(`descriptor.settings.${key}.label`)}
|
|
||||||
// checked={value}
|
|
||||||
// onChange={(ev) => handleChange(key, ev.currentTarget.checked)}
|
|
||||||
// />
|
|
||||||
// ) : null}
|
|
||||||
// {typeof value === 'string' ? (
|
|
||||||
// <TextInput
|
|
||||||
// label={t(`descriptor.settings.${key}.label`)}
|
|
||||||
// value={value}
|
|
||||||
// onChange={(ev) => handleChange(key, ev.currentTarget.value)}
|
|
||||||
// />
|
|
||||||
// ) : null}
|
|
||||||
// {typeof value === 'object' && Array.isArray(value) ? (
|
|
||||||
// <MultiSelect
|
|
||||||
// data={getMutliselectData(key)}
|
|
||||||
// label={t(`descriptor.settings.${key}.label`)}
|
|
||||||
// value={value}
|
|
||||||
// onChange={(v) => handleChange(key, v)}
|
|
||||||
// />
|
|
||||||
// ) : null}
|
|
||||||
// </>
|
|
||||||
// ))}
|
|
||||||
|
|
||||||
// <Group position="right">
|
|
||||||
// <Button onClick={() => context.closeModal(id)} variant="light">
|
|
||||||
// {t('common:cancel')}
|
|
||||||
// </Button>
|
|
||||||
// <Button onClick={handleSave}>{t('common:save')}</Button>
|
|
||||||
// </Group>
|
|
||||||
// </Stack>
|
|
||||||
// );
|
|
||||||
// };
|
|
||||||
|
|||||||
@@ -10,15 +10,7 @@ export const ViewToggleButton = () => {
|
|||||||
const { t } = useTranslation('layout/header/actions/toggle-edit-mode');
|
const { t } = useTranslation('layout/header/actions/toggle-edit-mode');
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Tooltip
|
<Tooltip width={100} label={<Text align="center">{t('description')}</Text>}>
|
||||||
label={
|
|
||||||
<Text align="center">
|
|
||||||
In edit mode, you can adjust
|
|
||||||
<br />
|
|
||||||
the size and position of your tiles.
|
|
||||||
</Text>
|
|
||||||
}
|
|
||||||
>
|
|
||||||
{screenLargerThanMd ? (
|
{screenLargerThanMd ? (
|
||||||
<Button
|
<Button
|
||||||
variant={isEditMode ? 'filled' : 'default'}
|
variant={isEditMode ? 'filled' : 'default'}
|
||||||
|
|||||||
@@ -3,6 +3,7 @@ export const dashboardNamespaces = [
|
|||||||
'layout/tools',
|
'layout/tools',
|
||||||
'layout/element-selector/selector',
|
'layout/element-selector/selector',
|
||||||
'layout/modals/add-app',
|
'layout/modals/add-app',
|
||||||
|
'layout/modals/change-position',
|
||||||
'layout/modals/about',
|
'layout/modals/about',
|
||||||
'layout/header/actions/toggle-edit-mode',
|
'layout/header/actions/toggle-edit-mode',
|
||||||
'settings/common',
|
'settings/common',
|
||||||
|
|||||||
Reference in New Issue
Block a user