Skip to content

Commit

Permalink
docs: update chinese translation (#1568)
Browse files Browse the repository at this point in the history
  • Loading branch information
fernandoxu authored Sep 14, 2023
1 parent 5551522 commit 3c0cefe
Show file tree
Hide file tree
Showing 6 changed files with 28 additions and 1 deletion.
2 changes: 1 addition & 1 deletion www/src/pages/zh-hans/deployment/netlify.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ Netlify 是与 Vercel 类似的托管平台服务商。参看基于本文档的
所有的部署平台都有相对的优缺点,因为没有一家供应商能对所有的使用场景都提供最好的支持。举例来说,Netlify 为他们的边缘函数(它们运行在 Deno 环境)自行创建了一个 [定制的 Next.js 运行时](https://github.com/netlify/next-runtime)[使用了独有的中间件来访问和修改 HTTP 响应](https://github.com/netlify/next-runtime#nextjs-middleware-on-netlify)

<Callout type="info">
要追踪 Next 13 非稳定特性的最新状态,参看 [在 Netlify 上使用 Next.js 13 的 `app` 目录](https://github.com/netlify/next-runtime/discussions/1724)_
要追踪 Next 13 非稳定特性的最新状态,参看 [在 Netlify 上使用 Next.js 13 的 `app` 目录](https://github.com/netlify/next-runtime/discussions/1724)
</Callout>

## 项目配置
Expand Down
1 change: 1 addition & 0 deletions www/src/pages/zh-hans/faq.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ import Callout from "../../components/docs/callout.tsx";
- [Prisma](https://prisma.io)
- [Tailwind CSS](https://tailwindcss.com)
- [tRPC](https://trpc.io)
- [Drizzle](https://orm.drizzle.team/docs/overview)

## 如何使我的应用保持更新?
Create T3 App 是一个脚手架工具,而不是一个框架。这意味着一旦你初始化了一个应用程序,它就是你的了。没有类似于 postinstall CLI 的工具来帮助你保持最新状态。如果你想跟踪我们对模板所做的任何改进,你可以在我们的存储库上[启用发布通知](https://docs.github.com/en/account-and-profile/managing-subscriptions-and-notifications-on-github/setting-up-notifications/configuring-notifications#configuring-your-watch-settings-for-an-individual-repository)功能。
Expand Down
7 changes: 7 additions & 0 deletions www/src/pages/zh-hans/folder-structure.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -204,3 +204,10 @@ root.ts 文件用于合并 tRPC 子路由并将它们导出为一个单一的路
文件 `tsconfig.json` 被用于配置 TypeScript。一些非默认项,例如 `strict mode` 已经被启用来保证使用 Create T3 App 和它所含库时能获得最佳的 TypeScript 开发体验。参看 [TypeScript 文档](https://www.typescriptlang.org/docs/handbook/tsconfig-json.html)[TypeScript 用法](/zh-hans/usage/typescript) 来了解更多。

</div>
<div>

### `drizzle.config.ts`

文件 `drizzle.config.ts` 被文件用于配置 drizzle kit。更多信息请参看 [文档](https://orm.drizzle.team/kit-docs/config-reference)

</div>
13 changes: 13 additions & 0 deletions www/src/pages/zh-hans/usage/drizzle.mdx
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
---
title: Drizzle
description: Drizzle 的用法
layout: ../../../layouts/docs.astro
lang: zh-hans
isMdx: true
---

import Callout from "../../../components/docs/callout.tsx";

<Callout type="info">
`drizzle` 选项是一个新添加的功能,目前尚未编写文档。欢迎贡献文档!
</Callout>
4 changes: 4 additions & 0 deletions www/src/pages/zh-hans/usage/first-steps.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ lang: zh-hans

如果你的 App 包括了 Prisma,务必记得从项目根目录运行命令 `npx prisma db push`。 这行命令将同步 Prisma schema 和你的数据库,并且会根据 schema 为 Prisma 客户端生成对应的类型声明。注意你在完成这一步之后,需要 [重启 TypeScript 服务器](https://tinytip.co/tips/vscode-restart-ts/),以便它能够检测到那些生成的类型。

### Drizzle

如果你的 App 包含了 Drizzle,请查看 `.env` 文件,了解如何构建你的 `DATABASE_URL` 环境变量。当 env 文件准备就绪后,运行 `pnpm db:push`(或其他软件包管理器的类似方法)来推送你的 schema。

## 认证

如果你的 App 包含了 NextAuth.js,那我们可以先从 `DiscordProvider` 开始。这是 NextAuth.js 提供的最简单的第三方服务之一,但是它仍然需要你做一些初始化的操作。
Expand Down
2 changes: 2 additions & 0 deletions www/src/pages/zh-hans/usage/next-js.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,8 @@ Next.js 是你 React 应用的后端框架。

Next.js 的一项关键特性就是它支持的几种获取数据的方法。我们强烈推荐先通读 [官方文档](https://nextjs.org/docs/basic-features/data-fetching) 来理解如何使用每一种方法,以及它们之间的区别。一般情况下不推荐使用 `getServerSideProps`,除非有好的理由,因为它是一个阻塞 UI 的方法,会减慢你的网站运行速度。当数据是动态且需要被增量获取时,[Incremental Static Regeneration](https://nextjs.org/docs/basic-features/data-fetching/incremental-static-regeneration) 便是 `getServerSideProps` 的一个非常好的备选方案。

如果你仍需要使用这个特性,可以查看这些链接:[Advanced tRPC - Callers, functions, and gSSP](https://www.youtube.com/watch?v=G2ZzmgShHgQ)[SSG-Helpers](https://trpc.io/docs/v9/ssg-helpers)

## 有用的资源

| 资源 | 链接 |
Expand Down

2 comments on commit 3c0cefe

@vercel
Copy link

@vercel vercel bot commented on 3c0cefe Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@vercel
Copy link

@vercel vercel bot commented on 3c0cefe Sep 14, 2023

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Successfully deployed to the following URLs:

t3-upgrade – ./upgrade

t3-upgrade-git-next-t3-oss.vercel.app
t3-upgrade-t3-oss.vercel.app
t3-upgrade.vercel.app

Please sign in to comment.