From 732ef95bd9d900564c2a009bef77faae5a9a84d7 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:34:24 +0100 Subject: [PATCH 01/12] config: update stale.yml (#1847) --- .github/workflows/stale.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/stale.yml b/.github/workflows/stale.yml index 7775c56a0..631f6ea8f 100644 --- a/.github/workflows/stale.yml +++ b/.github/workflows/stale.yml @@ -21,7 +21,7 @@ jobs: - uses: actions/stale@v5 with: repo-token: ${{ secrets.GITHUB_TOKEN }} - stale-issue-message: "Hello 👋, this issue has been open for 60 without activity. Please close this issue if it's no longer relevant or has been resolved. Still relevant? Simply reply and I'll mark it as active." + stale-issue-message: "Hello 👋, this issue has been open for 60 days without activity. We mark issues to help prioritise and close dead issues. Can you confirm that this issue is still relevant on the latest version? I'll remove the stale label as soon as there is further activity on this issue. Thank you 🙏" stale-pr-message: 'Hello 👋, this PR has gone stale. Please reply to mark it as active.' stale-issue-label: 'Stale' stale-pr-label: 'Stale' From 957ba4e0588d7fb40db36a37148db927f40c4e33 Mon Sep 17 00:00:00 2001 From: Dennis Vesterlund Date: Thu, 25 Jan 2024 17:38:28 +0100 Subject: [PATCH 02/12] fix: schemas for lights attributes in home assistant entity widget --- src/tools/server/sdk/homeassistant/models/EntityState.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/server/sdk/homeassistant/models/EntityState.ts b/src/tools/server/sdk/homeassistant/models/EntityState.ts index 09eb9b2f2..167a8aaf0 100644 --- a/src/tools/server/sdk/homeassistant/models/EntityState.ts +++ b/src/tools/server/sdk/homeassistant/models/EntityState.ts @@ -2,7 +2,7 @@ import { z } from 'zod'; export const entityStateSchema = z.object({ - attributes: z.record(z.union([z.string(), z.number(), z.boolean(), z.null()])), + attributes: z.record(z.union([z.string(), z.number(), z.boolean(), z.null(), z.array(z.union([z.string(),z.number()]))])), entity_id: z.string(), last_changed: z.string().pipe(z.coerce.date()), last_updated: z.string().pipe(z.coerce.date()), From 4da75134ed0b3281749f8941c83f14f42c1c9534 Mon Sep 17 00:00:00 2001 From: Julian <1682314+spkesDE@users.noreply.github.com> Date: Thu, 25 Jan 2024 17:45:26 +0100 Subject: [PATCH 03/12] feat: add video background support (#1839) --- .../layout/Templates/BoardLayout.tsx | 41 +++++++++++++++++++ 1 file changed, 41 insertions(+) diff --git a/src/components/layout/Templates/BoardLayout.tsx b/src/components/layout/Templates/BoardLayout.tsx index 81f4ed712..f82730dac 100644 --- a/src/components/layout/Templates/BoardLayout.tsx +++ b/src/components/layout/Templates/BoardLayout.tsx @@ -243,6 +243,12 @@ const BackgroundImage = () => { return null; } + // Check if the background image URL is a video + const videoFormat = getVideoFormat(config?.settings.customization.backgroundImageUrl); + if (videoFormat) { + return ; + } + return ( { ); }; + +const getVideoFormat = (video: string) => { + const supportedFormats = ['mp4', 'webm', 'ogg']; + for(const format of supportedFormats) { + if(video.endsWith(format)) return format; + } + return undefined; +} + +interface BackgroundVideoProps { + videoSource: string; + videoFormat: string; +} + +const BackgroundVideo = ({videoSource, videoFormat}: BackgroundVideoProps) => { + return ( + + ); +}; + + export const useBoardLink = ( link: '/board' | `/board/${string}/customize` | `/board/${string}` ) => { From f1e0b9236c3c9d206c06284b0d17eb1fedf88506 Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Sat, 27 Jan 2024 22:12:04 +0100 Subject: [PATCH 04/12] config: new crowdin updates (#1834) --- .../cn/modules/media-requests-list.json | 2 +- public/locales/da/layout/manage.json | 2 +- public/locales/fr/manage/users.json | 6 +- public/locales/fr/manage/users/edit.json | 32 +++++----- .../smart-home/trigger-automation.json | 10 +-- public/locales/hu/common.json | 6 +- .../hu/layout/element-selector/selector.json | 2 +- public/locales/hu/layout/manage.json | 2 +- public/locales/hu/manage/boards.json | 10 +-- public/locales/hu/manage/users.json | 8 +-- public/locales/hu/manage/users/edit.json | 32 +++++----- public/locales/hu/modules/date.json | 14 ++--- .../locales/hu/modules/dns-hole-summary.json | 4 +- .../hu/modules/media-requests-list.json | 4 +- public/locales/hu/modules/rss.json | 2 +- .../hu/modules/smart-home/entity-state.json | 4 +- .../smart-home/trigger-automation.json | 10 +-- .../hu/settings/customization/general.json | 2 +- public/locales/it/layout/manage.json | 2 +- public/locales/it/manage/boards.json | 10 +-- .../it/modules/media-requests-list.json | 4 +- public/locales/it/modules/rss.json | 2 +- .../it/modules/smart-home/entity-state.json | 4 +- .../smart-home/trigger-automation.json | 10 +-- public/locales/pl/layout/manage.json | 2 +- public/locales/pl/manage/boards.json | 12 ++-- .../pl/modules/smart-home/entity-state.json | 16 ++--- .../smart-home/trigger-automation.json | 10 +-- public/locales/sk/layout/manage.json | 2 +- public/locales/sv/boards/common.json | 2 +- public/locales/sv/boards/customize.json | 24 +++---- public/locales/sv/layout/header.json | 4 +- public/locales/sv/layout/manage.json | 18 +++--- public/locales/sv/manage/boards.json | 38 ++++++------ public/locales/sv/manage/index.json | 20 +++--- public/locales/sv/manage/users.json | 16 ++--- public/locales/sv/manage/users/create.json | 28 ++++----- public/locales/sv/manage/users/edit.json | 2 +- public/locales/sv/manage/users/invites.json | 26 ++++---- public/locales/sv/modules/notebook.json | 62 +++++++++---------- public/locales/tw/layout/manage.json | 2 +- public/locales/tw/manage/boards.json | 10 +-- .../tw/modules/media-requests-list.json | 4 +- public/locales/tw/modules/rss.json | 2 +- .../tw/modules/smart-home/entity-state.json | 4 +- .../smart-home/trigger-automation.json | 10 +-- 46 files changed, 249 insertions(+), 249 deletions(-) diff --git a/public/locales/cn/modules/media-requests-list.json b/public/locales/cn/modules/media-requests-list.json index 8229632fe..244709768 100644 --- a/public/locales/cn/modules/media-requests-list.json +++ b/public/locales/cn/modules/media-requests-list.json @@ -18,7 +18,7 @@ "pendingApproval": "待批准", "declined": "已拒绝", "available": "可用", - "partial": "局部" + "partial": "部分" }, "tooltips": { "approve": "批准请求", diff --git a/public/locales/da/layout/manage.json b/public/locales/da/layout/manage.json index b07627cb4..49d3d72a0 100644 --- a/public/locales/da/layout/manage.json +++ b/public/locales/da/layout/manage.json @@ -26,7 +26,7 @@ "title": "Værktøjer", "items": { "docker": "Docker", - "api": "" + "api": "API" } }, "about": { diff --git a/public/locales/fr/manage/users.json b/public/locales/fr/manage/users.json index 6df92d04f..c90531a96 100644 --- a/public/locales/fr/manage/users.json +++ b/public/locales/fr/manage/users.json @@ -7,9 +7,9 @@ "filter": { "roles": { "all": "Tous", - "normal": "", - "admin": "", - "owner": "" + "normal": "Normal", + "admin": "Admin", + "owner": "Propriétaire" } }, "table": { diff --git a/public/locales/fr/manage/users/edit.json b/public/locales/fr/manage/users/edit.json index 456fd7c76..b1c725e0f 100644 --- a/public/locales/fr/manage/users/edit.json +++ b/public/locales/fr/manage/users/edit.json @@ -1,6 +1,6 @@ { - "metaTitle": "", - "back": "", + "metaTitle": "Utilisateur {{username}}", + "back": "Retour à la gestion des utilisateurs", "sections": { "general": { "title": "Général", @@ -14,40 +14,40 @@ } }, "security": { - "title": "", + "title": "Sécurité", "inputs": { "password": { - "label": "" + "label": "Nouveau mot de passe" }, "terminateExistingSessions": { - "label": "", - "description": "" + "label": "Mettre fin aux sessions existantes", + "description": "Forcer les utilisateurs à se reconnecter sur leurs appareils" }, "confirm": { "label": "Confirmer", - "description": "" + "description": "Le mot de passe va être mis à jour. Cette action ne peut pas être annulée." } } }, "roles": { - "title": "", - "currentRole": "", + "title": "Rôles", + "currentRole": "Rôle actuel : ", "badges": { - "owner": "", - "admin": "", - "normal": "" + "owner": "Propriétaire", + "admin": "Admin", + "normal": "Normal" } }, "deletion": { - "title": "", + "title": "Suppression de compte", "inputs": { "confirmUsername": { - "label": "", - "description": "" + "label": "Confirmer le nom d'utilisateur", + "description": "Tapez le nom d'utilisateur pour confirmer la suppression" }, "confirm": { "label": "Supprimer définitivement", - "description": "" + "description": "J'ai conscience que cette action est permanente et que toutes les données du compte seront perdues." } } } diff --git a/public/locales/fr/modules/smart-home/trigger-automation.json b/public/locales/fr/modules/smart-home/trigger-automation.json index 525c8cc07..e8d7351ab 100644 --- a/public/locales/fr/modules/smart-home/trigger-automation.json +++ b/public/locales/fr/modules/smart-home/trigger-automation.json @@ -1,12 +1,12 @@ { "descriptor": { - "name": "", - "description": "", + "name": "Automatisation Home Assistant", + "description": "Exécuter une automatisation", "settings": { - "title": "", + "title": "Exécuter une automatisation", "automationId": { - "label": "", - "info": "" + "label": "ID de l'automatisation", + "info": "Votre identifiant d'automatisation unique. Commence toujours par automation.XXXXX." }, "displayName": { "label": "Nom d'affichage" diff --git a/public/locales/hu/common.json b/public/locales/hu/common.json index 8bb6ce7ed..10a3d7a9f 100644 --- a/public/locales/hu/common.json +++ b/public/locales/hu/common.json @@ -1,7 +1,7 @@ { "save": "Mentés", - "apply": "", - "insert": "", + "apply": "Alkalmaz", + "insert": "Beillesztés", "about": "Névjegy", "cancel": "Mégse", "close": "Bezár", @@ -45,7 +45,7 @@ "seeMore": "Lásd még...", "position": { "left": "Bal", - "center": "", + "center": "Középre", "right": "Jobb" }, "attributes": { diff --git a/public/locales/hu/layout/element-selector/selector.json b/public/locales/hu/layout/element-selector/selector.json index d8da644b6..93066b519 100644 --- a/public/locales/hu/layout/element-selector/selector.json +++ b/public/locales/hu/layout/element-selector/selector.json @@ -22,5 +22,5 @@ "message": "Létrejött a \"{{name}}\" kategória" } }, - "importFromDocker": "" + "importFromDocker": "Importálás a dockerből" } diff --git a/public/locales/hu/layout/manage.json b/public/locales/hu/layout/manage.json index 8270328cd..ccb768b45 100644 --- a/public/locales/hu/layout/manage.json +++ b/public/locales/hu/layout/manage.json @@ -26,7 +26,7 @@ "title": "Eszközök", "items": { "docker": "Docker", - "api": "" + "api": "API" } }, "about": { diff --git a/public/locales/hu/manage/boards.json b/public/locales/hu/manage/boards.json index 4feebf35a..b475a07e4 100644 --- a/public/locales/hu/manage/boards.json +++ b/public/locales/hu/manage/boards.json @@ -16,15 +16,15 @@ "label": "Végleges törlés", "disabled": "Törlés letiltva, mivel a régebbi Homarr komponensek nem teszik lehetővé az alapértelmezett konfiguráció törlését. A törlés a jövőben lehetséges lesz." }, - "duplicate": "", + "duplicate": "Duplikátum", "rename": { - "label": "", + "label": "Átnevezés", "modal": { - "title": "", + "title": "A tábla átnevezése {{name}}", "fields": { "name": { - "label": "", - "placeholder": "" + "label": "Új név", + "placeholder": "Új fórumnév" } } } diff --git a/public/locales/hu/manage/users.json b/public/locales/hu/manage/users.json index 5949ba1be..9d8b73e17 100644 --- a/public/locales/hu/manage/users.json +++ b/public/locales/hu/manage/users.json @@ -6,10 +6,10 @@ }, "filter": { "roles": { - "all": "", - "normal": "", - "admin": "", - "owner": "" + "all": "Mind", + "normal": "Normál", + "admin": "Adminisztrátor", + "owner": "Tulajdonos" } }, "table": { diff --git a/public/locales/hu/manage/users/edit.json b/public/locales/hu/manage/users/edit.json index 8f3c9f455..75080f4ba 100644 --- a/public/locales/hu/manage/users/edit.json +++ b/public/locales/hu/manage/users/edit.json @@ -1,6 +1,6 @@ { - "metaTitle": "", - "back": "", + "metaTitle": "Felhasználó {{username}}", + "back": "Vissza a felhasználókezeléshez", "sections": { "general": { "title": "Általános", @@ -14,40 +14,40 @@ } }, "security": { - "title": "", + "title": "Biztonság", "inputs": { "password": { - "label": "" + "label": "Új jelszó" }, "terminateExistingSessions": { - "label": "", - "description": "" + "label": "Meglévő munkamenetek megszüntetése", + "description": "Kényszeríti a felhasználót, hogy újból bejelentkezzen az eszközein" }, "confirm": { "label": "Megerősít", - "description": "" + "description": "A jelszó frissül. A művelet nem vonható vissza." } } }, "roles": { - "title": "", - "currentRole": "", + "title": "Szerepek", + "currentRole": "Jelenlegi szerepe: ", "badges": { - "owner": "", - "admin": "", - "normal": "" + "owner": "Tulajdonos", + "admin": "Adminisztrátor", + "normal": "Normál" } }, "deletion": { - "title": "", + "title": "Fiók törlése", "inputs": { "confirmUsername": { - "label": "", - "description": "" + "label": "Felhasználónév megerősítése", + "description": "Írja be a felhasználónevet a törlés megerősítéséhez" }, "confirm": { "label": "Végleges törlés", - "description": "" + "description": "Tisztában vagyok vele, hogy ez a művelet végleges, és minden fiókadat elveszik." } } } diff --git a/public/locales/hu/modules/date.json b/public/locales/hu/modules/date.json index 7dd705b24..4ea92a887 100644 --- a/public/locales/hu/modules/date.json +++ b/public/locales/hu/modules/date.json @@ -5,11 +5,11 @@ "settings": { "title": "A Naptár widget beállításai", "timezone": { - "label": "", - "info": "" + "label": "Időzóna", + "info": "Válassza ki az időzóna nevét, a sajátját itt találja: " }, "customTitle": { - "label": "" + "label": "Városnév vagy egyéni cím" }, "display24HourFormat": { "label": "24 órás idő kijelzése" @@ -21,11 +21,11 @@ } }, "titleState": { - "label": "", - "info": "", + "label": "Óra címe", + "info": "Az egyéni cím és az időzóna kód megjeleníthető a widgeten.
Megjelenítheti a várost önmagában, nem jelenítheti meg,
vagy akár az időzónát is megjelenítheti önmagában, ha mindkettő ki van választva, de nincs cím.", "data": { - "both": "", - "city": "", + "both": "Cím és időzóna", + "city": "Csak a cím", "none": "Semmi" } } diff --git a/public/locales/hu/modules/dns-hole-summary.json b/public/locales/hu/modules/dns-hole-summary.json index 7d5c87de5..3a5c66e32 100644 --- a/public/locales/hu/modules/dns-hole-summary.json +++ b/public/locales/hu/modules/dns-hole-summary.json @@ -21,8 +21,8 @@ "metrics": { "domainsOnAdlist": "Domainek a blokkolólistákon", "queriesToday": "Mai lekérdezések", - "queriesBlockedTodayPercentage": "", - "queriesBlockedToday": "" + "queriesBlockedTodayPercentage": "Mai blokkolások", + "queriesBlockedToday": "Mai blokkolások" } } } diff --git a/public/locales/hu/modules/media-requests-list.json b/public/locales/hu/modules/media-requests-list.json index 04d840dad..fb08264f6 100644 --- a/public/locales/hu/modules/media-requests-list.json +++ b/public/locales/hu/modules/media-requests-list.json @@ -17,8 +17,8 @@ "approved": "Jóváhagyva", "pendingApproval": "Várakozás jóváhagyásra", "declined": "Elutasítva", - "available": "", - "partial": "" + "available": "Elérhető", + "partial": "Részleges" }, "tooltips": { "approve": "Kérelem megerősítése", diff --git a/public/locales/hu/modules/rss.json b/public/locales/hu/modules/rss.json index 12b5c1a57..6a429ee64 100644 --- a/public/locales/hu/modules/rss.json +++ b/public/locales/hu/modules/rss.json @@ -19,7 +19,7 @@ "label": "Szövegvonalak rögzítője" }, "sortByPublishDateAscending": { - "label": "" + "label": "Rendezés a közzététel dátuma szerint (növekvő)" } }, "card": { diff --git a/public/locales/hu/modules/smart-home/entity-state.json b/public/locales/hu/modules/smart-home/entity-state.json index 7069939d3..3bae542a3 100644 --- a/public/locales/hu/modules/smart-home/entity-state.json +++ b/public/locales/hu/modules/smart-home/entity-state.json @@ -10,8 +10,8 @@ "info": "Egyedi egység ID a Home Assistantben. Másolás az egységre kattintva > Kattintson a fogaskerék ikonra > Kattintson a másolás gombra az „Egység ID”-nél. Előfordulhat, hogy egyes egyéni egységek nem támogatottak." }, "automationId": { - "label": "", - "info": "" + "label": "Választható automatizálási azonosító", + "info": "Az Ön egyedi automatizálási azonosítója. Mindig az automatizálással kezdődik.XXXX. Ha nincs beállítva, a widget nem kattintható, és csak az állapotot jeleníti meg. A kattintás után az entitás állapota frissül." }, "displayName": { "label": "Megjelenített név" diff --git a/public/locales/hu/modules/smart-home/trigger-automation.json b/public/locales/hu/modules/smart-home/trigger-automation.json index 2e2cb5c0c..28a3f79b0 100644 --- a/public/locales/hu/modules/smart-home/trigger-automation.json +++ b/public/locales/hu/modules/smart-home/trigger-automation.json @@ -1,12 +1,12 @@ { "descriptor": { - "name": "", - "description": "", + "name": "Home Assistant automatizálás", + "description": "Automatizálás végrehajtása", "settings": { - "title": "", + "title": "Automatizálás végrehajtása", "automationId": { - "label": "", - "info": "" + "label": "Automatizálási azonosító", + "info": "Az Ön egyedi automatizálási azonosítója. Mindig automation.XXXXX." }, "displayName": { "label": "Megjelenített név" diff --git a/public/locales/hu/settings/customization/general.json b/public/locales/hu/settings/customization/general.json index 56a64666e..e7cbef873 100644 --- a/public/locales/hu/settings/customization/general.json +++ b/public/locales/hu/settings/customization/general.json @@ -22,7 +22,7 @@ "description": "A Homarr konfigurálása fogyatékkal élő és fogyatékkal élő felhasználók számára" }, "access": { - "name": "", + "name": "Hozzáférés", "description": "Annak beállítása, hogy ki férhet hozzá a táblához" } } diff --git a/public/locales/it/layout/manage.json b/public/locales/it/layout/manage.json index 277533929..1646feebd 100644 --- a/public/locales/it/layout/manage.json +++ b/public/locales/it/layout/manage.json @@ -26,7 +26,7 @@ "title": "Strumenti", "items": { "docker": "Docker", - "api": "" + "api": "API" } }, "about": { diff --git a/public/locales/it/manage/boards.json b/public/locales/it/manage/boards.json index 1a0acc346..970dbb50c 100644 --- a/public/locales/it/manage/boards.json +++ b/public/locales/it/manage/boards.json @@ -16,15 +16,15 @@ "label": "Elimina definitivamente", "disabled": "Eliminazione disabilitata, perché i vecchi componenti di Homarr non consentono la cancellazione della configurazione predefinita. La cancellazione sarà possibile in futuro." }, - "duplicate": "", + "duplicate": "Duplica", "rename": { - "label": "", + "label": "Rinomina", "modal": { - "title": "", + "title": "Rinomina scheda {{name}}", "fields": { "name": { - "label": "", - "placeholder": "" + "label": "Nuovo nome", + "placeholder": "Nuovo nome scheda" } } } diff --git a/public/locales/it/modules/media-requests-list.json b/public/locales/it/modules/media-requests-list.json index 9b11ea17c..44d5f4f05 100644 --- a/public/locales/it/modules/media-requests-list.json +++ b/public/locales/it/modules/media-requests-list.json @@ -17,8 +17,8 @@ "approved": "Approvato", "pendingApproval": "In attesa di approvazione", "declined": "Rifiutato", - "available": "", - "partial": "" + "available": "Disponibile", + "partial": "Parziale" }, "tooltips": { "approve": "Approva richieste", diff --git a/public/locales/it/modules/rss.json b/public/locales/it/modules/rss.json index 87b32acb4..da0bc74fa 100644 --- a/public/locales/it/modules/rss.json +++ b/public/locales/it/modules/rss.json @@ -19,7 +19,7 @@ "label": "Blocco righe di testo" }, "sortByPublishDateAscending": { - "label": "" + "label": "Ordina per data di pubblicazione (ascendente)" } }, "card": { diff --git a/public/locales/it/modules/smart-home/entity-state.json b/public/locales/it/modules/smart-home/entity-state.json index 928b25a7d..9dc1ce730 100644 --- a/public/locales/it/modules/smart-home/entity-state.json +++ b/public/locales/it/modules/smart-home/entity-state.json @@ -10,8 +10,8 @@ "info": "ID entità univoco in Home Assistant. Copia facendo clic sull'entità > clic sull'icona della rondella > clic sul pulsante copia in \"ID entità\". Alcune entità personalizzate potrebbero non essere supportate." }, "automationId": { - "label": "", - "info": "" + "label": "ID automazione opzionale", + "info": "Il tuo ID di automazione univoco. Inizia sempre con automation.XXXXX. Se non impostato, il widget non sarà selezionabile e visualizzerà solo lo stato. Dopo il clic, lo stato dell'entità verrà aggiornato." }, "displayName": { "label": "Visualizza nome" diff --git a/public/locales/it/modules/smart-home/trigger-automation.json b/public/locales/it/modules/smart-home/trigger-automation.json index 68886dd75..e56289064 100644 --- a/public/locales/it/modules/smart-home/trigger-automation.json +++ b/public/locales/it/modules/smart-home/trigger-automation.json @@ -1,12 +1,12 @@ { "descriptor": { - "name": "", - "description": "", + "name": "Automazione Home Assistant", + "description": "Esegue un'automazione", "settings": { - "title": "", + "title": "Esegue un'automazione", "automationId": { - "label": "", - "info": "" + "label": "ID automazione", + "info": "Il tuo ID di automazione univoco. Inizia sempre con automation.XXXXX." }, "displayName": { "label": "Visualizza nome" diff --git a/public/locales/pl/layout/manage.json b/public/locales/pl/layout/manage.json index 6fa2ae848..ca25e0b07 100644 --- a/public/locales/pl/layout/manage.json +++ b/public/locales/pl/layout/manage.json @@ -26,7 +26,7 @@ "title": "Narzędzia", "items": { "docker": "Docker", - "api": "" + "api": "API" } }, "about": { diff --git a/public/locales/pl/manage/boards.json b/public/locales/pl/manage/boards.json index 1bf0aabbe..61f76d93e 100644 --- a/public/locales/pl/manage/boards.json +++ b/public/locales/pl/manage/boards.json @@ -16,15 +16,15 @@ "label": "Usuń trwale", "disabled": "Usuwanie nie jest możliwe, ponieważ starsze komponenty Homarr nie pozwalają na usunięcie domyślnej konfiguracji. Usunięcie będzie możliwe w przyszłości." }, - "duplicate": "", + "duplicate": "Zduplikuj", "rename": { - "label": "", + "label": "Zmień nazwę", "modal": { - "title": "", + "title": "Zmień nazwę tablicy {{name}}", "fields": { "name": { - "label": "", - "placeholder": "" + "label": "Nowa nazwa", + "placeholder": "Nowa nazwa tablicy" } } } @@ -32,7 +32,7 @@ }, "badges": { "fileSystem": "System plików", - "default": "Domyślnie" + "default": "Domyślne" } }, "buttons": { diff --git a/public/locales/pl/modules/smart-home/entity-state.json b/public/locales/pl/modules/smart-home/entity-state.json index 3ebdabdb8..34458e12c 100644 --- a/public/locales/pl/modules/smart-home/entity-state.json +++ b/public/locales/pl/modules/smart-home/entity-state.json @@ -1,17 +1,17 @@ { - "entityNotFound": "Nie znaleziono obiektu", + "entityNotFound": "Nie znaleziono encji", "descriptor": { - "name": "Obiekt asystenta domu", - "description": "Aktualny stan obiektu w Asystencie Domu", + "name": "Encja Home Assistant", + "description": "Aktualny stan encji w Home Assistant", "settings": { - "title": "Stan obiektu", + "title": "Stan encji", "entityId": { - "label": "ID obiektu", - "info": "Unikalne ID obiektu w Asystencie Domu. Kopiuj klikając na obiekt > Kliknij ikonę koła zębatego > Kliknij na przycisk kopiuj na 'ID obiektu'. Niektóre niestandardowe obiekty mogą nie być obsługiwane." + "label": "ID encji", + "info": "Unikalne ID encji w Home Assistant. Kopiuj klikając na encji > Kliknij ikonę koła zębatego > Kliknij na przycisk kopiuj na 'ID encji'. Niektóre niestandardowe obiekty mogą nie być obsługiwane." }, "automationId": { - "label": "", - "info": "" + "label": "Opcjonalne ID automatyzacji", + "info": "Twój unikalny identyfikator automatyzacji. Zawsze zaczyna się od automation.XXXXX. Jeśli nie jest ustawiony, widżet nie będzie klikalny i będzie wyświetlał tylko stan. Po kliknięciu stan encji zostanie odświeżony." }, "displayName": { "label": "Nazwa wyświetlana" diff --git a/public/locales/pl/modules/smart-home/trigger-automation.json b/public/locales/pl/modules/smart-home/trigger-automation.json index c5a5f4541..b26491faf 100644 --- a/public/locales/pl/modules/smart-home/trigger-automation.json +++ b/public/locales/pl/modules/smart-home/trigger-automation.json @@ -1,12 +1,12 @@ { "descriptor": { - "name": "", - "description": "", + "name": "Automatyzacja Home Assistant", + "description": "Wykonaj automatyzację", "settings": { - "title": "", + "title": "Wykonaj automatyzację", "automationId": { - "label": "", - "info": "" + "label": "ID automatyzacji", + "info": "Twój unikalny identyfikator automatyzacji. Zawsze zaczyna się od automation.XXXXX." }, "displayName": { "label": "Nazwa wyświetlana" diff --git a/public/locales/sk/layout/manage.json b/public/locales/sk/layout/manage.json index 7b7e6b986..54e776c1c 100644 --- a/public/locales/sk/layout/manage.json +++ b/public/locales/sk/layout/manage.json @@ -26,7 +26,7 @@ "title": "Nástroje", "items": { "docker": "Docker", - "api": "" + "api": "API" } }, "about": { diff --git a/public/locales/sv/boards/common.json b/public/locales/sv/boards/common.json index a70db06bf..081703743 100644 --- a/public/locales/sv/boards/common.json +++ b/public/locales/sv/boards/common.json @@ -1,5 +1,5 @@ { "header": { - "customize": "" + "customize": "Anpassa tavlan" } } \ No newline at end of file diff --git a/public/locales/sv/boards/customize.json b/public/locales/sv/boards/customize.json index 48604fe99..696a032f0 100644 --- a/public/locales/sv/boards/customize.json +++ b/public/locales/sv/boards/customize.json @@ -1,29 +1,29 @@ { - "metaTitle": "", - "pageTitle": "", - "backToBoard": "", + "metaTitle": "Anpassa {{name}} Board", + "pageTitle": "Anpassning för {{name}} Board", + "backToBoard": "Tillbaka till tavla", "settings": { "appearance": { - "primaryColor": "", - "secondaryColor": "" + "primaryColor": "Primärfärg", + "secondaryColor": "Sekundärfärg" } }, "save": { - "button": "", - "note": "" + "button": "Spara ändringar", + "note": "Var försiktig, du har osparade ändringar!" }, "notifications": { "pending": { - "title": "", - "message": "" + "title": "Sparar anpassning", + "message": "Vänligen vänta medan vi sparar din anpassning" }, "success": { - "title": "", - "message": "" + "title": "Anpassning sparad", + "message": "Din anpassning har sparats" }, "error": { "title": "Fel", - "message": "" + "message": "Det gick inte att spara ändringar" } } } \ No newline at end of file diff --git a/public/locales/sv/layout/header.json b/public/locales/sv/layout/header.json index 0a8f24770..56802f06a 100644 --- a/public/locales/sv/layout/header.json +++ b/public/locales/sv/layout/header.json @@ -14,14 +14,14 @@ "preferences": "Användarinställningar", "defaultBoard": "Standard instrumentpanel", "manage": "Hantera", - "logout": "", + "logout": "Logga ut från {{username}}", "login": "Logga in" } }, "modals": { "movie": { "title": "", - "topResults": "" + "topResults": "Topp {{count}} resultat för {{search}}." } } } \ No newline at end of file diff --git a/public/locales/sv/layout/manage.json b/public/locales/sv/layout/manage.json index ea0e2b543..406c112c1 100644 --- a/public/locales/sv/layout/manage.json +++ b/public/locales/sv/layout/manage.json @@ -1,29 +1,29 @@ { "navigation": { "home": { - "title": "" + "title": "Hem" }, "boards": { - "title": "" + "title": "Tavlor" }, "users": { - "title": "", + "title": "Användare", "items": { "manage": "Hantera", - "invites": "" + "invites": "Inbjudningar" } }, "help": { - "title": "", + "title": "Hjälp", "items": { "documentation": "Dokumentation", - "report": "", - "discord": "", - "contribute": "" + "report": "Rapportera problem / bugg", + "discord": "Gemenskapens Discord", + "contribute": "Bidra" } }, "tools": { - "title": "", + "title": "Verktyg", "items": { "docker": "Docker", "api": "API" diff --git a/public/locales/sv/manage/boards.json b/public/locales/sv/manage/boards.json index f68015e5e..542a68f37 100644 --- a/public/locales/sv/manage/boards.json +++ b/public/locales/sv/manage/boards.json @@ -1,6 +1,6 @@ { - "metaTitle": "", - "pageTitle": "", + "metaTitle": "Tavlor", + "pageTitle": "Tavlor", "cards": { "statistics": { "apps": "Appar", @@ -8,49 +8,49 @@ "categories": "Kategorier" }, "buttons": { - "view": "" + "view": "Visa tavlan" }, "menu": { - "setAsDefault": "", + "setAsDefault": "Ange som standardtavla", "delete": { - "label": "", - "disabled": "" + "label": "Radera permanent", + "disabled": "Borttagning avaktiverad, eftersom äldre Homarr-komponenter inte tillåter radering av standardkonfigurationen. Radering kommer att vara möjlig i framtiden." }, - "duplicate": "", + "duplicate": "Duplicera", "rename": { - "label": "", + "label": "Ändra namn", "modal": { - "title": "", + "title": "Byt namn på tavlan {{name}}", "fields": { "name": { - "label": "", - "placeholder": "" + "label": "Nytt namn", + "placeholder": "Nytt namn på tavlan" } } } } }, "badges": { - "fileSystem": "", - "default": "" + "fileSystem": "Filsystem", + "default": "Standard" } }, "buttons": { - "create": "" + "create": "Skapa ny tavla" }, "modals": { "delete": { - "title": "", - "text": "" + "title": "Ta bort tavla", + "text": "Är du säker på att du vill radera denna tavla? Denna åtgärd kan inte ångras och din data kommer att gå förlorade permanent." }, "create": { - "title": "", - "text": "", + "title": "Skapa tavla", + "text": "Namnet kan inte ändras efter att en tavla har skapats.", "form": { "name": { "label": "Namn" }, - "submit": "" + "submit": "Skapa" } } } diff --git a/public/locales/sv/manage/index.json b/public/locales/sv/manage/index.json index 452c9010b..70d930f2a 100644 --- a/public/locales/sv/manage/index.json +++ b/public/locales/sv/manage/index.json @@ -1,23 +1,23 @@ { "metaTitle": "Hantera", "hero": { - "title": "", - "fallbackUsername": "", - "subtitle": "" + "title": "Välkommen tillbaka, {{username}}", + "fallbackUsername": "Anonym", + "subtitle": "Välkommen till din applikationshubb. Organisera, optimera och erövra!" }, "quickActions": { - "title": "", + "title": "Snabbåtgärder", "boards": { - "title": "", - "subtitle": "" + "title": "Dina tavlor", + "subtitle": "Skapa och hantera dina tavlor" }, "inviteUsers": { - "title": "", - "subtitle": "" + "title": "Bjud in en ny användare", + "subtitle": "Skapa och skicka en inbjudan för registrering" }, "manageUsers": { - "title": "", - "subtitle": "" + "title": "Hantera användare", + "subtitle": "Ta bort och hantera dina användare" } } } \ No newline at end of file diff --git a/public/locales/sv/manage/users.json b/public/locales/sv/manage/users.json index e937c9a04..16965f8db 100644 --- a/public/locales/sv/manage/users.json +++ b/public/locales/sv/manage/users.json @@ -1,12 +1,12 @@ { - "metaTitle": "", - "pageTitle": "", + "metaTitle": "Användare", + "pageTitle": "Hantera användare", "buttons": { - "create": "" + "create": "Skapa" }, "filter": { "roles": { - "all": "", + "all": "Alla", "normal": "", "admin": "", "owner": "" @@ -19,13 +19,13 @@ } }, "tooltips": { - "deleteUser": "", - "demoteAdmin": "", - "promoteToAdmin": "" + "deleteUser": "Ta bort användare", + "demoteAdmin": "Ta bort administratör", + "promoteToAdmin": "Befordra till administratör" }, "modals": { "delete": { - "title": "", + "title": "Ta bort användare {{name}}", "text": "" }, "change-role": { diff --git a/public/locales/sv/manage/users/create.json b/public/locales/sv/manage/users/create.json index d441e1f57..3fb2a1563 100644 --- a/public/locales/sv/manage/users/create.json +++ b/public/locales/sv/manage/users/create.json @@ -12,41 +12,41 @@ } }, "security": { - "title": "", + "title": "Andra steget", "text": "Lösenord", "password": { "label": "Lösenord" } }, "finish": { - "title": "", - "text": "", + "title": "Bekräftelse", + "text": "Spara till databas", "card": { - "title": "", - "text": "" + "title": "Granska dina inmatningar", + "text": "När du har skickat in dina data till databasen kommer användaren att kunna logga in. Är du säker på att du vill lagra denna användare i databasen och aktivera inloggningen?" }, "table": { "header": { - "property": "", - "value": "", + "property": "Egenskap", + "value": "Värde", "username": "Användarnamn", "email": "", "password": "Lösenord" }, - "notSet": "", - "valid": "" + "notSet": "Inte anget", + "valid": "Giltig" }, - "failed": "" + "failed": "Skapandet av användare har misslyckats: {{error}}" }, "completed": { "alert": { - "title": "", - "text": "" + "title": "Användaren skapades", + "text": "Användaren skapades i databasen. De kan nu logga in." } } }, "buttons": { - "generateRandomPassword": "", - "createAnother": "" + "generateRandomPassword": "Generera slumpmässigt", + "createAnother": "Skapa en till" } } \ No newline at end of file diff --git a/public/locales/sv/manage/users/edit.json b/public/locales/sv/manage/users/edit.json index eb6d81e37..1d3e780ab 100644 --- a/public/locales/sv/manage/users/edit.json +++ b/public/locales/sv/manage/users/edit.json @@ -46,7 +46,7 @@ "description": "" }, "confirm": { - "label": "", + "label": "Radera permanent", "description": "" } } diff --git a/public/locales/sv/manage/users/invites.json b/public/locales/sv/manage/users/invites.json index 41730646e..68f5440fd 100644 --- a/public/locales/sv/manage/users/invites.json +++ b/public/locales/sv/manage/users/invites.json @@ -1,30 +1,30 @@ { - "metaTitle": "", - "pageTitle": "", - "description": "", + "metaTitle": "Användarinbjudningar", + "pageTitle": "Hantera användarinbjudningar", + "description": "Med hjälp av inbjudningar kan du bjuda in användare till din Homarr-instans. En inbjudan är endast giltig under en viss tidsperiod och kan användas en gång. Löptiden måste vara mellan 5 minuter och 12 månader efter skapandet.", "button": { - "createInvite": "", - "deleteInvite": "" + "createInvite": "Skapa inbjudan", + "deleteInvite": "Ta bort inbjudan" }, "table": { "header": { "id": "ID", - "creator": "", - "expires": "", - "action": "" + "creator": "Skapare", + "expires": "Förfaller", + "action": "Åtgärder" }, "data": { - "expiresAt": "", - "expiresIn": "" + "expiresAt": "utgången {{at}}", + "expiresIn": "om {{in}}" } }, "modals": { "create": { - "title": "", + "title": "Skapa inbjudan", "description": "", "form": { "expires": "", - "submit": "" + "submit": "Skapa" } }, "copy": { @@ -40,7 +40,7 @@ } }, "delete": { - "title": "", + "title": "Ta bort inbjudan", "description": "" } }, diff --git a/public/locales/sv/modules/notebook.json b/public/locales/sv/modules/notebook.json index cfb4806d5..83c6d9d46 100644 --- a/public/locales/sv/modules/notebook.json +++ b/public/locales/sv/modules/notebook.json @@ -8,7 +8,7 @@ "label": "Visa verktygsfältet för att hjälpa dig skriva markdown" }, "allowReadOnlyCheck": { - "label": "" + "label": "Tillåt check i skrivskyddat läge" }, "content": { "label": "Innehållet i anteckningsboken" @@ -22,38 +22,38 @@ "strikethrough": "Genomstruken", "underline": "Understruken", "colorText": "Textfärg", - "colorHighlight": "", - "code": "", - "clear": "", - "heading": "", - "align": "", - "blockquote": "", - "horizontalLine": "", - "bulletList": "", - "orderedList": "", - "checkList": "", - "increaseIndent": "", - "decreaseIndent": "", - "link": "", - "unlink": "", - "image": "", - "addTable": "", - "deleteTable": "", - "colorCell": "", - "mergeCell": "", - "addColumnLeft": "", - "addColumnRight": "", - "deleteColumn": "", - "addRowTop": "", - "addRowBelow": "", - "deleteRow": "" + "colorHighlight": "Färgad markerad text", + "code": "Kod", + "clear": "Rensa formatering", + "heading": "Rubrik {{level}}", + "align": "Justera text: {{position}}", + "blockquote": "Blockcitat", + "horizontalLine": "Horisontell linje", + "bulletList": "Punktlista", + "orderedList": "Sorterad lista", + "checkList": "Checklista", + "increaseIndent": "Öka indrag", + "decreaseIndent": "Minska indrag", + "link": "Länk", + "unlink": "Ta bort länk", + "image": "Bädda in bild", + "addTable": "Lägg till tabell", + "deleteTable": "Ta bort tabell", + "colorCell": "Färga cell", + "mergeCell": "Växla sammanslagning av celler", + "addColumnLeft": "Lägg till kolumn före", + "addColumnRight": "Lägg till kolumn efter", + "deleteColumn": "Radera kolumn", + "addRowTop": "Lägg till rad före", + "addRowBelow": "Lägg till rad efter", + "deleteRow": "Radera rad" }, "modals": { - "clearColor": "", - "source": "", - "widthPlaceholder": "", - "columns": "", - "rows": "" + "clearColor": "Rensa färg", + "source": "Källa", + "widthPlaceholder": "Värde i % eller pixlar", + "columns": "Kolumner", + "rows": "Rader" } } } \ No newline at end of file diff --git a/public/locales/tw/layout/manage.json b/public/locales/tw/layout/manage.json index 82c63188a..b42795b77 100644 --- a/public/locales/tw/layout/manage.json +++ b/public/locales/tw/layout/manage.json @@ -26,7 +26,7 @@ "title": "工具", "items": { "docker": "Docker", - "api": "" + "api": "API" } }, "about": { diff --git a/public/locales/tw/manage/boards.json b/public/locales/tw/manage/boards.json index 661a95fcf..2d588a5da 100644 --- a/public/locales/tw/manage/boards.json +++ b/public/locales/tw/manage/boards.json @@ -16,15 +16,15 @@ "label": "永久刪除", "disabled": "刪除功能被禁用,因為較舊的 Homarr 組件不允許刪除預設的設定,將來可能會刪除" }, - "duplicate": "", + "duplicate": "複製", "rename": { - "label": "", + "label": "重新命名", "modal": { - "title": "", + "title": "重新命名面板 {{name}}", "fields": { "name": { - "label": "", - "placeholder": "" + "label": "新名稱", + "placeholder": "新面板名稱" } } } diff --git a/public/locales/tw/modules/media-requests-list.json b/public/locales/tw/modules/media-requests-list.json index a52e9631d..349f40816 100644 --- a/public/locales/tw/modules/media-requests-list.json +++ b/public/locales/tw/modules/media-requests-list.json @@ -17,8 +17,8 @@ "approved": "已准許", "pendingApproval": "待准許", "declined": "已拒絕", - "available": "", - "partial": "" + "available": "可用", + "partial": "部分" }, "tooltips": { "approve": "准許請求", diff --git a/public/locales/tw/modules/rss.json b/public/locales/tw/modules/rss.json index fa87b345d..6a419a5c8 100644 --- a/public/locales/tw/modules/rss.json +++ b/public/locales/tw/modules/rss.json @@ -19,7 +19,7 @@ "label": "文字線條" }, "sortByPublishDateAscending": { - "label": "" + "label": "依發布日期排序 (升序)" } }, "card": { diff --git a/public/locales/tw/modules/smart-home/entity-state.json b/public/locales/tw/modules/smart-home/entity-state.json index c00abf4fd..cbc79dfcc 100644 --- a/public/locales/tw/modules/smart-home/entity-state.json +++ b/public/locales/tw/modules/smart-home/entity-state.json @@ -10,8 +10,8 @@ "info": "Home Assistant 中的唯一實體ID,通過點擊實體 > 點擊齒輪圖示 > 點擊實體 ID 觸地的複製按鈕進行複製,某些自定義實體可能不支持" }, "automationId": { - "label": "", - "info": "" + "label": "可選自動化ID", + "info": "自動化ID必須以 automation.XXXX 開頭,當未設定時小部件將不可點擊,且僅顯示狀況,點擊後實體狀態將被更新" }, "displayName": { "label": "顯示名稱" diff --git a/public/locales/tw/modules/smart-home/trigger-automation.json b/public/locales/tw/modules/smart-home/trigger-automation.json index cc38a9bfa..4e785b522 100644 --- a/public/locales/tw/modules/smart-home/trigger-automation.json +++ b/public/locales/tw/modules/smart-home/trigger-automation.json @@ -1,12 +1,12 @@ { "descriptor": { - "name": "", - "description": "", + "name": "Home Assisant 自動化", + "description": "執行自動化", "settings": { - "title": "", + "title": "執行自動化", "automationId": { - "label": "", - "info": "" + "label": "自動化ID", + "info": "自動化ID,必須以 automation.XXXX 開頭" }, "displayName": { "label": "顯示名稱" From 6fdf1dfaa8a8faa39d83631c96a65f1e37bf440c Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sun, 28 Jan 2024 21:15:08 +0100 Subject: [PATCH 05/12] feat: #1835 copy apps (#1854) --- public/locales/en/common.json | 1 + .../Modals/EditAppModal/EditAppModal.tsx | 2 +- .../Overview/AvailableElementsOverview.tsx | 7 ++-- .../Dashboard/Tiles/Apps/AppMenu.tsx | 32 +++++++++++++++++++ .../Dashboard/Tiles/GenericTileMenu.tsx | 16 ++++++++-- src/tools/config/wrapper-finder.ts | 3 ++ 6 files changed, 54 insertions(+), 7 deletions(-) create mode 100644 src/tools/config/wrapper-finder.ts diff --git a/public/locales/en/common.json b/public/locales/en/common.json index 18cc8e650..bebc69de8 100644 --- a/public/locales/en/common.json +++ b/public/locales/en/common.json @@ -13,6 +13,7 @@ "previous": "Previous", "confirm": "Confirm", "enabled": "Enabled", + "duplicate": "Duplicate", "disabled": "Disabled", "enableAll": "Enable all", "disableAll": "Disable all", diff --git a/src/components/Dashboard/Modals/EditAppModal/EditAppModal.tsx b/src/components/Dashboard/Modals/EditAppModal/EditAppModal.tsx index b70f70b1d..7b5010604 100644 --- a/src/components/Dashboard/Modals/EditAppModal/EditAppModal.tsx +++ b/src/components/Dashboard/Modals/EditAppModal/EditAppModal.tsx @@ -93,7 +93,7 @@ export const EditAppModal = ({ values.url = removeTrailingSlash(values.url); - updateConfig( + void updateConfig( configName, (previousConfig) => ({ ...previousConfig, diff --git a/src/components/Dashboard/Modals/SelectElement/Components/Overview/AvailableElementsOverview.tsx b/src/components/Dashboard/Modals/SelectElement/Components/Overview/AvailableElementsOverview.tsx index 3c7ce5262..87a121e07 100644 --- a/src/components/Dashboard/Modals/SelectElement/Components/Overview/AvailableElementsOverview.tsx +++ b/src/components/Dashboard/Modals/SelectElement/Components/Overview/AvailableElementsOverview.tsx @@ -15,6 +15,8 @@ import { AppType } from '~/types/app'; import { CategoryEditModalInnerProps } from '../../../../Wrappers/Category/CategoryEditModal'; import { useStyles } from '../Shared/styles'; +import { getLowestWrapper } from '~/tools/config/wrapper-finder'; +import { ConfigType } from '~/types/config'; interface AvailableElementTypesProps { modalId: string; @@ -30,8 +32,6 @@ export const AvailableElementTypes = ({ const { updateConfig } = useConfigStore(); const { data } = useSession(); - const getLowestWrapper = () => config?.wrappers.sort((a, b) => a.position - b.position)[0]; - const onClickCreateCategory = async () => { openContextModalGeneric({ modal: 'categoryEditModal', @@ -89,8 +89,7 @@ export const AvailableElementTypes = ({ openContextModalGeneric<{ app: AppType; allowAppNamePropagation: boolean }>({ modal: 'editApp', innerProps: { - app: generateDefaultApp(getLowestWrapper()?.id ?? 'default'), - // TODO: Add translation? t('app.defaultName') + app: generateDefaultApp(getLowestWrapper(config as ConfigType)?.id ?? 'default'), allowAppNamePropagation: true, }, size: 'xl', diff --git a/src/components/Dashboard/Tiles/Apps/AppMenu.tsx b/src/components/Dashboard/Tiles/Apps/AppMenu.tsx index a8f9715eb..e823d640e 100644 --- a/src/components/Dashboard/Tiles/Apps/AppMenu.tsx +++ b/src/components/Dashboard/Tiles/Apps/AppMenu.tsx @@ -1,9 +1,11 @@ import { useConfigContext } from '~/config/provider'; import { useConfigStore } from '~/config/store'; import { openContextModalGeneric } from '~/tools/mantineModalManagerExtensions'; +import { generateDefaultApp } from '~/tools/shared/app'; import { AppType } from '~/types/app'; import { GenericTileMenu } from '../GenericTileMenu'; +import { getLowestWrapper } from '~/tools/config/wrapper-finder'; interface TileMenuProps { app: AppType; @@ -13,6 +15,35 @@ export const AppMenu = ({ app }: TileMenuProps) => { const { config, name: configName } = useConfigContext(); const { updateConfig } = useConfigStore(); + const handleDuplicate = () => { + if (!configName || !config) { + return; + } + + const newApp = generateDefaultApp(getLowestWrapper(config)?.id ?? 'default'); + newApp.name = app.name; + newApp.url = app.url; + newApp.behaviour = app.behaviour; + newApp.network = app.network; + newApp.appearance = app.appearance; + newApp.integration = app.integration; + + void updateConfig( + configName, + (previousConfig) => ({ + ...previousConfig, + apps: [ + ...previousConfig.apps, + { + ...newApp, + }, + ], + }), + true, + true + ); + }; + const handleClickEdit = () => { openContextModalGeneric<{ app: AppType; allowAppNamePropagation: boolean }>({ modal: 'editApp', @@ -59,6 +90,7 @@ export const AppMenu = ({ app }: TileMenuProps) => { handleClickEdit={handleClickEdit} handleClickChangePosition={handleClickChangePosition} handleClickDelete={handleClickDelete} + handleDuplicate={handleDuplicate} displayEdit /> ); diff --git a/src/components/Dashboard/Tiles/GenericTileMenu.tsx b/src/components/Dashboard/Tiles/GenericTileMenu.tsx index 32cb94fa4..815e831ed 100644 --- a/src/components/Dashboard/Tiles/GenericTileMenu.tsx +++ b/src/components/Dashboard/Tiles/GenericTileMenu.tsx @@ -1,7 +1,12 @@ import { ActionIcon, Menu } from '@mantine/core'; -import { IconLayoutKanban, IconPencil, IconSettings, IconTrash } from '@tabler/icons-react'; +import { + IconCopy, + IconLayoutKanban, + IconPencil, + IconSettings, + IconTrash, +} from '@tabler/icons-react'; import { useTranslation } from 'next-i18next'; -import { useColorTheme } from '~/tools/color'; import { useEditModeStore } from '../Views/useEditModeStore'; @@ -9,6 +14,7 @@ interface GenericTileMenuProps { handleClickEdit: () => void; handleClickChangePosition: () => void; handleClickDelete: () => void; + handleDuplicate?: () => void; displayEdit: boolean; } @@ -16,6 +22,7 @@ export const GenericTileMenu = ({ handleClickEdit, handleClickChangePosition, handleClickDelete, + handleDuplicate, displayEdit, }: GenericTileMenuProps) => { const { t } = useTranslation('common'); @@ -47,6 +54,11 @@ export const GenericTileMenu = ({ {t('edit')} )} + {handleDuplicate && ( + } onClick={handleDuplicate}> + {t('duplicate')} + + )} } onClick={handleClickChangePosition} diff --git a/src/tools/config/wrapper-finder.ts b/src/tools/config/wrapper-finder.ts new file mode 100644 index 000000000..c67576927 --- /dev/null +++ b/src/tools/config/wrapper-finder.ts @@ -0,0 +1,3 @@ +import { ConfigType } from '~/types/config'; + +export const getLowestWrapper = (config: ConfigType) => config?.wrappers.sort((a, b) => a.position - b.position)[0]; \ No newline at end of file From ff21033b0c45bc0db03ff500f5c8ef3a878bc980 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sun, 28 Jan 2024 21:15:46 +0100 Subject: [PATCH 06/12] fix: rss widget post sorting (#1855) --- public/locales/en/modules/rss.json | 6 +++ src/server/api/routers/rss.ts | 72 +++++++++++++++++------------- src/widgets/rss/RssWidgetTile.tsx | 13 +++++- 3 files changed, 60 insertions(+), 31 deletions(-) diff --git a/public/locales/en/modules/rss.json b/public/locales/en/modules/rss.json index ddf0dc71d..0d02639fb 100644 --- a/public/locales/en/modules/rss.json +++ b/public/locales/en/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Sort by publish date (ascending)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "Put posts without publish date to the top" + }, + "maximumAmountOfPosts": { + "label": "Maximum amount of posts" } }, "card": { diff --git a/src/server/api/routers/rss.ts b/src/server/api/routers/rss.ts index e0d2d30d6..7f91285a1 100644 --- a/src/server/api/routers/rss.ts +++ b/src/server/api/routers/rss.ts @@ -18,7 +18,7 @@ type CustomItem = { 'media:group'?: { 'media:description'?: string; 'media:thumbnail'?: string; - }, + }; pubDate?: string; }; @@ -44,10 +44,10 @@ const rssFeedResultObjectSchema = z title: z.string(), content: z.string(), pubDate: z.date().optional(), - }), + }) ), }), - }), + }) ); export const rssRouter = createTRPCRouter({ @@ -57,7 +57,7 @@ export const rssRouter = createTRPCRouter({ widgetId: z.string().uuid(), feedUrls: z.array(z.string()), configName: z.string(), - }), + }) ) .output(z.array(rssFeedResultObjectSchema)) .query(async ({ input }) => { @@ -80,13 +80,23 @@ export const rssRouter = createTRPCRouter({ return await Promise.all( input.feedUrls.map(async (feedUrl) => - getFeedUrl(feedUrl, rssWidget.properties.dangerousAllowSanitizedItemContent), - ), + getFeedUrl( + feedUrl, + rssWidget.properties.dangerousAllowSanitizedItemContent, + rssWidget.properties.sortPostsWithoutPublishDateToTheTop, + rssWidget.properties.maximumAmountOfPosts + ) + ) ); }), }); -const getFeedUrl = async (feedUrl: string, dangerousAllowSanitizedItemContent: boolean) => { +const getFeedUrl = async ( + feedUrl: string, + dangerousAllowSanitizedItemContent: boolean, + sortPostsWithoutPubDateToTop: boolean, + maximumAmountOfPosts: number +) => { Consola.info(`Requesting RSS feed at url ${feedUrl}`); const stopWatch = new Stopwatch(); const feed = await parser.parseURL(feedUrl); @@ -103,32 +113,34 @@ const getFeedUrl = async (feedUrl: string, dangerousAllowSanitizedItemContent: b 'media:group'?: { 'media:description'?: string; 'media:thumbnail'?: string; - } + }; categories: string[] | { _: string }[]; pubDate?: string; - }) => ({ - ...item, - categories: item.categories - ?.map((category) => (typeof category === 'string' ? category : category._)) - .filter((category: unknown): category is string => typeof category === 'string'), - title: item.title ? decode(item.title) : undefined, - content: processItemContent( - item['content:encoded'] ?? item.content ?? item['media:group']?.['media:description'], - dangerousAllowSanitizedItemContent, - ), - enclosure: createEnclosure(item), - link: createLink(item), - pubDate: item.pubDate ? new Date(item.pubDate) : null, - }), + }) => { + Consola.info('item ' + item.title + ' has pub date ' + item.pubDate); + return { + ...item, + categories: item.categories + ?.map((category) => (typeof category === 'string' ? category : category._)) + .filter((category: unknown): category is string => typeof category === 'string'), + title: item.title ? decode(item.title) : undefined, + content: processItemContent( + item['content:encoded'] ?? item.content ?? item['media:group']?.['media:description'], + dangerousAllowSanitizedItemContent + ), + enclosure: createEnclosure(item), + link: createLink(item), + pubDate: item.pubDate ? new Date(item.pubDate) : null, + }; + } ) - .sort((a: { pubDate: number }, b: { pubDate: number }) => { - if (!a.pubDate || !b.pubDate) { - return 0; + .sort((post1: { pubDate: number }, post2: { pubDate: number }) => { + if (!post1.pubDate || !post2.pubDate) { + return sortPostsWithoutPubDateToTop ? 1 : 0; } - return a.pubDate - b.pubDate; - }) - .slice(0, 20), + return post1.pubDate - post2.pubDate; + }), }; return { @@ -169,7 +181,7 @@ const processItemContent = (content: string, dangerousAllowSanitizedItemContent: } return encode(content, { - level: "html5" + level: 'html5', }); }; @@ -195,7 +207,7 @@ const createEnclosure = (item: any) => { if (item['media:group'] && item['media:group']['media:thumbnail']) { // no clue why this janky parse is needed return { - url: item['media:group']['media:thumbnail'][0].$.url + url: item['media:group']['media:thumbnail'][0].$.url, }; } diff --git a/src/widgets/rss/RssWidgetTile.tsx b/src/widgets/rss/RssWidgetTile.tsx index ab0016482..6b6f22efc 100644 --- a/src/widgets/rss/RssWidgetTile.tsx +++ b/src/widgets/rss/RssWidgetTile.tsx @@ -55,6 +55,17 @@ const definition = defineWidget({ type: 'switch', defaultValue: true, }, + sortPostsWithoutPublishDateToTheTop: { + type: 'switch', + defaultValue: false + }, + maximumAmountOfPosts: { + type: 'slider', + defaultValue: 20, + min: 1, + max: 350, + step: 1 + } }, gridstack: { minWidth: 2, @@ -127,7 +138,7 @@ function RssTile({ widget }: RssTileProps) { - {orderedFeedItems.map((item: any, index: number) => ( + {orderedFeedItems.slice(0, widget.properties.maximumAmountOfPosts).map((item: any, index: number) => ( Date: Sun, 28 Jan 2024 21:19:41 +0100 Subject: [PATCH 07/12] fix: remove console log (#1861) --- src/server/api/routers/rss.ts | 1 - 1 file changed, 1 deletion(-) diff --git a/src/server/api/routers/rss.ts b/src/server/api/routers/rss.ts index 7f91285a1..a90e03d0c 100644 --- a/src/server/api/routers/rss.ts +++ b/src/server/api/routers/rss.ts @@ -117,7 +117,6 @@ const getFeedUrl = async ( categories: string[] | { _: string }[]; pubDate?: string; }) => { - Consola.info('item ' + item.title + ' has pub date ' + item.pubDate); return { ...item, categories: item.categories From 6268db182e5b0c0ca671e9ebea2e90d882a6f220 Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Wed, 31 Jan 2024 07:51:38 +0100 Subject: [PATCH 08/12] fix: #1805 remove server prefetching docker (#1860) --- src/pages/board/[slug].tsx | 25 ++++++------------------- src/pages/board/index.tsx | 29 +++++++---------------------- 2 files changed, 13 insertions(+), 41 deletions(-) diff --git a/src/pages/board/[slug].tsx b/src/pages/board/[slug].tsx index 529e2901e..c6cf462e2 100644 --- a/src/pages/board/[slug].tsx +++ b/src/pages/board/[slug].tsx @@ -11,19 +11,14 @@ import { getServerSideTranslations } from '~/tools/server/getServerSideTranslati import { checkForSessionOrAskForLogin } from '~/tools/server/loginBuilder'; import { boardNamespaces } from '~/tools/server/translation-namespaces'; import { api } from '~/utils/api'; +import { env } from 'process'; +import fs from 'fs'; export default function BoardPage({ config: initialConfig, - isDockerEnabled, - initialContainers, + isDockerEnabled: isDockerEnabled }: InferGetServerSidePropsType) { useInitConfig(initialConfig); - const { data } = api.docker.containers.useQuery(undefined, { - initialData: initialContainers ?? undefined, - enabled: isDockerEnabled, - cacheTime: 60 * 1000 * 5, - staleTime: 60 * 1000 * 1, - }); return ( @@ -69,15 +64,8 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) => if (result) { return result; } - const caller = dockerRouter.createCaller({ - session: session, - cookies: context.req.cookies, - }); - let containers = undefined; - // Fetch containers if user is admin, otherwise we don't need them - try { - if (session?.user.isAdmin == true) containers = await caller.containers(); - } catch (error) {} + + const isDockerEnabled: boolean = !!env.DOCKER_HOST || !!env.DOCKER_PORT || fs.existsSync('/var/run/docker'); return { props: { @@ -85,8 +73,7 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) => primaryColor: config.settings.customization.colors.primary, secondaryColor: config.settings.customization.colors.secondary, primaryShade: config.settings.customization.colors.shade, - isDockerEnabled: containers != undefined, - initialContainers: containers ?? null, + isDockerEnabled: isDockerEnabled, ...translations, }, }; diff --git a/src/pages/board/index.tsx b/src/pages/board/index.tsx index 0fb684398..f403a72bf 100644 --- a/src/pages/board/index.tsx +++ b/src/pages/board/index.tsx @@ -2,7 +2,6 @@ import { GetServerSidePropsContext, InferGetServerSidePropsType } from 'next'; import { Dashboard } from '~/components/Dashboard/Dashboard'; import { BoardLayout } from '~/components/layout/Templates/BoardLayout'; import { useInitConfig } from '~/config/init'; -import { dockerRouter } from '~/server/api/routers/docker/router'; import { getServerAuthSession } from '~/server/auth'; import { getDefaultBoardAsync } from '~/server/db/queries/userSettings'; import { getFrontendConfig } from '~/tools/config/getFrontendConfig'; @@ -10,19 +9,14 @@ import { getServerSideTranslations } from '~/tools/server/getServerSideTranslati import { checkForSessionOrAskForLogin } from '~/tools/server/loginBuilder'; import { boardNamespaces } from '~/tools/server/translation-namespaces'; import { api } from '~/utils/api'; +import { env } from 'process'; +import fs from 'fs'; export default function BoardPage({ config: initialConfig, - isDockerEnabled, - initialContainers, + isDockerEnabled: isDockerEnabled, }: InferGetServerSidePropsType) { useInitConfig(initialConfig); - const { data } = api.docker.containers.useQuery(undefined, { - initialData: initialContainers ?? undefined, - enabled: isDockerEnabled, - cacheTime: 60 * 1000 * 5, - staleTime: 60 * 1000 * 1, - }); return ( @@ -51,25 +45,16 @@ export const getServerSideProps = async (context: GetServerSidePropsContext) => if (result) { return result; } - const caller = dockerRouter.createCaller({ - session: session, - cookies: context.req.cookies, - }); - let containers = undefined; - // Fetch containers if user is admin, otherwise we don't need them - try { - if (session?.user.isAdmin == true) containers = await caller.containers(); - } catch (error) { - - } + + const isDockerEnabled: boolean = !!env.DOCKER_HOST || !!env.DOCKER_PORT || fs.existsSync('/var/run/docker'); + return { props: { config, primaryColor: config.settings.customization.colors.primary, secondaryColor: config.settings.customization.colors.secondary, primaryShade: config.settings.customization.colors.shade, - isDockerEnabled: containers != undefined, - initialContainers: containers ?? null, + isDockerEnabled: isDockerEnabled, ...translations, }, }; From a8f00f52420466e974f6067402cdc36667c2f97e Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Wed, 31 Jan 2024 20:11:18 +0100 Subject: [PATCH 09/12] chore: new Crowdin updates (#1862) --- public/locales/cn/common.json | 1 + public/locales/cn/modules/rss.json | 6 ++++++ public/locales/cr/common.json | 1 + public/locales/cr/modules/rss.json | 6 ++++++ public/locales/cs/common.json | 1 + public/locales/cs/modules/rss.json | 6 ++++++ public/locales/da/common.json | 1 + public/locales/da/modules/rss.json | 6 ++++++ public/locales/de/common.json | 1 + public/locales/de/modules/rss.json | 6 ++++++ public/locales/el/common.json | 1 + public/locales/el/modules/rss.json | 6 ++++++ public/locales/es/common.json | 1 + public/locales/es/modules/rss.json | 6 ++++++ public/locales/fr/common.json | 1 + public/locales/fr/modules/rss.json | 6 ++++++ public/locales/fr/modules/smart-home/entity-state.json | 4 ++-- public/locales/he/common.json | 1 + public/locales/he/modules/rss.json | 6 ++++++ public/locales/hr/common.json | 1 + public/locales/hr/modules/rss.json | 6 ++++++ public/locales/hu/common.json | 1 + public/locales/hu/modules/rss.json | 6 ++++++ public/locales/it/common.json | 1 + public/locales/it/modules/rss.json | 6 ++++++ public/locales/ja/common.json | 1 + public/locales/ja/modules/rss.json | 6 ++++++ public/locales/ko/common.json | 1 + public/locales/ko/modules/rss.json | 6 ++++++ public/locales/lv/common.json | 1 + public/locales/lv/modules/rss.json | 6 ++++++ public/locales/nl/common.json | 1 + public/locales/nl/modules/rss.json | 6 ++++++ public/locales/no/common.json | 1 + public/locales/no/modules/rss.json | 6 ++++++ public/locales/pl/common.json | 1 + public/locales/pl/modules/rss.json | 6 ++++++ public/locales/pt/common.json | 1 + public/locales/pt/modules/rss.json | 6 ++++++ public/locales/ru/common.json | 1 + public/locales/ru/modules/rss.json | 6 ++++++ public/locales/sk/common.json | 1 + public/locales/sk/modules/rss.json | 6 ++++++ public/locales/sl/common.json | 1 + public/locales/sl/modules/rss.json | 6 ++++++ public/locales/sv/common.json | 1 + public/locales/sv/modules/rss.json | 6 ++++++ public/locales/tr/common.json | 1 + public/locales/tr/modules/rss.json | 6 ++++++ public/locales/tw/common.json | 1 + public/locales/tw/modules/rss.json | 6 ++++++ public/locales/uk/common.json | 1 + public/locales/uk/modules/rss.json | 6 ++++++ public/locales/vi/common.json | 1 + public/locales/vi/modules/rss.json | 6 ++++++ 55 files changed, 191 insertions(+), 2 deletions(-) diff --git a/public/locales/cn/common.json b/public/locales/cn/common.json index 13a736080..901d86599 100644 --- a/public/locales/cn/common.json +++ b/public/locales/cn/common.json @@ -13,6 +13,7 @@ "previous": "上一步", "confirm": "确认", "enabled": "已启用", + "duplicate": "复制", "disabled": "已禁用", "enableAll": "全部启用", "disableAll": "全部禁用", diff --git a/public/locales/cn/modules/rss.json b/public/locales/cn/modules/rss.json index fd7f7211a..c5979159b 100644 --- a/public/locales/cn/modules/rss.json +++ b/public/locales/cn/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "按发布日期排序(升序)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "将没有发布日期的文章置顶" + }, + "maximumAmountOfPosts": { + "label": "最大文章数量" } }, "card": { diff --git a/public/locales/cr/common.json b/public/locales/cr/common.json index 32b5e93db..d7212edf0 100644 --- a/public/locales/cr/common.json +++ b/public/locales/cr/common.json @@ -13,6 +13,7 @@ "previous": "crwdns3375:0crwdne3375:0", "confirm": "crwdns3377:0crwdne3377:0", "enabled": "crwdns2883:0crwdne2883:0", + "duplicate": "crwdns4174:0crwdne4174:0", "disabled": "crwdns2885:0crwdne2885:0", "enableAll": "crwdns2887:0crwdne2887:0", "disableAll": "crwdns2889:0crwdne2889:0", diff --git a/public/locales/cr/modules/rss.json b/public/locales/cr/modules/rss.json index 167818f62..0727b5ae5 100644 --- a/public/locales/cr/modules/rss.json +++ b/public/locales/cr/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "crwdns4160:0crwdne4160:0" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "crwdns4176:0crwdne4176:0" + }, + "maximumAmountOfPosts": { + "label": "crwdns4178:0crwdne4178:0" } }, "card": { diff --git a/public/locales/cs/common.json b/public/locales/cs/common.json index d9594966c..250cca079 100644 --- a/public/locales/cs/common.json +++ b/public/locales/cs/common.json @@ -13,6 +13,7 @@ "previous": "Zpět", "confirm": "Potvrdit", "enabled": "Zapnuto", + "duplicate": "Duplikovat", "disabled": "Vypnuto", "enableAll": "Aktivovat vše", "disableAll": "Zakázat vše", diff --git a/public/locales/cs/modules/rss.json b/public/locales/cs/modules/rss.json index 0bc3fb0e1..83dc0921b 100644 --- a/public/locales/cs/modules/rss.json +++ b/public/locales/cs/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Seřadit podle data zveřejnění (vzestupně)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "Umístit příspěvky bez data zveřejnění navrch" + }, + "maximumAmountOfPosts": { + "label": "Maximální počet příspěvků" } }, "card": { diff --git a/public/locales/da/common.json b/public/locales/da/common.json index af6f64a58..a140a078f 100644 --- a/public/locales/da/common.json +++ b/public/locales/da/common.json @@ -13,6 +13,7 @@ "previous": "Forrige", "confirm": "Bekræft", "enabled": "Aktiveret", + "duplicate": "", "disabled": "Deaktiveret", "enableAll": "Aktiver alle", "disableAll": "Deaktiver alle", diff --git a/public/locales/da/modules/rss.json b/public/locales/da/modules/rss.json index 293a0e5ca..bedfa45b8 100644 --- a/public/locales/da/modules/rss.json +++ b/public/locales/da/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "Sæt indlæg uden udgivelsesdato øverst" + }, + "maximumAmountOfPosts": { + "label": "Maksimalt antal indlæg" } }, "card": { diff --git a/public/locales/de/common.json b/public/locales/de/common.json index 1d4f442ab..20f5aa02a 100644 --- a/public/locales/de/common.json +++ b/public/locales/de/common.json @@ -13,6 +13,7 @@ "previous": "Zurück", "confirm": "Bestätigen", "enabled": "Aktiviert", + "duplicate": "Duplizieren", "disabled": "Deaktiviert", "enableAll": "Alle aktivieren", "disableAll": "Alles deaktivieren", diff --git a/public/locales/de/modules/rss.json b/public/locales/de/modules/rss.json index cd46c93ed..9b8dd14b3 100644 --- a/public/locales/de/modules/rss.json +++ b/public/locales/de/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "Platzieren Sie Beiträge ohne Veröffentlichungsdatum ganz oben" + }, + "maximumAmountOfPosts": { + "label": "Maximale Anzahl an Beiträgen" } }, "card": { diff --git a/public/locales/el/common.json b/public/locales/el/common.json index e05f3c470..9fc5dc816 100644 --- a/public/locales/el/common.json +++ b/public/locales/el/common.json @@ -13,6 +13,7 @@ "previous": "Προηγούμενο", "confirm": "Επιβεβαίωση", "enabled": "Ενεργοποιημένο", + "duplicate": "Διπλότυπο", "disabled": "Απενεργοποιημένο", "enableAll": "Ενεργοποίηση όλων", "disableAll": "Απενεργοποίηση όλων", diff --git a/public/locales/el/modules/rss.json b/public/locales/el/modules/rss.json index 757345535..c024fd73b 100644 --- a/public/locales/el/modules/rss.json +++ b/public/locales/el/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Ταξινόμηση κατά ημερομηνία δημοσίευσης (αύξουσα)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "Τοποθετήστε αναρτήσεις χωρίς ημερομηνία δημοσίευσης στην κορυφή" + }, + "maximumAmountOfPosts": { + "label": "Μέγιστος αριθμός αναρτήσεων" } }, "card": { diff --git a/public/locales/es/common.json b/public/locales/es/common.json index 6a2ffe27e..251b317c7 100644 --- a/public/locales/es/common.json +++ b/public/locales/es/common.json @@ -13,6 +13,7 @@ "previous": "Anterior", "confirm": "Confirmar", "enabled": "Activado", + "duplicate": "", "disabled": "Desactivado", "enableAll": "Activar todo", "disableAll": "Desactivar todo", diff --git a/public/locales/es/modules/rss.json b/public/locales/es/modules/rss.json index b4bd75809..b67c4f66b 100644 --- a/public/locales/es/modules/rss.json +++ b/public/locales/es/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/fr/common.json b/public/locales/fr/common.json index 868684af7..522a013aa 100644 --- a/public/locales/fr/common.json +++ b/public/locales/fr/common.json @@ -13,6 +13,7 @@ "previous": "Précédent", "confirm": "Confirmer", "enabled": "Activé", + "duplicate": "Dupliquer", "disabled": "Désactivé", "enableAll": "Activer tout", "disableAll": "Désactiver tout", diff --git a/public/locales/fr/modules/rss.json b/public/locales/fr/modules/rss.json index 713f8858f..cab7e0e1d 100644 --- a/public/locales/fr/modules/rss.json +++ b/public/locales/fr/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Trier par date de publication (croissant)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "Placer les articles sans date de publication en haut de la page" + }, + "maximumAmountOfPosts": { + "label": "Nombre maximal d'articles" } }, "card": { diff --git a/public/locales/fr/modules/smart-home/entity-state.json b/public/locales/fr/modules/smart-home/entity-state.json index 1716e1f80..b01d36088 100644 --- a/public/locales/fr/modules/smart-home/entity-state.json +++ b/public/locales/fr/modules/smart-home/entity-state.json @@ -10,8 +10,8 @@ "info": "ID d’entité unique dans Home Assistant. Copiez en cliquant sur l'entité > Cliquez sur l'icône en forme de rouage > Cliquez sur le bouton Copier sous « ID d'entité ». Certaines entités personnalisées peuvent ne pas être prises en charge." }, "automationId": { - "label": "", - "info": "" + "label": "ID d'automatisation optionnelle", + "info": "Votre identifiant unique d'automatisation. Commence toujours par automation.XXXXX. S'il n'est pas défini, le widget ne sera pas cliquable et n'affichera que l'état de l'entité. Après un clic, l'état de l'entité sera actualisé." }, "displayName": { "label": "Nom d'affichage" diff --git a/public/locales/he/common.json b/public/locales/he/common.json index 81f1f1869..d61704d22 100644 --- a/public/locales/he/common.json +++ b/public/locales/he/common.json @@ -13,6 +13,7 @@ "previous": "הקודם", "confirm": "לאשר", "enabled": "מאופשר", + "duplicate": "שכפול", "disabled": "מושבת", "enableAll": "אפשר הכל", "disableAll": "השבת הכל", diff --git a/public/locales/he/modules/rss.json b/public/locales/he/modules/rss.json index d4803fe35..196b78466 100644 --- a/public/locales/he/modules/rss.json +++ b/public/locales/he/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "מיין לפי תאריך פרסום (עולה)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "שים פוסטים ללא תאריך פרסום למעלה" + }, + "maximumAmountOfPosts": { + "label": "כמות מקסימלית של פוסטים" } }, "card": { diff --git a/public/locales/hr/common.json b/public/locales/hr/common.json index ae1523ab8..d8fa7ee6e 100644 --- a/public/locales/hr/common.json +++ b/public/locales/hr/common.json @@ -13,6 +13,7 @@ "previous": "Prethodno", "confirm": "Potvrdi", "enabled": "Omogućeno", + "duplicate": "", "disabled": "Onemogućeno", "enableAll": "Omogući sve", "disableAll": "Onemogući sve", diff --git a/public/locales/hr/modules/rss.json b/public/locales/hr/modules/rss.json index 845f127bb..48ec55e5b 100644 --- a/public/locales/hr/modules/rss.json +++ b/public/locales/hr/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/hu/common.json b/public/locales/hu/common.json index 10a3d7a9f..56d93b517 100644 --- a/public/locales/hu/common.json +++ b/public/locales/hu/common.json @@ -13,6 +13,7 @@ "previous": "Előző", "confirm": "Megerősít", "enabled": "Engedélyezve", + "duplicate": "Duplikátum", "disabled": "Letiltva", "enableAll": "Összes engedélyezése", "disableAll": "Az összes tiltása", diff --git a/public/locales/hu/modules/rss.json b/public/locales/hu/modules/rss.json index 6a429ee64..7e1fb16a6 100644 --- a/public/locales/hu/modules/rss.json +++ b/public/locales/hu/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Rendezés a közzététel dátuma szerint (növekvő)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/it/common.json b/public/locales/it/common.json index 1073a2306..463c3989b 100644 --- a/public/locales/it/common.json +++ b/public/locales/it/common.json @@ -13,6 +13,7 @@ "previous": "Precedente", "confirm": "Conferma", "enabled": "Abilitato", + "duplicate": "Duplica", "disabled": "Disattivato", "enableAll": "Abilita tutto", "disableAll": "Disattiva tutto", diff --git a/public/locales/it/modules/rss.json b/public/locales/it/modules/rss.json index da0bc74fa..cbf20088d 100644 --- a/public/locales/it/modules/rss.json +++ b/public/locales/it/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Ordina per data di pubblicazione (ascendente)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/ja/common.json b/public/locales/ja/common.json index 0f6284982..eaa97835f 100644 --- a/public/locales/ja/common.json +++ b/public/locales/ja/common.json @@ -13,6 +13,7 @@ "previous": "前へ", "confirm": "確認", "enabled": "有効", + "duplicate": "", "disabled": "無効", "enableAll": "すべてを有効にする", "disableAll": "すべてを無効にする", diff --git a/public/locales/ja/modules/rss.json b/public/locales/ja/modules/rss.json index ec3fe8b3a..383a66878 100644 --- a/public/locales/ja/modules/rss.json +++ b/public/locales/ja/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/ko/common.json b/public/locales/ko/common.json index 3d4508036..42b330b7a 100644 --- a/public/locales/ko/common.json +++ b/public/locales/ko/common.json @@ -13,6 +13,7 @@ "previous": "이전", "confirm": "확인", "enabled": "활성화됨", + "duplicate": "", "disabled": "장애인", "enableAll": "모두 사용", "disableAll": "모두 비활성화", diff --git a/public/locales/ko/modules/rss.json b/public/locales/ko/modules/rss.json index e4de10919..0fd542dfe 100644 --- a/public/locales/ko/modules/rss.json +++ b/public/locales/ko/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/lv/common.json b/public/locales/lv/common.json index 97911405f..527c8dc97 100644 --- a/public/locales/lv/common.json +++ b/public/locales/lv/common.json @@ -13,6 +13,7 @@ "previous": "Iepriekšējais", "confirm": "Apstipriniet", "enabled": "Iespējots", + "duplicate": "", "disabled": "Atspējots", "enableAll": "Iespējot visu", "disableAll": "Atspējot visu", diff --git a/public/locales/lv/modules/rss.json b/public/locales/lv/modules/rss.json index 3ff8860e8..c37d5e132 100644 --- a/public/locales/lv/modules/rss.json +++ b/public/locales/lv/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/nl/common.json b/public/locales/nl/common.json index 200c27260..f6a9faf67 100644 --- a/public/locales/nl/common.json +++ b/public/locales/nl/common.json @@ -13,6 +13,7 @@ "previous": "Vorige", "confirm": "Bevestig", "enabled": "Ingeschakeld", + "duplicate": "", "disabled": "Uitgeschakeld", "enableAll": "Alles inschakelen", "disableAll": "Alles uitschakelen", diff --git a/public/locales/nl/modules/rss.json b/public/locales/nl/modules/rss.json index b6baaf89f..9edc3731a 100644 --- a/public/locales/nl/modules/rss.json +++ b/public/locales/nl/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/no/common.json b/public/locales/no/common.json index bc62d1f6b..6098323ff 100644 --- a/public/locales/no/common.json +++ b/public/locales/no/common.json @@ -13,6 +13,7 @@ "previous": "Tidligere", "confirm": "Bekreft", "enabled": "Aktivert", + "duplicate": "", "disabled": "Deaktivert", "enableAll": "Aktiver alle", "disableAll": "Deaktiver alle", diff --git a/public/locales/no/modules/rss.json b/public/locales/no/modules/rss.json index 291ece831..ced58c10e 100644 --- a/public/locales/no/modules/rss.json +++ b/public/locales/no/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/pl/common.json b/public/locales/pl/common.json index 18e17c952..d3a5c1c20 100644 --- a/public/locales/pl/common.json +++ b/public/locales/pl/common.json @@ -13,6 +13,7 @@ "previous": "Poprzedni", "confirm": "Potwierdź", "enabled": "Włączony", + "duplicate": "Zduplikuj", "disabled": "Wyłączony", "enableAll": "Włącz wszystkie", "disableAll": "Wyłącz wszystkie", diff --git a/public/locales/pl/modules/rss.json b/public/locales/pl/modules/rss.json index 4997ea22d..f783a6edf 100644 --- a/public/locales/pl/modules/rss.json +++ b/public/locales/pl/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/pt/common.json b/public/locales/pt/common.json index da2117089..491a73356 100644 --- a/public/locales/pt/common.json +++ b/public/locales/pt/common.json @@ -13,6 +13,7 @@ "previous": "Anterior", "confirm": "Confirme", "enabled": "Ativado", + "duplicate": "", "disabled": "Desativado", "enableAll": "Habilitar tudo", "disableAll": "Desativar tudo", diff --git a/public/locales/pt/modules/rss.json b/public/locales/pt/modules/rss.json index bf1e6c8e1..63acf1bf0 100644 --- a/public/locales/pt/modules/rss.json +++ b/public/locales/pt/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/ru/common.json b/public/locales/ru/common.json index f8462fdc1..9bf87ecfc 100644 --- a/public/locales/ru/common.json +++ b/public/locales/ru/common.json @@ -13,6 +13,7 @@ "previous": "Предыдущий", "confirm": "Подтвердить", "enabled": "Включено", + "duplicate": "Создать копию", "disabled": "Отключено", "enableAll": "Включить всё", "disableAll": "Отключить всё", diff --git a/public/locales/ru/modules/rss.json b/public/locales/ru/modules/rss.json index fda6ca91a..f79431860 100644 --- a/public/locales/ru/modules/rss.json +++ b/public/locales/ru/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Сортировать по дате публикации (по возрастанию)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "Разместить сообщения без даты публикации вверху списка" + }, + "maximumAmountOfPosts": { + "label": "Максимальное количество постов" } }, "card": { diff --git a/public/locales/sk/common.json b/public/locales/sk/common.json index 751de2984..d3f1d8d99 100644 --- a/public/locales/sk/common.json +++ b/public/locales/sk/common.json @@ -13,6 +13,7 @@ "previous": "Predchádzajúci", "confirm": "Potvrďte", "enabled": "Povolené", + "duplicate": "Duplikovať", "disabled": "Zakázané", "enableAll": "Povoliť všetko", "disableAll": "Zakázať všetko", diff --git a/public/locales/sk/modules/rss.json b/public/locales/sk/modules/rss.json index cf96ea425..9045676f2 100644 --- a/public/locales/sk/modules/rss.json +++ b/public/locales/sk/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Zoradiť podľa dátumu vydania (vzostupne)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/sl/common.json b/public/locales/sl/common.json index 4395152dd..07594565d 100644 --- a/public/locales/sl/common.json +++ b/public/locales/sl/common.json @@ -13,6 +13,7 @@ "previous": "Prejšnji", "confirm": "Potrdi", "enabled": "Omogočeno", + "duplicate": "", "disabled": "Invalidi", "enableAll": "Omogoči vse", "disableAll": "Onemogočite vse", diff --git a/public/locales/sl/modules/rss.json b/public/locales/sl/modules/rss.json index 3df10222c..5aaf71d77 100644 --- a/public/locales/sl/modules/rss.json +++ b/public/locales/sl/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/sv/common.json b/public/locales/sv/common.json index 655ff259e..c607569ab 100644 --- a/public/locales/sv/common.json +++ b/public/locales/sv/common.json @@ -13,6 +13,7 @@ "previous": "Föregående", "confirm": "Bekräfta", "enabled": "Aktiverad", + "duplicate": "Duplicera", "disabled": "Inaktiverad", "enableAll": "Aktivera alla", "disableAll": "Inaktivera alla", diff --git a/public/locales/sv/modules/rss.json b/public/locales/sv/modules/rss.json index fe5969c24..413b2fe50 100644 --- a/public/locales/sv/modules/rss.json +++ b/public/locales/sv/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Sortera efter publiceringsdatum (stigande)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "Lägg inlägg utan publiceringsdatum överst" + }, + "maximumAmountOfPosts": { + "label": "Maximalt antal inlägg" } }, "card": { diff --git a/public/locales/tr/common.json b/public/locales/tr/common.json index f6637c055..eecc45021 100644 --- a/public/locales/tr/common.json +++ b/public/locales/tr/common.json @@ -13,6 +13,7 @@ "previous": "Önceki", "confirm": "Onayla", "enabled": "Etkin", + "duplicate": "Çoğalt", "disabled": "Pasif", "enableAll": "Tümünü etkinleştir", "disableAll": "Tümünü pasifleştir", diff --git a/public/locales/tr/modules/rss.json b/public/locales/tr/modules/rss.json index 85c090930..cc1e64338 100644 --- a/public/locales/tr/modules/rss.json +++ b/public/locales/tr/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Yayınlanma tarihine göre sırala (artan)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/tw/common.json b/public/locales/tw/common.json index 9c5236d49..877d5b492 100644 --- a/public/locales/tw/common.json +++ b/public/locales/tw/common.json @@ -13,6 +13,7 @@ "previous": "上一步", "confirm": "確認", "enabled": "已啟用", + "duplicate": "複製", "disabled": "已禁用", "enableAll": "全部啟用", "disableAll": "全部禁用", diff --git a/public/locales/tw/modules/rss.json b/public/locales/tw/modules/rss.json index 6a419a5c8..b149a1f68 100644 --- a/public/locales/tw/modules/rss.json +++ b/public/locales/tw/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "依發布日期排序 (升序)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/uk/common.json b/public/locales/uk/common.json index e4143d0fc..e8269b2ec 100644 --- a/public/locales/uk/common.json +++ b/public/locales/uk/common.json @@ -13,6 +13,7 @@ "previous": "Попередній", "confirm": "Підтвердити", "enabled": "Увімкнено", + "duplicate": "", "disabled": "Вимкнено", "enableAll": "Увімкнути все", "disableAll": "Вимкнути усе", diff --git a/public/locales/uk/modules/rss.json b/public/locales/uk/modules/rss.json index fddc5ace6..725496411 100644 --- a/public/locales/uk/modules/rss.json +++ b/public/locales/uk/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { diff --git a/public/locales/vi/common.json b/public/locales/vi/common.json index 303ab7bf3..2371d6d0d 100644 --- a/public/locales/vi/common.json +++ b/public/locales/vi/common.json @@ -13,6 +13,7 @@ "previous": "Trước", "confirm": "Xác nhận", "enabled": "Bật", + "duplicate": "Nhân bản", "disabled": "Tắt", "enableAll": "Bật toàn bộ", "disableAll": "Tắt toàn bộ", diff --git a/public/locales/vi/modules/rss.json b/public/locales/vi/modules/rss.json index 99d23d7c6..090686eb0 100644 --- a/public/locales/vi/modules/rss.json +++ b/public/locales/vi/modules/rss.json @@ -20,6 +20,12 @@ }, "sortByPublishDateAscending": { "label": "Sắp xếp theo ngày phát hành (tăng dần)" + }, + "sortPostsWithoutPublishDateToTheTop": { + "label": "" + }, + "maximumAmountOfPosts": { + "label": "" } }, "card": { From a87bda78108acb1a76831e2b5a5b3761e960964c Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Wed, 31 Jan 2024 20:18:39 +0100 Subject: [PATCH 10/12] chore: increase version (#1867) --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 0e3a622db..c0c5d734c 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "homarr", - "version": "0.14.4", + "version": "0.14.5", "description": "Homarr - A homepage for your server.", "license": "MIT", "repository": { From a6ea9ac333a7ecdb4bee1b8459dd7392f849987b Mon Sep 17 00:00:00 2001 From: Thomas Camlong Date: Sat, 3 Feb 2024 16:38:39 +0100 Subject: [PATCH 11/12] chore: new Crowdin updates (#1869) --- public/locales/tr/modules/rss.json | 4 ++-- public/locales/tw/modules/rss.json | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/public/locales/tr/modules/rss.json b/public/locales/tr/modules/rss.json index cc1e64338..e89777d57 100644 --- a/public/locales/tr/modules/rss.json +++ b/public/locales/tr/modules/rss.json @@ -22,10 +22,10 @@ "label": "Yayınlanma tarihine göre sırala (artan)" }, "sortPostsWithoutPublishDateToTheTop": { - "label": "" + "label": "Yayınlanma tarihi olmayan gönderileri en üste çıkar" }, "maximumAmountOfPosts": { - "label": "" + "label": "Maksimum gönderi sayısı" } }, "card": { diff --git a/public/locales/tw/modules/rss.json b/public/locales/tw/modules/rss.json index b149a1f68..3171e016a 100644 --- a/public/locales/tw/modules/rss.json +++ b/public/locales/tw/modules/rss.json @@ -22,10 +22,10 @@ "label": "依發布日期排序 (升序)" }, "sortPostsWithoutPublishDateToTheTop": { - "label": "" + "label": "將尚未發布日期的文章置頂" }, "maximumAmountOfPosts": { - "label": "" + "label": "最大文章數量" } }, "card": { From 824f4b8accd7f647d4fdc65f05b7942ebbdc841e Mon Sep 17 00:00:00 2001 From: Manuel <30572287+manuel-rw@users.noreply.github.com> Date: Sat, 3 Feb 2024 16:38:56 +0100 Subject: [PATCH 12/12] fix: #1859 dayjs locale translation (#1868) --- src/pages/_app.tsx | 4 ++-- src/tools/language.ts | 35 +++++++++++++++++++++++++++++++++-- 2 files changed, 35 insertions(+), 4 deletions(-) diff --git a/src/pages/_app.tsx b/src/pages/_app.tsx index a4dd8a3d4..1795ac8e1 100644 --- a/src/pages/_app.tsx +++ b/src/pages/_app.tsx @@ -58,8 +58,8 @@ function App( const analyticsEnabled = pageProps.analyticsEnabled ?? true; // TODO: make mapping from our locales to moment locales const language = getLanguageByCode(pageProps.session?.user?.language ?? 'en'); - if (language.locale !== 'cr') require(`dayjs/locale/${language.locale}.js`); - dayjs.locale(language.locale); + if (language.dayJsLocale) require(`dayjs/locale/${language.dayJsLocale}.js`); + dayjs.locale(language.dayJsLocale); const [primaryColor, setPrimaryColor] = useState( props.pageProps.primaryColor ?? 'red' diff --git a/src/tools/language.ts b/src/tools/language.ts index 62c3abc86..b219b98f1 100644 --- a/src/tools/language.ts +++ b/src/tools/language.ts @@ -8,6 +8,11 @@ export type Language = { */ country: string; locale: string; + + /** + * + */ + dayJsLocale?: string; }; export const languages = [ @@ -17,13 +22,14 @@ export const languages = [ translatedName: 'English', country: 'GB', locale: 'en-gb', + dayJsLocale: 'en' }, { shortName: 'cr', originalName: 'Crowdin', translatedName: '(Live translation)', locale: 'cr', - country: 'CROWDIN', + country: 'CROWDIN' }, { shortName: 'fr', @@ -31,6 +37,7 @@ export const languages = [ translatedName: 'French', country: 'FR', locale: 'fr', + dayJsLocale: 'fr' }, { shortName: 'cn', @@ -38,6 +45,7 @@ export const languages = [ translatedName: 'Chinese (Simplified)', country: 'CN', locale: 'zh-cn', + dayJsLocale: 'zh' }, { shortName: 'cs', @@ -45,6 +53,7 @@ export const languages = [ translatedName: 'Czech', country: 'CZ', locale: 'cs', + dayJsLocale: 'cs' }, { shortName: 'da', @@ -52,6 +61,7 @@ export const languages = [ translatedName: 'Danish', country: 'DK', locale: 'da', + dayJsLocale: 'da' }, { shortName: 'de', @@ -59,6 +69,7 @@ export const languages = [ translatedName: 'German', country: 'DE', locale: 'de', + dayJsLocale: 'de' }, { shortName: 'el', @@ -66,6 +77,7 @@ export const languages = [ translatedName: 'Greek', country: 'GR', locale: 'el', + dayJsLocale: 'el' }, { shortName: 'es', @@ -73,6 +85,7 @@ export const languages = [ translatedName: 'Spanish', country: 'ES', locale: 'es', + dayJsLocale: 'es' }, { shortName: 'he', @@ -80,6 +93,7 @@ export const languages = [ translatedName: 'Hebrew', country: 'IL', locale: 'he', + dayJsLocale: 'he' }, { shortName: 'hr', @@ -87,6 +101,7 @@ export const languages = [ translatedName: 'Croatian', country: 'HR', locale: 'hr', + dayJsLocale: 'hr' }, { shortName: 'hu', @@ -94,6 +109,7 @@ export const languages = [ translatedName: 'Hungarian', country: 'HU', locale: 'hu', + dayJsLocale: 'hu' }, { shortName: 'it', @@ -101,6 +117,7 @@ export const languages = [ translatedName: 'Italian', country: 'IT', locale: 'it', + dayJsLocale: 'it' }, { shortName: 'ja', @@ -108,6 +125,7 @@ export const languages = [ translatedName: 'Japanese', country: 'JP', locale: 'ja', + dayJsLocale: 'ja' }, { shortName: 'ko', @@ -115,6 +133,7 @@ export const languages = [ translatedName: 'Korean', country: 'KR', locale: 'ko', + dayJsLocale: 'ko' }, { shortName: 'lv', @@ -122,6 +141,7 @@ export const languages = [ translatedName: 'Latvian', country: 'LV', locale: 'lv', + dayJsLocale: 'lv' }, { shortName: 'nl', @@ -129,6 +149,7 @@ export const languages = [ translatedName: 'Dutch', country: 'NL', locale: 'nl', + dayJsLocale: 'nl' }, { shortName: 'no', @@ -136,6 +157,7 @@ export const languages = [ translatedName: 'Norwegian', country: 'NO', locale: 'no', + dayJsLocale: 'nb' }, { shortName: 'pl', @@ -143,6 +165,7 @@ export const languages = [ translatedName: 'Polish', country: 'PL', locale: 'pl', + dayJsLocale: 'pl' }, { shortName: 'pt', @@ -157,6 +180,7 @@ export const languages = [ translatedName: 'Russian', country: 'RU', locale: 'ru', + dayJsLocale: 'ru' }, { shortName: 'sk', @@ -164,6 +188,7 @@ export const languages = [ translatedName: 'Slovak', country: 'SK', locale: 'sk', + dayJsLocale: 'sk' }, { shortName: 'sl', @@ -171,6 +196,7 @@ export const languages = [ translatedName: 'Slovenian', country: 'SI', locale: 'sl', + dayJsLocale: 'sl' }, { shortName: 'sv', @@ -178,6 +204,7 @@ export const languages = [ translatedName: 'Swedish', country: 'SE', locale: 'sv', + dayJsLocale: 'sv' }, { shortName: 'tr', @@ -185,6 +212,7 @@ export const languages = [ translatedName: 'Turkish', country: 'TR', locale: 'tr', + dayJsLocale: 'tr' }, { shortName: 'tw', @@ -192,6 +220,7 @@ export const languages = [ translatedName: 'Chinese (Traditional)', country: 'TW', locale: 'zh-tw', + dayJsLocale: 'zh-cn' }, { shortName: 'uk', @@ -199,6 +228,7 @@ export const languages = [ translatedName: 'Ukrainian', country: 'UA', locale: 'uk', + dayJsLocale: 'uk' }, { shortName: 'vi', @@ -206,9 +236,10 @@ export const languages = [ translatedName: 'Vietnamese', country: 'VN', locale: 'vi', + dayJsLocale: 'vi' }, ] as const satisfies Readonly; -export const getLanguageByCode = (code: string | null) => +export const getLanguageByCode = (code: string | null): Language => languages.find((language) => language.shortName === code) ?? languages.find((x) => x.locale === 'en-gb')!;