From c63d59f0a4ae49a6a11d1e9b0af8ae5ec405d6bf Mon Sep 17 00:00:00 2001 From: "Alexander \"Arav\" Andreev" Date: Fri, 27 Dec 2024 16:31:16 +0400 Subject: [PATCH] Move root path out from CurrentPath() func and localise it. --- pkg/files/curpath.go | 1 - web/index.templ | 2 +- web/locales/en/en.yaml | 1 + web/locales/ru/ru.yaml | 1 + 4 files changed, 3 insertions(+), 2 deletions(-) diff --git a/pkg/files/curpath.go b/pkg/files/curpath.go index c99a02d..b51d9db 100644 --- a/pkg/files/curpath.go +++ b/pkg/files/curpath.go @@ -6,7 +6,6 @@ import ( func CurrentPath(path string) (curPath string) { parts := strings.Split(path, "/")[1:] - curPath = "root" for i, part := range parts { var sb strings.Builder sb.WriteString("/
- @templ.Raw(currentPath) + { i18n.T(ctx, "curpath-root") }@templ.Raw(currentPath)

{ i18n.T(ctx, "stats.files") }: { strconv.FormatInt(stat.Files, 10) } ({ stat.FilesSize }); { i18n.T(ctx, "stats.directories") }: { strconv.FormatInt(stat.Directories, 10) }.

diff --git a/web/locales/en/en.yaml b/web/locales/en/en.yaml index 6d88661..ec97aab 100644 --- a/web/locales/en/en.yaml +++ b/web/locales/en/en.yaml @@ -3,6 +3,7 @@ en: description: My file share keywords: files ftp share self-host back-home: Back home + curpath-root: root stats: files: Files directories: Directories diff --git a/web/locales/ru/ru.yaml b/web/locales/ru/ru.yaml index 69a9f7c..84df43e 100644 --- a/web/locales/ru/ru.yaml +++ b/web/locales/ru/ru.yaml @@ -3,6 +3,7 @@ ru: description: Моя файловая шара keywords: файлы шара ftp селф-хост само-хост self-host back-home: Назад домой + curpath-root: корень stats: files: Файлы directories: Директории