mirror of
https://github.com/ajnart/homarr.git
synced 2026-02-28 09:21:00 +01:00
feat: add dynamic breadcrumb (#706)
* feat: add dynamic breadcrumb * feat: pr feedback
This commit is contained in:
@@ -8,6 +8,7 @@ export type SupportedLanguage = (typeof supportedLanguages)[number];
|
||||
|
||||
export const defaultLocale = "en";
|
||||
export { languageMapping } from "./lang";
|
||||
export type { TranslationKeys } from "./lang";
|
||||
|
||||
export const translateIfNecessary = (t: TranslationFunction, value: stringOrTranslation | undefined) => {
|
||||
if (typeof value === "function") {
|
||||
|
||||
@@ -11,3 +11,11 @@ export const languageMapping = () => {
|
||||
|
||||
return mapping as Record<(typeof supportedLanguages)[number], () => ReturnType<typeof enTranslations>>;
|
||||
};
|
||||
|
||||
type NestedKeyOf<ObjectType extends object> = {
|
||||
[Key in keyof ObjectType & (string | number)]: ObjectType[Key] extends object
|
||||
? `${Key}` | `${Key}.${NestedKeyOf<ObjectType[Key]>}`
|
||||
: `${Key}`;
|
||||
}[keyof ObjectType & (string | number)];
|
||||
|
||||
export type TranslationKeys = NestedKeyOf<typeof enTranslations>;
|
||||
|
||||
@@ -1508,4 +1508,53 @@ export default {
|
||||
remove: "Remove",
|
||||
},
|
||||
},
|
||||
navigationStructure: {
|
||||
manage: {
|
||||
label: "Manage",
|
||||
boards: {
|
||||
label: "Boards",
|
||||
},
|
||||
integrations: {
|
||||
label: "Integrations",
|
||||
edit: {
|
||||
label: "Edit",
|
||||
},
|
||||
new: {
|
||||
label: "New",
|
||||
},
|
||||
},
|
||||
apps: {
|
||||
label: "Apps",
|
||||
new: {
|
||||
label: "New App",
|
||||
},
|
||||
edit: {
|
||||
label: "Edit App",
|
||||
},
|
||||
},
|
||||
users: {
|
||||
label: "Users",
|
||||
create: {
|
||||
label: "Create",
|
||||
},
|
||||
general: "General",
|
||||
security: "Security",
|
||||
},
|
||||
tools: {
|
||||
label: "Tools",
|
||||
docker: {
|
||||
label: "Docker",
|
||||
},
|
||||
logs: {
|
||||
label: "Logs",
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
label: "Settings",
|
||||
},
|
||||
about: {
|
||||
label: "About",
|
||||
},
|
||||
},
|
||||
},
|
||||
} as const;
|
||||
|
||||
Reference in New Issue
Block a user