Skip to content

Commit

Permalink
fix: missing translations for apps / integrations #438 (#674)
Browse files Browse the repository at this point in the history
* fix: missing translations for apps / integrations #438

* chore: remove unnecessary property from integration new dropdown
  • Loading branch information
Meierschlumpf authored Jun 16, 2024
1 parent e957c6b commit f358c33
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 9 deletions.
6 changes: 3 additions & 3 deletions apps/nextjs/src/app/[locale]/manage/apps/_form.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -36,10 +36,10 @@ export const AppForm = (props: AppFormProps) => {
return (
<form onSubmit={form.onSubmit(handleSubmit)}>
<Stack>
<TextInput {...form.getInputProps("name")} withAsterisk label="Name" />
<TextInput {...form.getInputProps("name")} withAsterisk label={t("app.field.name.label")} />
<IconPicker initialValue={initialValues?.iconUrl} {...form.getInputProps("iconUrl")} />
<Textarea {...form.getInputProps("description")} label="Description" />
<TextInput {...form.getInputProps("href")} label="URL" />
<Textarea {...form.getInputProps("description")} label={t("app.field.description.label")} />
<TextInput {...form.getInputProps("href")} label={t("app.field.url.label")} />

<Group justify="end">
<Button variant="default" component={Link} href="/manage/apps">
Expand Down
8 changes: 6 additions & 2 deletions apps/nextjs/src/app/[locale]/manage/apps/new/page.tsx
Original file line number Diff line number Diff line change
@@ -1,12 +1,16 @@
import { Container, Stack, Title } from "@mantine/core";

import { getI18n } from "@homarr/translation/server";

import { AppNewForm } from "./_app-new-form";

export default function AppNewPage() {
export default async function AppNewPage() {
const t = await getI18n();

return (
<Container>
<Stack>
<Title>New app</Title>
<Title>{t("app.page.create.title")}</Title>
<AppNewForm />
</Stack>
</Container>
Expand Down
7 changes: 4 additions & 3 deletions apps/nextjs/src/app/[locale]/manage/apps/page.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -16,20 +16,21 @@ import { IconApps, IconPencil } from "@tabler/icons-react";

import type { RouterOutputs } from "@homarr/api";
import { api } from "@homarr/api/server";
import { getI18n } from "@homarr/translation/server";
import { getI18n, getScopedI18n } from "@homarr/translation/server";

import { AppDeleteButton } from "./_app-delete-button";

export default async function AppsPage() {
const apps = await api.app.all();
const t = await getScopedI18n("app");

return (
<Container>
<Stack>
<Group justify="space-between" align="center">
<Title>Apps</Title>
<Title>{t("page.list.title")}</Title>
<Button component={Link} href="/manage/apps/new">
New app
{t("page.create.title")}
</Button>
</Group>
{apps.length === 0 && <AppNoResults />}
Expand Down
2 changes: 1 addition & 1 deletion apps/nextjs/src/components/icons/picker/icon-picker.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ export const IconPicker = ({ initialValue, onChange, error, onFocus, onBlur }: I
rightSectionPointerEvents="none"
withAsterisk
error={error}
label="Icon URL"
label={t("iconPicker.label")}
/>
</Combobox.Target>

Expand Down
12 changes: 12 additions & 0 deletions packages/translation/src/lang/en.ts
Original file line number Diff line number Diff line change
Expand Up @@ -317,6 +317,17 @@ export default {
},
},
},
field: {
name: {
label: "Name",
},
description: {
label: "Description",
},
url: {
label: "Url",
},
},
},
integration: {
page: {
Expand Down Expand Up @@ -453,6 +464,7 @@ export default {
tryAgain: "Try again",
},
iconPicker: {
label: "Icon URL",
header: "Type name or objects to filter for icons... Homarr will search through {countIcons} icons for you.",
},
information: {
Expand Down

0 comments on commit f358c33

Please sign in to comment.