diff --git a/.husky/pre-commit b/.husky/pre-commit
index 255814b..98475b5 100644
--- a/.husky/pre-commit
+++ b/.husky/pre-commit
@@ -1 +1 @@
-npm test
+pnpm test
diff --git a/.husky/pre-push b/.husky/pre-push
index da7be55..0c958d2 100644
--- a/.husky/pre-push
+++ b/.husky/pre-push
@@ -1 +1 @@
-npm run build
+pnpm run build
diff --git a/components/Layout/CardPage.tsx b/components/Layout/CardPage.tsx
index 66ca2c6..f6da494 100644
--- a/components/Layout/CardPage.tsx
+++ b/components/Layout/CardPage.tsx
@@ -4,7 +4,7 @@ import { Col, Pagination, Row } from 'react-bootstrap';
import { SearchPageMeta } from '../../models/System';
export interface CardPageProps extends SearchPageMeta {
- Card: ComponentClass | FC;
+ Card: ComponentClass> | FC>;
cardLinkOf?: (id: string) => string;
pageLinkOf: (page: number) => string;
}
diff --git a/components/Navigator/MainNavigator.tsx b/components/Navigator/MainNavigator.tsx
index 90acec7..6f3bbb7 100644
--- a/components/Navigator/MainNavigator.tsx
+++ b/components/Navigator/MainNavigator.tsx
@@ -25,6 +25,10 @@ const topNavBarMenu = ({ t }: typeof i18n): MenuItem[] => [
href: 'https://github.com/Open-Source-Bazaar/Git-Hackathon-scaffold',
name: t('hackathon'),
},
+ {
+ href: '/open-library',
+ name: t('open_library'),
+ },
];
export interface MainNavigatorProps {
@@ -38,6 +42,14 @@ export const MainNavigator: FC = observer(({ menu }) => {
menu ||= topNavBarMenu(i18n);
+ // 检查是否是 Open Library 路径
+ const isOpenLibraryPath = pathname.startsWith('/open-library');
+
+ // 如果是 Open Library 路径,不渲染主站导航栏
+ if (isOpenLibraryPath) {
+ return null;
+ }
+
return (
diff --git a/components/open-library/BookCard.tsx b/components/open-library/BookCard.tsx
new file mode 100644
index 0000000..8582618
--- /dev/null
+++ b/components/open-library/BookCard.tsx
@@ -0,0 +1,103 @@
+import Link from 'next/link';
+import React, { useContext } from 'react';
+import { Button, Card, Image } from 'react-bootstrap';
+
+import { I18nContext } from '../../models/Translation';
+
+export interface Book {
+ id: number;
+ title: string;
+ author: string;
+ cover?: string;
+ status?: 'available' | 'borrowed';
+ category?: string;
+ description?: string;
+}
+
+interface BookCardProps {
+ book: Book;
+ showStatus?: boolean;
+ variant?: 'featured' | 'catalog';
+}
+
+const BookCard: React.FC = ({
+ book,
+ showStatus = false,
+ variant = 'featured',
+}) => {
+ const cardClass =
+ variant === 'featured'
+ ? 'h-100 shadow-sm border-0'
+ : 'h-100 shadow border-0';
+
+ const { t } = useContext(I18nContext);
+
+ return (
+
+
+ {showStatus && (
+
+
+ {book.status === 'available' ? '可借阅' : '已借出'}
+
+
+ )}
+
+
+
+
+
+
+ {book.title}
+
+
+ {book.author}
+
+ {book.category && (
+
+
+ {book.category}
+
+ )}
+
+
+
+ {t('view_details')}
+
+
+
+
+
+ );
+};
+
+export default BookCard;
diff --git a/components/open-library/FeaturedBooks.tsx b/components/open-library/FeaturedBooks.tsx
new file mode 100644
index 0000000..7d7e586
--- /dev/null
+++ b/components/open-library/FeaturedBooks.tsx
@@ -0,0 +1,70 @@
+import Link from 'next/link';
+import React from 'react';
+import { Button, Col, Row } from 'react-bootstrap';
+
+import BookCard, { Book } from './BookCard';
+import { ContentContainer } from './Layout';
+
+interface FeaturedBooksProps {
+ books: Book[];
+ title?: string;
+ subtitle?: string;
+ showViewAll?: boolean;
+ viewAllLink?: string;
+ viewAllText?: string;
+}
+
+const FeaturedBooks: React.FC = ({
+ books,
+ title = '精选图书',
+ subtitle = '社区成员推荐的优质读物,涵盖技术、设计、创业等多个领域',
+ showViewAll = true,
+ viewAllLink = '/open-library/books',
+ viewAllText = '查看全部图书',
+}) => (
+
+
+
+
+ {title}
+
+
+
+ {subtitle}
+
+
+
+
+ {books.slice(0, 8).map(book => (
+
+
+
+ ))}
+
+
+ {showViewAll && (
+
+
+
+
+ {viewAllText}
+
+
+
+
+ )}
+
+
+);
+
+export default FeaturedBooks;
diff --git a/components/open-library/Footer.tsx b/components/open-library/Footer.tsx
new file mode 100644
index 0000000..53a09b4
--- /dev/null
+++ b/components/open-library/Footer.tsx
@@ -0,0 +1,116 @@
+import React, { PropsWithChildren, useContext } from 'react';
+import { Col, Nav, Row } from 'react-bootstrap';
+
+import { I18nContext } from '../../models/Translation';
+
+// 使用 Bootstrap 工具类替换内联样式的 ContentContainer
+const ContentContainer: React.FC = ({ children }) => (
+ {children}
+);
+
+const FooterComponent = () => {
+ // Use client-side rendering for the copyright text to avoid hydration issues
+ const [isMounted, setIsMounted] = React.useState(false);
+
+ const { t } = useContext(I18nContext);
+
+ React.useEffect(() => {
+ setIsMounted(true);
+ }, []);
+
+ return (
+
+ );
+};
+
+export default FooterComponent;
diff --git a/components/open-library/HeroSection.tsx b/components/open-library/HeroSection.tsx
new file mode 100644
index 0000000..805bbf2
--- /dev/null
+++ b/components/open-library/HeroSection.tsx
@@ -0,0 +1,79 @@
+import React from 'react';
+import { Button, Col, Image, Row } from 'react-bootstrap';
+
+import { ContentContainer } from './Layout';
+
+interface HeroSectionProps {
+ title?: string;
+ subtitle?: string;
+ ctaText?: string;
+ ctaLink?: string;
+ heroImage?: string;
+ heroImageAlt?: string;
+}
+
+const HeroSection: React.FC = ({
+ title = 'freeCodeCamp 成都社区 Open Library',
+ subtitle = '让知识在社区中自由流动,连接每一个热爱学习的心',
+ ctaText = '加入我们',
+ ctaLink = 'https://open-source-bazaar.feishu.cn/share/base/form/shrcngQgMrhjTh6ycO1zcaEWZld',
+ heroImage = '/images/open-library-hero.svg',
+ heroImageAlt = '社区成员分享书籍',
+}) => (
+
+
+
+
+
+
{title}
+
{subtitle}
+
+
+
+ {ctaText}
+
+
+
+ 浏览图书
+
+
+
+
+
+
+
+
+
+
+
+
+);
+
+export default HeroSection;
diff --git a/components/open-library/HowItWorks.tsx b/components/open-library/HowItWorks.tsx
new file mode 100644
index 0000000..33e289c
--- /dev/null
+++ b/components/open-library/HowItWorks.tsx
@@ -0,0 +1,161 @@
+import Link from 'next/link';
+import React from 'react';
+import { Button, Col, Row } from 'react-bootstrap';
+
+import { ContentContainer } from './Layout';
+
+interface Step {
+ id: number;
+ title: string;
+ description: string;
+ icon: string;
+ color: string;
+}
+
+interface HowItWorksProps {
+ title?: string;
+ subtitle?: string;
+ steps?: Step[];
+ showLearnMore?: boolean;
+ learnMoreLink?: string;
+}
+
+const defaultSteps: Step[] = [
+ {
+ id: 1,
+ title: '浏览图书',
+ description: '在图书目录中找到你感兴趣的书籍,查看详细信息和当前状态',
+ icon: 'bi-search',
+ color: '#6f42c1',
+ },
+ {
+ id: 2,
+ title: '申请借阅',
+ description: '填写借阅申请表单,系统会自动联系当前持书人',
+ icon: 'bi-file-earmark-text',
+ color: '#0d6efd',
+ },
+ {
+ id: 3,
+ title: '线下传递',
+ description: '与持书人约定传递方式,通常通过快递或面对面交接',
+ icon: 'bi-arrow-left-right',
+ color: '#fd7e14',
+ },
+ {
+ id: 4,
+ title: '享受阅读',
+ description: '阅读完成后,可以写下书评并准备传递给下一位读者',
+ icon: 'bi-book-half',
+ color: '#198754',
+ },
+];
+
+const HowItWorks: React.FC = ({
+ title = '如何使用 Open Library',
+ subtitle = '简单四步,让知识在社区中自由流动',
+ steps = defaultSteps,
+ showLearnMore = true,
+ learnMoreLink = '/open-library/how-to-borrow',
+}) => (
+
+
+
+
+ {title}
+
+
+
+ {subtitle}
+
+
+
+
+ {steps.map((step, index) => (
+
+
+
+
+
+
+
+ {step.id}
+
+ {/* 连接线仅在大屏幕显示且不是最后一个 */}
+ {index < steps.length - 1 && (
+
+ )}
+
+
{step.title}
+
{step.description}
+
+
+ ))}
+
+
+ {showLearnMore && (
+
+
+
+
+ 了解详细流程
+
+
+
+
+ )}
+
+
+);
+
+export default HowItWorks;
diff --git a/components/open-library/Layout.tsx b/components/open-library/Layout.tsx
new file mode 100644
index 0000000..5476eef
--- /dev/null
+++ b/components/open-library/Layout.tsx
@@ -0,0 +1,47 @@
+import Head from 'next/head';
+import React, { PropsWithChildren } from 'react';
+
+import FooterComponent from './Footer';
+import LibraryNavbar from './Navbar';
+import { useOpenLibraryLayout } from './useOpenLibraryLayout';
+
+const ContentContainer: React.FC = ({ children }) => (
+ {children}
+);
+
+interface LayoutProps {
+ title?: string;
+}
+
+/**
+ * Open Library 的共享布局组件
+ * 包含导航栏、页脚和内容容器
+ * 所有 Open Library 页面都应使用此布局
+ */
+const Layout: React.FC> = ({
+ children,
+ title = 'Open Library - Open Source Bazaar',
+}) => {
+ // Apply Open Library layout styles
+ useOpenLibraryLayout();
+
+ return (
+ <>
+
+ {title}
+
+
+
+
+
+
+ {children}
+
+
+
+ >
+ );
+};
+
+export default Layout;
+export { ContentContainer, Layout };
diff --git a/components/open-library/Navbar.tsx b/components/open-library/Navbar.tsx
new file mode 100644
index 0000000..7b08fe9
--- /dev/null
+++ b/components/open-library/Navbar.tsx
@@ -0,0 +1,50 @@
+import dynamic from 'next/dynamic';
+import React, { useContext } from 'react';
+import { Nav, Navbar } from 'react-bootstrap';
+
+import { I18nContext } from '../../models/Translation';
+
+// 动态导入 LanguageMenu 组件,禁用 SSR
+const LanguageMenu = dynamic(() => import('../Navigator/LanguageMenu'), {
+ ssr: false,
+});
+
+const LibraryNavbar = () => {
+ // Use the new i18n context
+ const { t } = useContext(I18nContext);
+
+ // Use a client-side only rendering approach for the brand text to avoid hydration mismatch
+ const [isMounted, setIsMounted] = React.useState(false);
+
+ React.useEffect(() => {
+ setIsMounted(true);
+ }, []);
+
+ return (
+
+
+
+ {/* Use a static placeholder during SSR and replace it with translated content after hydration */}
+ {isMounted ? t('open_library') : 'Open Library'}
+
+
+
+
+ {/* {t('home')} */}
+ {t('catalog')}
+
+ {t('how_to_borrow')}
+
+
+
+
+
+
+
+ );
+};
+
+export default LibraryNavbar;
diff --git a/components/open-library/useOpenLibraryLayout.ts b/components/open-library/useOpenLibraryLayout.ts
new file mode 100644
index 0000000..cd15c3d
--- /dev/null
+++ b/components/open-library/useOpenLibraryLayout.ts
@@ -0,0 +1,20 @@
+import { useEffect } from 'react';
+
+/**
+ * Hook to apply Open Library layout styles
+ * This adds the open-library class to the body and html elements
+ * which triggers the CSS rules in styles/open-library.css
+ */
+export function useOpenLibraryLayout() {
+ useEffect(() => {
+ // Add open-library class to body and html
+ document.body.classList.add('open-library');
+ document.documentElement.classList.add('open-library');
+
+ // Clean up function to remove classes when component unmounts
+ return () => {
+ document.body.classList.remove('open-library');
+ document.documentElement.classList.remove('open-library');
+ };
+ }, []);
+}
diff --git a/package.json b/package.json
index a947350..9c9aabd 100644
--- a/package.json
+++ b/package.json
@@ -95,5 +95,6 @@
},
"lint-staged": {
"*.{html,md,scss,json,yml,js,mjs,ts,tsx}": "prettier --write"
- }
+ },
+ "packageManager": "pnpm@10.12.4+sha512.5ea8b0deed94ed68691c9bad4c955492705c5eeb8a87ef86bc62c74a26b037b08ff9570f108b2e4dbd1dd1a9186fea925e527f141c648e85af45631074680184"
}
diff --git a/pages/_app.tsx b/pages/_app.tsx
index 3ef27ad..d8a658a 100644
--- a/pages/_app.tsx
+++ b/pages/_app.tsx
@@ -1,4 +1,5 @@
import '../styles/globals.css';
+import '../styles/open-library.css';
import { HTTPError } from 'koajax';
import { configure } from 'mobx';
@@ -48,6 +49,9 @@ export default class CustomApp extends App {
{ t } = this.i18nStore;
const thisFullYear = new Date().getFullYear();
+ // 检查是否是 Open Library 路径
+ const isOpenLibraryPath = router.route.startsWith('/open-library');
+
return (
@@ -58,40 +62,49 @@ export default class CustomApp extends App {
-
- {router.route.startsWith('/article/') ? (
-
+ {/* 根据路径决定是否使用 PageContent 包装和 margin */}
+ {isOpenLibraryPath ? (
+ // Open Library 路径直接渲染内容,不使用 PageContent 和额外的 margin
+
+ ) : (
+
+ {router.route.startsWith('/article/') ? (
+
+
+
+ ) : (
-
- ) : (
-
- )}
-
-
-
+ )}
+
+ {/* 只在非 Open Library 路径显示主站页脚 */}
+ {!isOpenLibraryPath && (
+
+
+ Powered by
+
+
+
+
+
+
+ )}
);
}
diff --git a/pages/open-library/book/[id].tsx b/pages/open-library/book/[id].tsx
new file mode 100644
index 0000000..901fd47
--- /dev/null
+++ b/pages/open-library/book/[id].tsx
@@ -0,0 +1,456 @@
+import Image from 'next/image';
+import { useRouter } from 'next/router';
+import React, { useEffect, useState } from 'react';
+import { Badge, Button, Card, Col, Row, Tab, Tabs } from 'react-bootstrap';
+
+import {
+ ContentContainer,
+ Layout,
+} from '../../../components/open-library/Layout';
+
+// Book type definition
+interface Book {
+ id: number;
+ title: string;
+ author: string;
+ cover?: string;
+ category: string;
+ language: string;
+ status: 'available' | 'borrowed';
+ currentHolder?: string;
+ description?: string;
+ isbn?: string;
+ publisher?: string;
+ publishYear?: number;
+ pageCount?: number;
+ borrowHistory?: {
+ borrower: string;
+ borrowDate: string;
+ returnDate?: string;
+ }[];
+ reviews?: {
+ reviewer: string;
+ rating: number;
+ comment: string;
+ date: string;
+ }[];
+}
+
+// Mock database of books
+const booksDatabase: Book[] = [
+ {
+ id: 1,
+ title: 'Clean Code',
+ author: 'Robert C. Martin',
+ cover: '/images/placeholder-book.svg',
+ category: 'Programming',
+ language: 'English',
+ status: 'available',
+ description:
+ "A handbook of agile software craftsmanship. Even bad code can function. But if code isn't clean, it can bring a development organization to its knees. Every year, countless hours and significant resources are lost because of poorly written code. But it doesn't have to be that way.",
+ isbn: '9780132350884',
+ publisher: 'Prentice Hall',
+ publishYear: 2008,
+ pageCount: 464,
+ borrowHistory: [
+ {
+ borrower: 'Wang Chen',
+ borrowDate: '2023-10-15',
+ returnDate: '2023-11-20',
+ },
+ {
+ borrower: 'Li Mei',
+ borrowDate: '2023-08-01',
+ returnDate: '2023-09-05',
+ },
+ ],
+ reviews: [
+ {
+ reviewer: 'Wang Chen',
+ rating: 5,
+ comment:
+ 'This book completely changed how I approach writing code. Highly recommended for all developers!',
+ date: '2023-11-25',
+ },
+ {
+ reviewer: 'Li Mei',
+ rating: 4,
+ comment:
+ 'Great principles that have stood the test of time. Some examples are a bit dated but the concepts are solid.',
+ date: '2023-09-10',
+ },
+ ],
+ },
+ {
+ id: 2,
+ title: 'Eloquent JavaScript',
+ author: 'Marijn Haverbeke',
+ cover: '/images/placeholder-book.svg',
+ category: 'Programming',
+ language: 'English',
+ status: 'borrowed',
+ currentHolder: 'Zhang Wei',
+ description:
+ 'A modern introduction to programming. JavaScript lies at the heart of almost every modern web application, from social apps like Twitter to browser-based game frameworks like Phaser and Babylon. Though simple for beginners to pick up and play with, JavaScript is a flexible, complex language that you can use to build full-scale applications.',
+ isbn: '9781593279509',
+ publisher: 'No Starch Press',
+ publishYear: 2018,
+ pageCount: 472,
+ borrowHistory: [
+ {
+ borrower: 'Zhang Wei',
+ borrowDate: '2024-03-10',
+ },
+ ],
+ reviews: [
+ {
+ reviewer: 'Liu Jie',
+ rating: 5,
+ comment:
+ 'Perfect for beginners and intermediate JavaScript developers. The exercises are particularly helpful.',
+ date: '2023-12-05',
+ },
+ ],
+ },
+ {
+ id: 3,
+ title: 'Design Patterns',
+ author: 'Erich Gamma et al.',
+ cover: '/images/placeholder-book.svg',
+ category: 'Programming',
+ language: 'English',
+ status: 'available',
+ description:
+ 'Elements of Reusable Object-Oriented Software. Capturing a wealth of experience about the design of object-oriented software, four top-notch designers present a catalog of simple and succinct solutions to commonly occurring design problems.',
+ isbn: '9780201633610',
+ publisher: 'Addison-Wesley Professional',
+ publishYear: 1994,
+ pageCount: 416,
+ borrowHistory: [
+ {
+ borrower: 'Chen Ming',
+ borrowDate: '2023-06-15',
+ returnDate: '2023-07-20',
+ },
+ ],
+ reviews: [
+ {
+ reviewer: 'Chen Ming',
+ rating: 4,
+ comment:
+ 'A classic that has stood the test of time. The examples are in C++ and Smalltalk, but the concepts apply to any OO language.',
+ date: '2023-07-25',
+ },
+ ],
+ },
+ {
+ id: 4,
+ title: "You Don't Know JS",
+ author: 'Kyle Simpson',
+ cover: '/images/placeholder-book.svg',
+ category: 'Programming',
+ language: 'English',
+ status: 'available',
+ description:
+ 'A book series on JavaScript. This is a series of books diving deep into the core mechanisms of the JavaScript language.',
+ isbn: '9781491924464',
+ publisher: "O'Reilly Media",
+ publishYear: 2015,
+ pageCount: 278,
+ borrowHistory: [],
+ reviews: [],
+ },
+ {
+ id: 5,
+ title: '深入理解计算机系统',
+ author: 'Randal E. Bryant',
+ cover: '/images/placeholder-book.svg',
+ category: 'Computer Science',
+ language: 'Chinese',
+ status: 'borrowed',
+ currentHolder: 'Li Mei',
+ description:
+ "Computer Systems: A Programmer's Perspective (Chinese Edition). This book introduces the important and enduring concepts that underlie computer systems.",
+ isbn: '9787111544937',
+ publisher: '机械工业出版社',
+ publishYear: 2016,
+ pageCount: 731,
+ borrowHistory: [
+ {
+ borrower: 'Li Mei',
+ borrowDate: '2024-02-01',
+ },
+ ],
+ reviews: [
+ {
+ reviewer: 'Zhang Wei',
+ rating: 5,
+ comment:
+ '这是一本非常全面的计算机系统书籍,对理解计算机底层工作原理非常有帮助。',
+ date: '2023-10-15',
+ },
+ ],
+ },
+];
+
+export default function BookDetail() {
+ const router = useRouter();
+ const { id } = router.query;
+ const [book, setBook] = useState(null);
+ const [loading, setLoading] = useState(true);
+
+ useEffect(() => {
+ if (id) {
+ // In a real app, this would be an API call
+ const bookId = Array.isArray(id)
+ ? parseInt(id[0])
+ : parseInt(id as string);
+ const foundBook = booksDatabase.find(b => b.id === bookId);
+
+ setBook(foundBook || null);
+ setLoading(false);
+ }
+ }, [id]);
+
+ if (loading) {
+ return (
+
+
+
+
+
+ );
+ }
+
+ if (!book) {
+ return (
+
+
+
+
Book Not Found
+
Sorry, we couldn't find the book you're looking for.
+
router.push('/open-library/books')}
+ >
+ Return to Catalog
+
+
+
+
+ );
+ }
+
+ return (
+
+
+
+
router.back()}
+ >
+ ← Back
+
+
+
+
+
+
+
+
+
+ {book.status === 'available'
+ ? 'Available'
+ : 'Currently Borrowed'}
+
+
+ {book.status === 'borrowed' && book.currentHolder && (
+
+ Current holder: {book.currentHolder}
+
+ )}
+
+
+ {book.title}
+ by {book.author}
+
+
+
+ {book.category}
+
+
+ {book.language}
+
+
+
+ {book.description}
+
+
+
+ ISBN
+ {book.isbn || 'N/A'}
+
+
+ Publisher
+ {book.publisher || 'N/A'}
+
+
+ Published
+ {book.publishYear || 'N/A'}
+
+
+ Pages
+ {book.pageCount || 'N/A'}
+
+
+
+
+ {book.status === 'available' ? (
+
+ Request to Borrow
+
+ ) : (
+
+ Currently Unavailable
+
+ )}
+
+
+
+
+
+
+
+
+
+ {book.reviews && book.reviews.length > 0 ? (
+
+ {book.reviews.map((review, index) => (
+
+
+
+
{review.reviewer}
+
+ {[...Array(5)].map((_, i) => (
+
+ {i < review.rating ? '\u2605' : '\u2606'}
+
+ ))}
+
+
+ {review.comment}
+
+
+ {new Date(review.date).toLocaleDateString()}
+
+
+
+
+ ))}
+
+
+ Add Your Review
+
+
+
+ ) : (
+
+
+ No reviews yet. Be the first to review this book!
+
+
+ Write a Review
+
+
+ )}
+
+
+ {book.borrowHistory && book.borrowHistory.length > 0 ? (
+
+
+
+
+ Borrower
+ Borrow Date
+ Return Date
+ Status
+
+
+
+ {book.borrowHistory.map((history, index) => (
+
+ {history.borrower}
+
+ {new Date(
+ history.borrowDate,
+ ).toLocaleDateString()}
+
+
+ {history.returnDate
+ ? new Date(
+ history.returnDate,
+ ).toLocaleDateString()
+ : '-'}
+
+
+ {history.returnDate ? (
+ Returned
+ ) : (
+
+ Active
+
+ )}
+
+
+ ))}
+
+
+
+ ) : (
+
+
This book has not been borrowed yet.
+
+ )}
+
+
+
+
+
+
+ );
+}
diff --git a/pages/open-library/books/index.tsx b/pages/open-library/books/index.tsx
new file mode 100644
index 0000000..7e38a5c
--- /dev/null
+++ b/pages/open-library/books/index.tsx
@@ -0,0 +1,184 @@
+import React from 'react';
+import { Card, Col, Row } from 'react-bootstrap';
+
+import {
+ ContentContainer,
+ Layout,
+} from '../../../components/open-library/Layout';
+
+// Book type definition
+interface Book {
+ id: number;
+ title: string;
+ author: string;
+ cover?: string;
+ category: string;
+ language: string;
+ status: 'available' | 'borrowed';
+ currentHolder?: string;
+ description?: string;
+}
+
+export default function BookCatalog() {
+ // Sample books data - in a real app, this would come from an API
+ const books: Book[] = [
+ {
+ id: 1,
+ title: 'Clean Code',
+ author: 'Robert C. Martin',
+ cover: '/images/placeholder-book.svg',
+ category: 'Programming',
+ language: 'English',
+ status: 'available',
+ description: 'A handbook of agile software craftsmanship',
+ },
+ {
+ id: 2,
+ title: 'Eloquent JavaScript',
+ author: 'Marijn Haverbeke',
+ cover: '/images/placeholder-book.svg',
+ category: 'Programming',
+ language: 'English',
+ status: 'borrowed',
+ currentHolder: 'John Doe',
+ description: 'A modern introduction to programming',
+ },
+ {
+ id: 3,
+ title: 'The Pragmatic Programmer',
+ author: 'Andrew Hunt & David Thomas',
+ cover: '/images/placeholder-book.svg',
+ category: 'Programming',
+ language: 'English',
+ status: 'available',
+ description: 'Your journey to mastery',
+ },
+ {
+ id: 4,
+ title: "You Don't Know JS",
+ author: 'Kyle Simpson',
+ cover: '/images/placeholder-book.svg',
+ category: 'Programming',
+ language: 'English',
+ status: 'borrowed',
+ currentHolder: 'Jane Smith',
+ description: 'A book series on JavaScript',
+ },
+ {
+ id: 5,
+ title: '深入理解计算机系统',
+ author: "Randal E. Bryant & David R. O'Hallaron",
+ cover: '/images/placeholder-book.svg',
+ category: 'Computer Science',
+ language: 'Chinese',
+ status: 'borrowed',
+ currentHolder: 'Li Mei',
+ description:
+ "Computer Systems: A Programmer's Perspective (Chinese Edition)",
+ },
+ {
+ id: 6,
+ title: '算法导论',
+ author: 'Thomas H. Cormen et al.',
+ cover: '/images/placeholder-book.svg',
+ category: 'Computer Science',
+ language: 'Chinese',
+ status: 'available',
+ description: 'Introduction to Algorithms (Chinese Edition)',
+ },
+ {
+ id: 7,
+ title: 'JavaScript高级程序设计',
+ author: 'Nicholas C. Zakas',
+ cover: '/images/placeholder-book.svg',
+ category: 'Programming',
+ language: 'Chinese',
+ status: 'available',
+ description:
+ 'Professional JavaScript for Web Developers (Chinese Edition)',
+ },
+ {
+ id: 8,
+ title: 'CSS揭秘',
+ author: 'Lea Verou',
+ cover: '/images/placeholder-book.svg',
+ category: 'Web Development',
+ language: 'Chinese',
+ status: 'borrowed',
+ currentHolder: 'Wang Chen',
+ description: 'CSS Secrets (Chinese Edition)',
+ },
+ ];
+
+ return (
+
+
+
+
+
图书目录
+
+ 浏览我们的社区共享图书馆,发现有趣的书籍
+
+
+
+
+ {books.map(book => (
+
+
+
+
+
+
+ {book.status === 'available' ? '可借阅' : '已借出'}
+
+
+
+
+
+ {book.title}
+
+
+ {book.author}
+
+
+ {book.category} • {book.language}
+
+ {book.description && (
+
+ {book.description}
+
+ )}
+ {book.status === 'borrowed' && book.currentHolder && (
+
+ 当前持书人: {book.currentHolder}
+
+ )}
+
+
+ 查看详情
+
+
+
+
+
+ ))}
+
+
+
+
+ );
+}
diff --git a/pages/open-library/how-to-borrow.tsx b/pages/open-library/how-to-borrow.tsx
new file mode 100644
index 0000000..6116a36
--- /dev/null
+++ b/pages/open-library/how-to-borrow.tsx
@@ -0,0 +1,298 @@
+import Link from 'next/link';
+import React from 'react';
+import { Card, Col, Row } from 'react-bootstrap';
+
+import { ContentContainer, Layout } from '../../components/open-library/Layout';
+
+export default function HowToBorrowPage() {
+ return (
+
+
+
+
如何借阅
+
+
+
+ 借阅与传递模式
+
+ 在 Open Library,所有书籍均来自社区成员的捐赠,并由借阅者直接
+ 传递 给下一位借书人。
+
+
+ 我们采用的是一种独特的"无储存"借阅模式,让书籍在会员之间自由流转,而非集中存放。这种模式不仅节省了物理空间,更重要的是促进了社区成员之间的直接交流和互动。
+
+
+
+
+
+
+
+
+ 借阅流程
+
+
+
+
+
+
1
+
+
+
查阅书籍
+
+ 社区成员可以在{' '}
+
+ fCC 成都社区图书馆
+ {' '}
+ 中查找自己感兴趣的书籍,或者在我们的{' '}
+
+ 书籍目录
+ {' '}
+ 中浏览。
+
+
+
+
+
+
+
+
+
+
+
4
+
+
+
阅读与分享
+
+ 借阅者在阅读完毕后,可以分享自己的阅读感悟,并在社区推荐给下一位感兴趣的成员。我们鼓励借阅者在归还前写下简短的书评。
+
+
+
+
+
+
+
5
+
+
+
继续传递
+
+ 当有新的借阅者申请时,当前持书人将书籍传递给下一位读者,确保知识的持续流动。
+
+
+
+
+
+
+
+
+
+
+ 借阅规则
+
+
+ 借阅期限: 每本书的标准借阅期为 30
+ 天,如需延长可与图书馆管理员联系。
+
+
+ 借阅数量: 每位会员同时最多可借阅 3
+ 本书。
+
+
+ 书籍状态: {' '}
+ 借阅者有责任保持书籍的良好状态,避免损坏、标记或丢失。
+
+
+ 传递责任: {' '}
+ 当前持书人负责将书籍安全传递给下一位借阅者,并承担相关的传递费用。
+
+
+ 丢失或损坏: {' '}
+ 如果书籍在您借阅期间丢失或严重损坏,请联系图书馆管理员并考虑捐赠一本相同或类似的书籍作为替代。
+
+
+
+
+
+
+
+ 快速链接
+
+
+
+
+
+
+
+
+ 常见问题解答
+
+
+ 如何知道一本书是否可借?
+
+ 您可以在飞书多维表格或我们的网站书籍目录中查看书籍的当前状态。如果标记为"可借阅",则表示该书可以申请借阅。
+
+
+
+ 我需要支付借阅费用吗?
+
+ Open Library
+ 不收取借阅费用,但借阅者需要承担书籍传递的相关费用(如快递费)。
+
+
+
+ 如果当前没有人申请借我手中的书,我需要归还吗?
+
+ 标准借阅期为 30
+ 天。如果期满后没有新的借阅申请,您可以继续保留该书,但请随时准备传递给下一位申请者。
+
+
+
+ 如何联系当前持书人?
+
+ 当您提交借阅申请后,我们会为您提供当前持书人的联系方式,以便您们协商传递事宜。
+
+
+
+ 如果我想长期保留一本书怎么办?
+
+ Open Library
+ 的宗旨是促进知识流动,我们鼓励书籍在会员之间传递。如果您特别喜欢某本书,建议购买一本自己的副本,或者考虑捐赠一本相同的书籍给图书馆。
+
+
+
+ 我可以借阅电子书吗?
+
+ 目前 Open Library
+ 主要提供实体书的借阅服务。我们正在考虑未来增加电子书资源,敬请期待。
+
+
+
+
+
+
+
+
+
+
+ );
+}
diff --git a/pages/open-library/index.tsx b/pages/open-library/index.tsx
new file mode 100644
index 0000000..7e19a39
--- /dev/null
+++ b/pages/open-library/index.tsx
@@ -0,0 +1,234 @@
+import Head from 'next/head';
+import Link from 'next/link';
+import React, { useContext } from 'react';
+import { Card, Col, Row } from 'react-bootstrap';
+
+import FeaturedBooks from '../../components/open-library/FeaturedBooks';
+import FooterComponent from '../../components/open-library/Footer';
+import HeroSection from '../../components/open-library/HeroSection';
+import HowItWorks from '../../components/open-library/HowItWorks';
+import { ContentContainer } from '../../components/open-library/Layout';
+import LibraryNavbar from '../../components/open-library/Navbar';
+import { useOpenLibraryLayout } from '../../components/open-library/useOpenLibraryLayout';
+import { I18nContext } from '../../models/Translation';
+
+// Sample data - these could be moved to a separate data file in the future
+const featuredBooks = [
+ {
+ id: 1,
+ title: 'Clean Code',
+ author: 'Robert C. Martin',
+ cover: '/images/placeholder-book.svg',
+ description: '编写优雅代码的艺术',
+ status: 'available' as const,
+ rating: 4.8,
+ tags: ['编程', '软件工程'],
+ },
+ {
+ id: 2,
+ title: 'Eloquent JavaScript',
+ author: 'Marijn Haverbeke',
+ cover: '/images/placeholder-book.svg',
+ description: 'JavaScript 程序设计精粹',
+ status: 'borrowed' as const,
+ rating: 4.6,
+ tags: ['JavaScript', '前端'],
+ },
+ {
+ id: 3,
+ title: 'Design Patterns',
+ author: 'Erich Gamma et al.',
+ cover: '/images/placeholder-book.svg',
+ description: '可复用面向对象软件的基础',
+ status: 'available' as const,
+ rating: 4.7,
+ tags: ['设计模式', '软件架构'],
+ },
+ {
+ id: 4,
+ title: "You Don't Know JS",
+ author: 'Kyle Simpson',
+ cover: '/images/placeholder-book.svg',
+ description: 'JavaScript 深度解析系列',
+ status: 'available' as const,
+ rating: 4.5,
+ tags: ['JavaScript', '进阶'],
+ },
+];
+
+const workflowSteps = [
+ {
+ id: 1,
+ icon: 'bi-search',
+ title: '浏览图书',
+ description: '在图书目录中寻找你感兴趣的书籍',
+ color: '#6f42c1',
+ },
+ {
+ id: 2,
+ icon: 'bi-file-earmark-text',
+ title: '申请借阅',
+ description: '填写借阅申请表单,说明你的借阅意向',
+ color: '#0d6efd',
+ },
+ {
+ id: 3,
+ icon: 'bi-people',
+ title: '联系持书人',
+ description: '我们会协助你联系当前的持书人安排交接',
+ color: '#fd7e14',
+ },
+ {
+ id: 4,
+ icon: 'bi-book-half',
+ title: '传递分享',
+ description: '阅读完成后,将书籍传递给下一位读者',
+ color: '#198754',
+ },
+];
+
+export default function OpenLibraryHomepage() {
+ // Apply Open Library layout styles
+ useOpenLibraryLayout();
+
+ // Use the new i18n context
+ const { t } = useContext(I18nContext);
+
+ return (
+ <>
+
+ {`${t('open_library')} - freeCodeCamp 成都社区`}
+
+
+
+
+
+
+
+
+ {/* About Section */}
+
+
+
+
+ 📚 关于我们
+
+
+ freeCodeCamp 成都社区「Open Library」开放共享图书馆
+
+
+
+
+
+
+
+ 🌟 我们的使命
+
+ 促进知识交流,推动社区成员之间的学习和成长,增强社区成员之间的互动与信任。
+ 我们采用独特的"无储存"借阅模式,让书籍在会员之间自由流转。
+
+
+
+
+
+
+
+ 💡 核心理念
+
+
+ ✦ 知识流动 - 书籍自由流转,促进知识传播
+
+
+ ✦ 社区驱动 - 所有书籍来自成员捐赠
+
+
+ ✦ 开放共享 - 促进交流和互动
+
+
+
+
+
+
+
+
+
+ {/* Featured Books Section */}
+
+
+
+
+ 📖 精选图书
+
+
发现社区成员推荐的优质图书
+
+
+
+
+
+
+
+
+
+ {/* Simple Donation Section */}
+
+
+
+
💖 支持我们
+
+ Open Library
+ 完全由社区成员的热情和贡献支撑。如果这个项目对你有帮助,
+
+ 欢迎通过以下方式支持我们的发展。
+
+
+
+
+
+
+
+
+ >
+ );
+}
diff --git a/pages/open-library/readme.md b/pages/open-library/readme.md
new file mode 100644
index 0000000..b9d7c47
--- /dev/null
+++ b/pages/open-library/readme.md
@@ -0,0 +1,35 @@
+# 社区图书馆
+
+## 简介
+
+freeCodeCamp 成都社区「Open Library」是一个开放、共享的社区图书馆,旨在促进知识交流,推动社区成员之间的学习和成长,增强社区成员之间的互动与信任。我们深知知识的流动能够点燃创新的火花,因此,我们采用了一种独特的“无储存”借阅模式,让书籍在会员之间自由流转,而非集中存放。
+
+## 申请会员
+
+如果你热爱阅读,愿意分享知识,欢迎填写 fCC 成都社区图书馆-会员申请 ,加入 freeCodeCamp 成都社区「Open Library」,成为知识流动的一部分!
+
+## 书籍募捐
+
+我们鼓励社区成员捐赠书籍,共同丰富书目资源。捐赠流程如下:
+
+1. **填写捐赠申请**:填写 fCC 成都社区图书馆-书籍捐赠 。
+
+2. **书籍登记**:如所捐赠书籍在「 fCC 成都社区图书馆」还未登记,请先填写 fCC 成都社区图书馆-书籍登记 ,然后回到第 1 步继续捐赠。建议在移动端设备上登记,方便扫描书籍 ISBN 码。
+
+3. **书籍进入图书馆**:完成以上流程后,书籍正式进入 Open Library 的传递流程,开始流转于社区成员之间。
+
+## 借阅与传递
+
+在 Open Library,所有书籍均来自社区成员的捐赠,并由借阅者直接**传递**给下一位借书人。
+
+借阅流程如下:
+
+1. **查阅书籍**:社区成员可以在 fCC 成都社区图书馆 中查找自己感兴趣的书籍。
+2. **申请借阅**:填写 fCC 成都社区图书馆-书籍借入 申请,与当前持书者取得联系。
+3. **线下传递**:双方约定时间和传递方式,通常可用快递传递书籍。请传递者填写 fCC 成都社区图书馆-书籍传递 ,再将书籍传递出去。
+4. **阅读与分享**:借阅者在阅读完毕后,可以分享自己的阅读感悟,并在社区推荐给下一位感兴趣的成员。
+5. **继续传递**:当有新的借阅者申请时,当前持书人将书籍传递给下一位读者,确保知识的持续流动。
+
+## 未来
+
+期待未来可以与更多开放空间合作,定期举办主题阅读会。
diff --git a/styles/open-library.css b/styles/open-library.css
new file mode 100644
index 0000000..540c4bd
--- /dev/null
+++ b/styles/open-library.css
@@ -0,0 +1,65 @@
+/* Open Library Global Styles */
+
+/* Reset styles for Open Library section */
+body.open-library,
+html.open-library {
+ margin: 0 !important;
+ padding: 0 !important;
+ overflow-x: hidden !important;
+}
+
+/* Hide main site header and footer */
+body.open-library nav.navbar.bg-dark.navbar-dark.fixed-top,
+body.open-library footer.mw-100.bg-dark.text-white {
+ display: none !important;
+}
+
+/* Remove top margin that accommodates the main header */
+body.open-library div.mt-5.pt-2 {
+ margin-top: 0 !important;
+ padding-top: 0 !important;
+ max-width: 100% !important;
+ width: 100% !important;
+}
+
+/* Adjust main wrapper */
+body.open-library main.flex-fill.d-flex.flex-column.justify-content-start.align-items-center {
+ background: none !important;
+ padding: 0 !important;
+ margin: 0 !important;
+ max-width: 100% !important;
+ width: 100% !important;
+}
+
+/* Adjust container styles */
+body.open-library .container,
+body.open-library .container-fluid {
+ max-width: 100% !important;
+ padding-left: 0 !important;
+ padding-right: 0 !important;
+ margin-left: 0 !important;
+ margin-right: 0 !important;
+}
+
+/* Remove card styling from main content */
+body.open-library main.flex-fill.d-flex.flex-column.justify-content-start.align-items-center .card {
+ background: transparent !important;
+ border: none !important;
+ box-shadow: none !important;
+ padding: 0 !important;
+ margin: 0 !important;
+}
+
+/* Remove card body padding */
+body.open-library main.flex-fill.d-flex.flex-column.justify-content-start.align-items-center .card-body {
+ padding: 0 !important;
+}
+
+/* Target the MDXProvider wrapper (main white background) */
+body.open-library .MDXProvider {
+ padding: 0 !important;
+ margin: 0 !important;
+ background: transparent !important;
+ border: none !important;
+ box-shadow: none !important;
+}
diff --git a/translation/en-US.ts b/translation/en-US.ts
index 6d663f9..d19ab93 100644
--- a/translation/en-US.ts
+++ b/translation/en-US.ts
@@ -13,8 +13,158 @@ export default {
// Search
keywords: 'Keywords',
search_results: 'Search Results',
-
// Scroll List
load_more: 'Load more...',
no_more: 'No more',
+
+
+ // Open Library
+ open_library: 'Open Library',
+
+ // Open Library Navigation
+ home: 'Home',
+ catalog: 'Catalog',
+ donate: 'Donate',
+ how_to_borrow: 'How to Borrow',
+ review: 'Review',
+
+ // Open Library Home Page
+ featured_books: 'Featured Books',
+ view_all_books: 'Browse All Books',
+ browse_catalog: 'Browse Catalog',
+ testimonials: 'Testimonials',
+ join_community: 'Join Our Community',
+ become_member: 'Become a Member',
+ donate_books: 'Donate Books',
+ how_it_works: 'How It Works',
+ how_it_works_description:
+ 'Three simple steps to borrow books from our community',
+ step_1_find_book: '1. Find a Book',
+ step_1_description:
+ 'Browse our collection and find the book that interests you. Filter by category, author, or popularity.',
+ step_2_apply: '2. Apply to Borrow',
+ step_2_description:
+ "Submit a simple request form. We'll connect you with the book owner and arrange the handover.",
+ step_3_receive: '3. Receive and Pass It On',
+ step_3_description:
+ "Enjoy your book and return it when you're done. Consider donating your own books to keep knowledge flowing.",
+ learn_more_about_borrowing: 'Learn More About Borrowing',
+ community_voices: 'Community Voices',
+ community_voices_description: 'What our members say about Open Library',
+ read_more_reviews: 'Read More Reviews',
+ share_your_knowledge: 'Share Your Knowledge',
+ donate_a_book: 'Donate a Book',
+ stay_updated: 'Stay Updated',
+ newsletter_description:
+ 'Subscribe to our newsletter for new book arrivals and community events.',
+ email_placeholder: 'Your email address',
+ subscribe: 'Subscribe',
+
+ // Open Library Books Page
+ book_catalog: 'Book Catalog',
+ search_books: 'Search Books',
+ all_categories: 'All Categories',
+ all_languages: 'All Languages',
+ all_status: 'All Status',
+ available: 'Available',
+ borrowed: 'Borrowed',
+ reset_filters: 'Reset Filters',
+ showing_books: 'Showing {0} of {1} books',
+ no_books_found: 'No books found',
+ try_adjusting_filters: 'Try adjusting your search or filters',
+ reset_all_filters: 'Reset All Filters',
+ view_details: 'View Details',
+ currently_with: 'Currently with: {0}',
+
+ // Open Library Book Detail Page
+ loading: 'Loading...',
+ book_not_found: 'Book Not Found',
+ return_to_catalog: 'Return to Catalog',
+ back: 'Back',
+ by_author: 'by {0}',
+ currently_borrowed: 'Currently Borrowed',
+ currently_unavailable: 'Currently Unavailable',
+ request_to_borrow: 'Request to Borrow',
+ reviews: 'Reviews',
+ borrow_history: 'Borrow History',
+ no_reviews_yet: 'No reviews yet',
+ be_first_to_review: 'Be the first to review this book!',
+ write_review: 'Write a Review',
+ add_your_review: 'Add Your Review',
+ borrower: 'Borrower',
+ borrow_date: 'Borrow Date',
+ return_date: 'Return Date',
+ status: 'Status',
+ returned: 'Returned',
+ active: 'Active',
+ not_borrowed_yet: 'This book has not been borrowed yet',
+
+ // Open Library About Page
+ about_open_library: 'About Open Library',
+ our_mission: 'Our Mission',
+ our_values: 'Our Values',
+ our_features: 'Our Features',
+ our_team: 'Our Team',
+ join_us_open_library: 'Join Us',
+
+ // Open Library Donate Page
+ book_donation: 'Book Donation',
+ why_donate: 'Why Donate Books?',
+ donation_process: 'Donation Process',
+ book_registration: 'Book Registration',
+ what_books_we_accept: 'What Books Do We Accept?',
+ we_welcome: 'We Welcome',
+ not_suitable: 'Not Suitable for Donation',
+ faq: 'Frequently Asked Questions',
+ ready_to_donate: 'Ready to Donate Books?',
+ fill_donation_form: 'Fill Donation Form',
+ apply_for_membership: 'Apply for Membership',
+
+ // Open Library How to Borrow Page
+ how_to_borrow_page: 'How to Borrow',
+ borrowing_and_passing: 'Borrowing and Passing Model',
+ borrowing_process: 'Borrowing Process',
+ borrowing_rules: 'Borrowing Rules',
+ quick_links: 'Quick Links',
+ view_full_catalog: 'View Full Catalog',
+ fill_borrow_request: 'Fill Borrow Request',
+ fill_book_passing_form: 'Fill Book Passing Form',
+ browse_book_catalog: 'Browse Book Catalog',
+
+ // Open Library Review Page
+ book_reviews: 'Book Reviews',
+ community_reviews: 'Community Reviews',
+ all_reviews: 'All Reviews',
+ recent_reviews: 'Recent Reviews',
+ top_reviews: 'Top Reviews',
+ write_your_review: 'Write Your Review',
+ review_guidelines: 'Review Guidelines',
+ how_to_write_helpful_review: 'How to Write a Helpful Review',
+ rating_reference: 'Rating Reference',
+
+ // Homepage Hero Section
+ hero_title: 'Free knowledge flows here',
+ hero_subtitle:
+ "Share and borrow books in our open-source community. Join freeCodeCamp Chengdu's initiative to make learning accessible to everyone.",
+
+ // Featured Books Section
+ featured_books_subtitle: 'Discover what our community is reading right now',
+
+ // Donation Callout Section
+ donation_callout_subtitle:
+ 'Have books collecting dust on your shelf? Donate them to our community and help others learn and grow. Your contribution makes a difference!',
+
+ // Footer
+ footer_description:
+ 'A community-driven library for sharing knowledge and stories. Built with open source. Powered by generosity.',
+ quick_links_footer: 'Quick Links',
+ home_footer: 'Home',
+ catalog_footer: 'Catalog',
+ about_us_footer: 'About Us',
+ donate_footer: 'Donate',
+ contact: 'Contact',
+ contact_email: 'Email: info@openlibrary.community',
+ contact_address: 'Address: 123 Library Lane, Knowledge City, World',
+ follow_us: 'Follow Us',
+ all_rights_reserved: 'All Rights Reserved',
};
diff --git a/translation/zh-CN.ts b/translation/zh-CN.ts
index 13d7027..921b7c1 100644
--- a/translation/zh-CN.ts
+++ b/translation/zh-CN.ts
@@ -17,4 +17,151 @@ export default {
// Scroll List
load_more: '加载更多……',
no_more: '没有更多',
+
+ // Open Library
+ open_library: '开源图书馆',
+
+ // Open Library Navigation
+ home: '首页',
+ catalog: '书籍目录',
+ donate: '书籍募捐',
+ how_to_borrow: '如何借阅',
+ review: '书籍评价',
+
+ // Open Library Home Page
+ featured_books: '精选书籍',
+ view_all_books: '浏览全部书籍',
+ browse_catalog: '浏览书目',
+ testimonials: '读者反馈',
+ join_community: '加入社区',
+ become_member: '成为会员',
+ donate_books: '捐赠书籍',
+ how_it_works: '运作方式',
+ how_it_works_description: '三个简单步骤借阅社区书籍',
+ step_1_find_book: '1. 寻找书籍',
+ step_1_description:
+ '浏览我们的藏书并找到您感兴趣的书籍。可按类别、作者或热度筛选。',
+ step_2_apply: '2. 申请借阅',
+ step_2_description: '提交简单的申请表。我们将为您联系书籍所有者并安排交接。',
+ step_3_receive: '3. 接收并传递',
+ step_3_description:
+ '阅读完毕后归还书籍。考虑捐赠您自己的书籍,让知识持续流动。',
+ learn_more_about_borrowing: '了解更多借阅信息',
+ community_voices: '社区声音',
+ community_voices_description: '会员对开源图书馆的评价',
+ read_more_reviews: '阅读更多评价',
+ share_your_knowledge: '分享您的知识',
+ donate_a_book: '捐赠一本书',
+ stay_updated: '保持更新',
+ newsletter_description: '订阅我们的通讯,获取新书到达和社区活动信息。',
+ email_placeholder: '您的电子邮箱',
+ subscribe: '订阅',
+
+ // Open Library Books Page
+ book_catalog: '书籍目录',
+ search_books: '搜索书籍',
+ all_categories: '所有分类',
+ all_languages: '所有语言',
+ all_status: '所有状态',
+ available: '可借阅',
+ borrowed: '已借出',
+ reset_filters: '重置筛选',
+ showing_books: '显示 {0} 本书,共 {1} 本',
+ no_books_found: '未找到书籍',
+ try_adjusting_filters: '尝试调整筛选条件',
+ reset_all_filters: '重置所有筛选',
+ view_details: '查看详情',
+ currently_with: '当前持有者: {0}',
+
+ // Open Library Book Detail Page
+ loading: '加载中...',
+ book_not_found: '未找到书籍',
+ return_to_catalog: '返回目录',
+ back: '返回',
+ by_author: '作者: {0}',
+ currently_borrowed: '当前已借出',
+ currently_unavailable: '当前不可用',
+ request_to_borrow: '申请借阅',
+ reviews: '评价',
+ borrow_history: '借阅历史',
+ no_reviews_yet: '暂无评价',
+ be_first_to_review: '成为第一个评价的人!',
+ write_review: '写评价',
+ add_your_review: '添加您的评价',
+ borrower: '借阅者',
+ borrow_date: '借阅日期',
+ return_date: '归还日期',
+ status: '状态',
+ returned: '已归还',
+ active: '借阅中',
+ not_borrowed_yet: '此书尚未被借阅过',
+
+ // Open Library About Page
+ about_open_library: '关于社区图书馆',
+ our_mission: '我们的使命',
+ our_values: '我们的价值观',
+ our_features: '我们的特色',
+ our_team: '我们的团队',
+ join_us_open_library: '加入我们',
+
+ // Open Library Donate Page
+ book_donation: '书籍募捐',
+ why_donate: '为什么捐赠书籍?',
+ donation_process: '捐赠流程',
+ book_registration: '书籍登记',
+ what_books_we_accept: '我们接受什么样的书籍?',
+ we_welcome: '我们欢迎',
+ not_suitable: '不适合捐赠',
+ faq: '常见问题',
+ ready_to_donate: '准备好捐赠书籍了吗?',
+ fill_donation_form: '填写捐赠申请',
+ apply_for_membership: '申请成为会员',
+
+ // Open Library How to Borrow Page
+ how_to_borrow_page: '如何借阅',
+ borrowing_and_passing: '借阅与传递模式',
+ borrowing_process: '借阅流程',
+ borrowing_rules: '借阅规则',
+ quick_links: '快速链接',
+ view_full_catalog: '查看完整书籍目录',
+ fill_borrow_request: '填写借阅申请',
+ fill_book_passing_form: '填写书籍传递表',
+ browse_book_catalog: '浏览书籍目录',
+
+ // Open Library Review Page
+ book_reviews: '书籍评价',
+ community_reviews: '社区书评',
+ all_reviews: '所有评价',
+ recent_reviews: '最新评价',
+ top_reviews: '高分评价',
+ write_your_review: '写下您的书评',
+ review_guidelines: '书评指南',
+ how_to_write_helpful_review: '如何写一篇有帮助的书评',
+ rating_reference: '评分参考',
+
+ // Homepage Hero Section
+ hero_title: '知识在这里自由流动',
+ hero_subtitle:
+ '在我们的开源社区中分享和借阅书籍。加入 freeCodeCamp 成都社区的倡议,让学习对每个人都触手可及。',
+
+ // Featured Books Section
+ featured_books_subtitle: '发现我们社区现在正在阅读的书籍',
+
+ // Donation Callout Section
+ donation_callout_subtitle:
+ '您的书架上有积灰的书吗?将它们捐赠给我们的社区,帮助他人学习和成长。您的贡献会产生影响!',
+
+ // Footer
+ footer_description:
+ '一个由社区驱动的图书馆,用于分享知识和故事。开源构建。由慷慨驱动。',
+ quick_links_footer: '快速链接',
+ home_footer: '首页',
+ catalog_footer: '目录',
+ about_us_footer: '关于我们',
+ donate_footer: '捐赠',
+ contact: '联系我们',
+ contact_email: '邮箱:info@openlibrary.community',
+ contact_address: '地址:123 图书馆路,知识城,世界',
+ follow_us: '关注我们',
+ all_rights_reserved: '版权所有',
};
diff --git a/translation/zh-TW.ts b/translation/zh-TW.ts
index 586319c..39043ff 100644
--- a/translation/zh-TW.ts
+++ b/translation/zh-TW.ts
@@ -13,8 +13,154 @@ export default {
// Search
keywords: '關鍵詞',
search_results: '搜尋結果',
-
// Scroll List
load_more: '加載更多……',
no_more: '沒有更多',
+
+
+ // Open Library
+ open_library: '開源圖書館',
+
+ // Open Library Navigation
+ home: '首頁',
+ catalog: '目錄',
+ donate: '捐贈',
+ how_to_borrow: '如何借書',
+ review: '書評',
+
+ // Open Library Home Page
+ featured_books: '特色書籍',
+ view_all_books: '查看所有書籍',
+ browse_catalog: '瀏覽目錄',
+ testimonials: '證言',
+ join_community: '加入社群',
+ become_member: '成為會員',
+ donate_books: '捐贈書籍',
+ how_it_works: '如何運作',
+ how_it_works_description: '九步驟加入社群圖書館',
+ step_1_find_book: '1. 找書',
+ step_1_description:
+ '瀏覽我們的書籍目錄,找到您想要的書籍。您可以按類別、作者或標題搜索。',
+ step_2_apply: '2. 申請借書',
+ step_2_description: '填寫借書申請表格,我們會與您聯絡安排借書事宜。',
+ step_3_receive: '3. 收書',
+ step_3_description: '書籍將會寄送到您指定的地址,請注意查收。',
+ learn_more_about_borrowing: '了解更多借書資訊',
+ community_voices: '社群聲音',
+ community_voices_description: '聽聽我們的社群成員怎麼說',
+ read_more_reviews: '閱讀更多書評',
+ share_your_knowledge: '分享您的知識',
+ donate_a_book: '捐贈一本書',
+ stay_updated: '保持更新',
+ newsletter_description: '訂閱我們的電子報,保持與社群圖書館的聯絡。',
+ email_placeholder: '您的電子郵件地址',
+ subscribe: '訂閱',
+
+ // Open Library Books Page
+ book_catalog: '書籍目錄',
+ search_books: '搜尋書籍',
+ all_categories: '所有類別',
+ all_languages: '所有語言',
+ all_status: '所有狀態',
+ available: '可借',
+ borrowed: '已借出',
+ reset_filters: '重設篩選',
+ showing_books: '顯示 {0} 本書,共 {1} 本',
+ no_books_found: '沒有找到書籍',
+ try_adjusting_filters: '試著調整篩選條件',
+ reset_all_filters: '重設所有篩選',
+ view_details: '查看詳情',
+ currently_with: '目前由 {0} 借出',
+
+ // Open Library Book Detail Page
+ loading: '載入中...',
+ book_not_found: '沒有找到書籍',
+ return_to_catalog: '返回目錄',
+ back: '返回',
+ by_author: '作者:{0}',
+ currently_borrowed: '目前已借出',
+ currently_unavailable: '目前不可借',
+ request_to_borrow: '申請借書',
+ reviews: '書評',
+ borrow_history: '借書歷史',
+ no_reviews_yet: '尚無書評',
+ be_first_to_review: '成為第一個書評的人!',
+ write_review: '寫書評',
+ add_your_review: '新增您的書評',
+ borrower: '借書人',
+ borrow_date: '借書日期',
+ return_date: '歸還日期',
+ status: '狀態',
+ returned: '已歸還',
+ active: '借書中',
+ not_borrowed_yet: '尚未借出',
+
+ // Open Library About Page
+ about_open_library: '關於開源圖書館',
+ our_mission: '我們的使命',
+ our_values: '我們的價值',
+ our_features: '我們的特色',
+ our_team: '我們的團隊',
+ join_us_open_library: '加入我們',
+
+ // Open Library Donate Page
+ book_donation: '書籍捐贈',
+ why_donate: '為什麼捐贈?',
+ donation_process: '捐贈流程',
+ book_registration: '書籍登錄',
+ what_books_we_accept: '我們接受什麼書籍?',
+ we_welcome: '我們歡迎',
+ not_suitable: '不適合',
+ faq: '常見問題',
+ ready_to_donate: '準備捐贈書籍?',
+ fill_donation_form: '填寫捐贈表單',
+ apply_for_membership: '申請會員',
+
+ // Open Library How to Borrow Page
+ how_to_borrow_page: '如何借書',
+ borrowing_and_passing: '借閱與傳遞模式',
+ borrowing_process: '借書流程',
+ borrowing_rules: '借書規則',
+ quick_links: '快速連結',
+ view_full_catalog: '查看完整目錄',
+ fill_borrow_request: '填寫借書申請',
+ fill_book_passing_form: '填寫書籍傳遞表單',
+ browse_book_catalog: '瀏覽書籍目錄',
+
+ // Open Library Review Page
+ book_reviews: '書籍書評',
+ community_reviews: '社群書評',
+ all_reviews: '所有書評',
+ recent_reviews: '最新書評',
+ top_reviews: '最佳書評',
+ write_your_review: '寫您的書評',
+ review_guidelines: '書評指南',
+ how_to_write_helpful_review: '如何寫有用的書評',
+ rating_reference: '評分參考',
+
+ // Homepage Hero Section
+ hero_title: '在我們的開源圖書館中探索',
+ hero_subtitle:
+ '在我們的社群圖書館中探索免費的書籍和資源。加入 freeCodeCamp 成為社群圖書館的一部分,學習和分享知識。',
+
+ // Featured Books Section
+ featured_books_subtitle: '我們社群圖書館中最受歡迎的書籍',
+
+ // Donation Callout Section
+ donation_callout_subtitle:
+ '您的捐贈將有助於我們的社群圖書館的發展。您的支持將有助於我們提供更多免費的書籍和資源給社群成員。',
+
+ // Footer
+ footer_description:
+ '一個開源的社群圖書館,提供免費的書籍和資源給社群成員。開源。免費。無限可能。',
+ quick_links_footer: '快速連結',
+ home_footer: '首頁',
+ catalog_footer: '目錄',
+ about_us_footer: '關於我們',
+ donate_footer: '捐贈',
+ contact: '聯絡我們',
+ contact_email: '聯絡郵件:info@openlibrary.community',
+ contact_address: '地址:123 圖書館路,社群圖書館,香港',
+ follow_us: '關注我們',
+ all_rights_reserved: '版權所有',
};