Merge branch 'dev' into ajnart/fix-duplicate-users
This commit is contained in:
@@ -5,7 +5,7 @@ import { createI18nClient } from "next-international/client";
|
||||
import { languageMapping } from "./lang";
|
||||
import enTranslation from "./lang/en";
|
||||
|
||||
export const { useI18n, useScopedI18n, I18nProviderClient } = createI18nClient(
|
||||
export const { useI18n, useScopedI18n, useCurrentLocale, useChangeLocale, I18nProviderClient } = createI18nClient(
|
||||
languageMapping(),
|
||||
{
|
||||
fallbackLocale: enTranslation,
|
||||
|
||||
@@ -1,6 +1,7 @@
|
||||
import type { stringOrTranslation, TranslationFunction } from "./type";
|
||||
|
||||
export * from "./type";
|
||||
export * from "./locale-attributes";
|
||||
|
||||
export const supportedLanguages = ["en", "de"] as const;
|
||||
export type SupportedLanguage = (typeof supportedLanguages)[number];
|
||||
@@ -8,10 +9,7 @@ export type SupportedLanguage = (typeof supportedLanguages)[number];
|
||||
export const defaultLocale = "en";
|
||||
export { languageMapping } from "./lang";
|
||||
|
||||
export const translateIfNecessary = (
|
||||
t: TranslationFunction,
|
||||
value: stringOrTranslation | undefined,
|
||||
) => {
|
||||
export const translateIfNecessary = (t: TranslationFunction, value: stringOrTranslation | undefined) => {
|
||||
if (typeof value === "function") {
|
||||
return value(t);
|
||||
}
|
||||
|
||||
@@ -6,12 +6,8 @@ export const languageMapping = () => {
|
||||
const mapping: Record<string, unknown> = {};
|
||||
|
||||
for (const language of supportedLanguages) {
|
||||
mapping[language] = () =>
|
||||
import(`./lang/${language}`) as ReturnType<typeof enTranslations>;
|
||||
mapping[language] = () => import(`./lang/${language}`) as ReturnType<typeof enTranslations>;
|
||||
}
|
||||
|
||||
return mapping as Record<
|
||||
(typeof supportedLanguages)[number],
|
||||
() => ReturnType<typeof enTranslations>
|
||||
>;
|
||||
return mapping as Record<(typeof supportedLanguages)[number], () => ReturnType<typeof enTranslations>>;
|
||||
};
|
||||
|
||||
@@ -93,8 +93,7 @@ export default {
|
||||
},
|
||||
testConnection: {
|
||||
action: "Verbindung überprüfen",
|
||||
alertNotice:
|
||||
"Der Button zum Speichern wird aktiviert, sobald die Verbindung erfolgreich überprüft wurde",
|
||||
alertNotice: "Der Button zum Speichern wird aktiviert, sobald die Verbindung erfolgreich überprüft wurde",
|
||||
notification: {
|
||||
success: {
|
||||
title: "Verbindung erfolgreich",
|
||||
@@ -121,8 +120,7 @@ export default {
|
||||
secrets: {
|
||||
title: "Zugangsdaten",
|
||||
lastUpdated: "Zuletzt geändert {date}",
|
||||
secureNotice:
|
||||
"Diese Zugangsdaten können nach der Erstellung nicht mehr ausgelesen werden",
|
||||
secureNotice: "Diese Zugangsdaten können nach der Erstellung nicht mehr ausgelesen werden",
|
||||
reset: {
|
||||
title: "Zugangsdaten zurücksetzen",
|
||||
message: "Möchtest du diese Zugangsdaten wirklich zurücksetzen?",
|
||||
@@ -172,8 +170,7 @@ export default {
|
||||
option: {
|
||||
is24HourFormat: {
|
||||
label: "24-Stunden Format",
|
||||
description:
|
||||
"Verwende das 24-Stunden Format anstelle des 12-Stunden Formats",
|
||||
description: "Verwende das 24-Stunden Format anstelle des 12-Stunden Formats",
|
||||
},
|
||||
isLocaleTime: {
|
||||
label: "Lokale Zeit verwenden",
|
||||
|
||||
@@ -121,8 +121,7 @@ export default {
|
||||
label: "Delete user permanently",
|
||||
description:
|
||||
"Deletes this user including their preferences. Will not delete any boards. User will not be notified.",
|
||||
confirm:
|
||||
"Are you sure, that you want to delete the user {username} with his preferences?",
|
||||
confirm: "Are you sure, that you want to delete the user {username} with his preferences?",
|
||||
},
|
||||
select: {
|
||||
label: "Select user",
|
||||
@@ -147,8 +146,7 @@ export default {
|
||||
item: {
|
||||
admin: {
|
||||
label: "Administrator",
|
||||
description:
|
||||
"Members with this permission have full access to all features and settings",
|
||||
description: "Members with this permission have full access to all features and settings",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -165,8 +163,7 @@ export default {
|
||||
},
|
||||
"modify-all": {
|
||||
label: "Modify all boards",
|
||||
description:
|
||||
"Allow members to modify all boards (Does not include access control and danger zone)",
|
||||
description: "Allow members to modify all boards (Does not include access control and danger zone)",
|
||||
},
|
||||
"full-access": {
|
||||
label: "Full board access",
|
||||
@@ -184,8 +181,7 @@ export default {
|
||||
},
|
||||
"use-all": {
|
||||
label: "Use all integrations",
|
||||
description:
|
||||
"Allows members to add any integrations to their boards",
|
||||
description: "Allows members to add any integrations to their boards",
|
||||
},
|
||||
"interact-all": {
|
||||
label: "Interact with any integration",
|
||||
@@ -193,8 +189,7 @@ export default {
|
||||
},
|
||||
"full-access": {
|
||||
label: "Full integration access",
|
||||
description:
|
||||
"Allow members to manage, use and interact with any integration",
|
||||
description: "Allow members to manage, use and interact with any integration",
|
||||
},
|
||||
},
|
||||
},
|
||||
@@ -214,8 +209,7 @@ export default {
|
||||
transfer: {
|
||||
label: "Transfer ownership",
|
||||
description: "Transfer ownership of this group to another user.",
|
||||
confirm:
|
||||
"Are you sure you want to transfer ownership for the group {name} to {username}?",
|
||||
confirm: "Are you sure you want to transfer ownership for the group {name} to {username}?",
|
||||
notification: {
|
||||
success: {
|
||||
message: "Transfered group {group} successfully to {user}",
|
||||
@@ -234,8 +228,7 @@ export default {
|
||||
},
|
||||
delete: {
|
||||
label: "Delete group",
|
||||
description:
|
||||
"Once you delete a group, there is no going back. Please be certain.",
|
||||
description: "Once you delete a group, there is no going back. Please be certain.",
|
||||
confirm: "Are you sure you want to delete the group {name}?",
|
||||
notification: {
|
||||
success: {
|
||||
@@ -386,8 +379,7 @@ export default {
|
||||
},
|
||||
testConnection: {
|
||||
action: "Test connection",
|
||||
alertNotice:
|
||||
"The Save button is enabled once a successful connection is established",
|
||||
alertNotice: "The Save button is enabled once a successful connection is established",
|
||||
notification: {
|
||||
success: {
|
||||
title: "Connection successful",
|
||||
@@ -457,8 +449,7 @@ export default {
|
||||
checkoutDocs: "Check out the documentation",
|
||||
},
|
||||
iconPicker: {
|
||||
header:
|
||||
"Type name or objects to filter for icons... Homarr will search through {countIcons} icons for you.",
|
||||
header: "Type name or objects to filter for icons... Homarr will search through {countIcons} icons for you.",
|
||||
},
|
||||
notification: {
|
||||
create: {
|
||||
@@ -481,6 +472,10 @@ export default {
|
||||
multiSelect: {
|
||||
placeholder: "Pick one or more values",
|
||||
},
|
||||
multiText: {
|
||||
placeholder: "Add more values",
|
||||
addLabel: `Add {value}`,
|
||||
},
|
||||
select: {
|
||||
placeholder: "Pick value",
|
||||
badge: {
|
||||
@@ -505,7 +500,7 @@ export default {
|
||||
preferences: "Your preferences",
|
||||
logout: "Logout",
|
||||
login: "Login",
|
||||
navigateDefaultBoard: "Navigate to default board",
|
||||
homeBoard: "Your home board",
|
||||
loggedOut: "Logged out",
|
||||
},
|
||||
},
|
||||
@@ -515,6 +510,31 @@ export default {
|
||||
show: "Show preview",
|
||||
hide: "Hide preview",
|
||||
},
|
||||
zod: {
|
||||
errors: {
|
||||
default: "This field is invalid",
|
||||
required: "This field is required",
|
||||
string: {
|
||||
startsWith: "This field must start with {startsWith}",
|
||||
endsWith: "This field must end with {endsWith}",
|
||||
includes: "This field must include {includes}",
|
||||
invalidEmail: "This field must be a valid email",
|
||||
},
|
||||
tooSmall: {
|
||||
string: "This field must be at least {minimum} characters long",
|
||||
number: "This field must be greater than or equal to {minimum}",
|
||||
},
|
||||
tooBig: {
|
||||
string: "This field must be at most {maximum} characters long",
|
||||
number: "This field must be less than or equal to {maximum}",
|
||||
},
|
||||
custom: {
|
||||
passwordsDoNotMatch: "Passwords do not match",
|
||||
boardAlreadyExists: "A board with this name already exists",
|
||||
// TODO: Add custom error messages
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
section: {
|
||||
category: {
|
||||
@@ -581,10 +601,17 @@ export default {
|
||||
},
|
||||
edit: {
|
||||
title: "Edit item",
|
||||
advancedOptions: {
|
||||
label: "Advanced options",
|
||||
title: "Advanced item options",
|
||||
},
|
||||
field: {
|
||||
integrations: {
|
||||
label: "Integrations",
|
||||
},
|
||||
customCssClasses: {
|
||||
label: "Custom css classes",
|
||||
},
|
||||
},
|
||||
},
|
||||
remove: {
|
||||
@@ -620,8 +647,7 @@ export default {
|
||||
option: {
|
||||
customTitleToggle: {
|
||||
label: "Custom Title/City display",
|
||||
description:
|
||||
"Show off a custom title or the name of the city/country on top of the clock.",
|
||||
description: "Show off a custom title or the name of the city/country on top of the clock.",
|
||||
},
|
||||
customTitle: {
|
||||
label: "Title",
|
||||
@@ -712,8 +738,7 @@ export default {
|
||||
},
|
||||
iframe: {
|
||||
name: "iFrame",
|
||||
description:
|
||||
"Embed any content from the internet. Some websites may restrict access.",
|
||||
description: "Embed any content from the internet. Some websites may restrict access.",
|
||||
option: {
|
||||
embedUrl: {
|
||||
label: "Embed URL",
|
||||
@@ -745,14 +770,12 @@ export default {
|
||||
},
|
||||
error: {
|
||||
noUrl: "No iFrame URL provided",
|
||||
noBrowerSupport:
|
||||
"Your Browser does not support iframes. Please update your browser.",
|
||||
noBrowerSupport: "Your Browser does not support iframes. Please update your browser.",
|
||||
},
|
||||
},
|
||||
weather: {
|
||||
name: "Weather",
|
||||
description:
|
||||
"Displays the current weather information of a set location.",
|
||||
description: "Displays the current weather information of a set location.",
|
||||
option: {
|
||||
isFormatFahrenheit: {
|
||||
label: "Temperature in Fahrenheit",
|
||||
@@ -768,8 +791,7 @@ export default {
|
||||
},
|
||||
forecastDayCount: {
|
||||
label: "Amount of forecast days",
|
||||
description:
|
||||
"When the widget is not wide enough, less days are shown",
|
||||
description: "When the widget is not wide enough, less days are shown",
|
||||
},
|
||||
},
|
||||
kind: {
|
||||
@@ -822,8 +844,7 @@ export default {
|
||||
},
|
||||
hasAutoPlay: {
|
||||
label: "Autoplay",
|
||||
description:
|
||||
"Autoplay only works when muted because of browser restrictions",
|
||||
description: "Autoplay only works when muted because of browser restrictions",
|
||||
},
|
||||
isMuted: {
|
||||
label: "Muted",
|
||||
@@ -896,13 +917,11 @@ export default {
|
||||
option: {
|
||||
repeat: {
|
||||
label: "Repeat",
|
||||
description:
|
||||
"The image is repeated as much as needed to cover the whole background image painting area.",
|
||||
description: "The image is repeated as much as needed to cover the whole background image painting area.",
|
||||
},
|
||||
"no-repeat": {
|
||||
label: "No repeat",
|
||||
description:
|
||||
"The image is not repeated and may not fill the entire space.",
|
||||
description: "The image is not repeated and may not fill the entire space.",
|
||||
},
|
||||
"repeat-x": {
|
||||
label: "Repeat X",
|
||||
@@ -939,7 +958,13 @@ export default {
|
||||
label: "Opacity",
|
||||
},
|
||||
customCss: {
|
||||
label: "Custom CSS",
|
||||
label: "Custom css for this board",
|
||||
description: "Further, customize your dashboard using CSS, only recommended for experienced users",
|
||||
customClassesAlert: {
|
||||
title: "Custom classes",
|
||||
description:
|
||||
"You can add custom classes to your board items in the advanced options of each item and use them in the custom CSS above.",
|
||||
},
|
||||
},
|
||||
columnCount: {
|
||||
label: "Column count",
|
||||
@@ -948,13 +973,15 @@ export default {
|
||||
label: "Name",
|
||||
},
|
||||
},
|
||||
content: {
|
||||
metaTitle: "{boardName} board",
|
||||
},
|
||||
setting: {
|
||||
title: "Settings for {boardName} board",
|
||||
section: {
|
||||
general: {
|
||||
title: "General",
|
||||
unrecognizedLink:
|
||||
"The provided link is not recognized and won't preview, it might still work.",
|
||||
unrecognizedLink: "The provided link is not recognized and won't preview, it might still work.",
|
||||
},
|
||||
layout: {
|
||||
title: "Layout",
|
||||
@@ -1011,8 +1038,7 @@ export default {
|
||||
action: {
|
||||
rename: {
|
||||
label: "Rename board",
|
||||
description:
|
||||
"Changing the name will break any links to this board.",
|
||||
description: "Changing the name will break any links to this board.",
|
||||
button: "Change name",
|
||||
modal: {
|
||||
title: "Rename board",
|
||||
@@ -1043,8 +1069,7 @@ export default {
|
||||
},
|
||||
delete: {
|
||||
label: "Delete this board",
|
||||
description:
|
||||
"Once you delete a board, there is no going back. Please be certain.",
|
||||
description: "Once you delete a board, there is no going back. Please be certain.",
|
||||
button: "Delete this board",
|
||||
confirm: {
|
||||
title: "Delete board",
|
||||
@@ -1089,6 +1114,7 @@ export default {
|
||||
logs: "Logs",
|
||||
},
|
||||
},
|
||||
settings: "Settings",
|
||||
help: {
|
||||
label: "Help",
|
||||
items: {
|
||||
@@ -1130,6 +1156,13 @@ export default {
|
||||
settings: {
|
||||
label: "Settings",
|
||||
},
|
||||
setHomeBoard: {
|
||||
label: "Set as your home board",
|
||||
badge: {
|
||||
label: "Home",
|
||||
tooltip: "This board will show as your home board",
|
||||
},
|
||||
},
|
||||
delete: {
|
||||
label: "Delete permanently",
|
||||
confirm: {
|
||||
@@ -1254,6 +1287,30 @@ export default {
|
||||
},
|
||||
},
|
||||
},
|
||||
settings: {
|
||||
title: "Settings",
|
||||
section: {
|
||||
analytics: {
|
||||
title: "Analytics",
|
||||
general: {
|
||||
title: "Send anonymous analytics",
|
||||
text: "Homarr will send anonymized analytics using the open source software Umami. It never collects any personal information and is therefore fully GDPR & CCPA compliant. We encourage you to enable analytics because it helps our open source team to identify issues and prioritize our backlog.",
|
||||
},
|
||||
widgetData: {
|
||||
title: "Widget data",
|
||||
text: "Send which widgets (and their quantity) you have configured. Does not include URLs, names or any other data.",
|
||||
},
|
||||
integrationData: {
|
||||
title: "Integration data",
|
||||
text: "Send which integrations (and their quantity) you have configured. Does not include URLs, names or any other data.",
|
||||
},
|
||||
usersData: {
|
||||
title: "Users data",
|
||||
text: "Send the amount of users and whether you've activated SSO",
|
||||
},
|
||||
},
|
||||
},
|
||||
},
|
||||
about: {
|
||||
version: "Version {version}",
|
||||
text: "Homarr is a community driven open source project that is being maintained by volunteers. Thanks to these people, Homarr has been a growing project since 2021. Our team is working completely remote from many different countries on Homarr in their leisure time for no compensation.",
|
||||
|
||||
21
packages/translation/src/locale-attributes.ts
Normal file
21
packages/translation/src/locale-attributes.ts
Normal file
@@ -0,0 +1,21 @@
|
||||
import type { SupportedLanguage } from ".";
|
||||
|
||||
export const localeAttributes: Record<
|
||||
SupportedLanguage,
|
||||
{
|
||||
name: string;
|
||||
translatedName: string;
|
||||
flagIcon: string;
|
||||
}
|
||||
> = {
|
||||
de: {
|
||||
name: "Deutsch",
|
||||
translatedName: "German",
|
||||
flagIcon: "de",
|
||||
},
|
||||
en: {
|
||||
name: "English",
|
||||
translatedName: "English",
|
||||
flagIcon: "us",
|
||||
},
|
||||
};
|
||||
@@ -3,9 +3,6 @@ import { createI18nServer } from "next-international/server";
|
||||
import { languageMapping } from "./lang";
|
||||
import enTranslation from "./lang/en";
|
||||
|
||||
export const { getI18n, getScopedI18n, getStaticParams } = createI18nServer(
|
||||
languageMapping(),
|
||||
{
|
||||
fallbackLocale: enTranslation,
|
||||
},
|
||||
);
|
||||
export const { getI18n, getScopedI18n, getStaticParams } = createI18nServer(languageMapping(), {
|
||||
fallbackLocale: enTranslation,
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user