From dbbc672c67aa5ac0a915d22af5cf44c4e7011aae Mon Sep 17 00:00:00 2001
From: Mara-Li <mara-li@outlook.fr>
Date: Sun, 04 Feb 2024 03:55:24 +0000
Subject: [PATCH] feat: Adding support for i18n (closes #462) (#738)
---
quartz/components/pages/FolderContent.tsx | 8 ++++++--
1 files changed, 6 insertions(+), 2 deletions(-)
diff --git a/quartz/components/pages/FolderContent.tsx b/quartz/components/pages/FolderContent.tsx
index 47fb02f..02938e3 100644
--- a/quartz/components/pages/FolderContent.tsx
+++ b/quartz/components/pages/FolderContent.tsx
@@ -7,6 +7,7 @@
import { Root } from "hast"
import { pluralize } from "../../util/lang"
import { htmlToJsx } from "../../util/jsx"
+import { i18n } from "../../i18n/i18next"
interface FolderContentOptions {
/**
@@ -23,7 +24,7 @@
const options: FolderContentOptions = { ...defaultOptions, ...opts }
function FolderContent(props: QuartzComponentProps) {
- const { tree, fileData, allFiles } = props
+ const { tree, fileData, allFiles, cfg } = props
const folderSlug = _stripSlashes(simplifySlug(fileData.slug!))
const allPagesInFolder = allFiles.filter((file) => {
const fileSlug = _stripSlashes(simplifySlug(file.slug!))
@@ -52,7 +53,10 @@
</article>
<div class="page-listing">
{options.showFolderCount && (
- <p>{pluralize(allPagesInFolder.length, "item")} under this folder.</p>
+ <p>
+ {pluralize(allPagesInFolder.length, i18n(cfg.locale, "common.item"))}{" "}
+ {i18n(cfg.locale, "folderContent.underThisFolder")}.
+ </p>
)}
<div>
<PageList {...listProps} />
--
Gitblit v1.10.0