Skip to content

Conversation

aliferne
Copy link

@aliferne aliferne commented Sep 30, 2025

解决的Issue

Resolve #1533

@aliferne aliferne requested a review from a team as a code owner September 30, 2025 07:39
@AmosHuKe
Copy link
Member

@aliferne 感谢你的贡献 😄
不用另起新的文档,可以直接对 src/content/app-architecture/design-patterns/sql.md 进行翻译~

@aliferne
Copy link
Author

诶,我没注意到有英文文档,那这样的话需要去原来那个文档翻译吗?另外这个PR应该是通过了?

@AmosHuKe
Copy link
Member

AmosHuKe commented Sep 30, 2025

那这样的话需要去原来那个文档翻译吗?

你直接在这个 PR 分支按照翻译格式改 src/content/app-architecture/design-patterns/sql.md
并删除现在新增的 src/docs/persistent_storage_arch_sql.md 文档。

另外这个PR应该是通过了?

等修改完成后,我们会找时间来审查内容以及润色~

@AmosHuKe AmosHuKe added the PRI: 待修改 Reviewers 请求了内容修改。 label Sep 30, 2025
@AmosHuKe AmosHuKe changed the title [完成翻译] src/docs/persistent_storage_arch_sql.md [完成翻译] src/content/app-architecture/design-patterns/sql.md Sep 30, 2025
@aliferne
Copy link
Author

aliferne commented Oct 1, 2025

好的,你再看一下吧,我重新commit了一遍,把之前的内容都移到指定的文档了

@AmosHuKe AmosHuKe added Status: 校对已认领 and removed PRI: 待修改 Reviewers 请求了内容修改。 labels Oct 1, 2025
Copy link
Member

@AmosHuKe AmosHuKe left a comment

Choose a reason for hiding this comment

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

@aliferne 感谢你的贡献!
不过还存在部分格式问题,针对翻译相关的建议以及润色已经在下方提出(如果有相关建议,也可以互相交流~)

Comment on lines 2 to +5
title: "Persistent storage architecture: SQL"
title: 持久化存储架构:SQL
description: Save complex application data to a user's device with SQL.
description: 使用 SQL 将复杂的应用程序数据保存到用户的设备上。
Copy link
Member

Choose a reason for hiding this comment

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

  • 需要注释原始内容
  • 翻译建议
Suggested change
title: "Persistent storage architecture: SQL"
title: 持久化存储架构:SQL
description: Save complex application data to a user's device with SQL.
description: 使用 SQL 将复杂的应用程序数据保存到用户的设备上
# title: "Persistent storage architecture: SQL"
title: 持久化存储架构:SQL
# description: Save complex application data to a user's device with SQL.
description: 采用 SQL 将复杂的应用数据存储至用户设备

Comment on lines +24 to +29
大多数 Flutter 应用程序,
无论大小,
在某个时刻都可能需要将数据存储在用户设备上。
例如 API 密钥、
用户偏好,或者其他在离线时应该依然可用的数据。

Copy link
Member

Choose a reason for hiding this comment

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

  • 翻译建议
Suggested change
大多数 Flutter 应用程序,
无论大小
在某个时刻都可能需要将数据存储在用户设备上
例如 API 密钥、
用户偏好,或者其他在离线时应该依然可用的数据。
大多数 Flutter 应用程序,
无论规模大小
往往需要在用户设备上存储数据
例如API 密钥、用户偏好内容,以及需要支持离线访问的数据。

Comment on lines +34 to +38
在这个教程中,
你将学习如何将 SQL 持久化存储的功能集成到
遵循 Flutter 架构设计模式的 Flutter 应用程序中。


Copy link
Member

Choose a reason for hiding this comment

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

  • 去除多余的换行
  • 翻译建议
Suggested change
在这个教程中,
你将学习如何将 SQL 持久化存储的功能集成到
遵循 Flutter 架构设计模式的 Flutter 应用程序中。
在本教程中,
你将学习如何遵循 Flutter 架构设计模式,
并在 Flutter 应用中实现基于 SQL 的复杂数据持久化存储。

Comment on lines 39 to 41
To learn how to store simpler key-value data,
take a look at the Cookbook recipe:
[Persistent storage architecture: Key-value data][].
Copy link
Member

Choose a reason for hiding this comment

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

  • 遗漏翻译
  • 翻译建议
Suggested change
To learn how to store simpler key-value data,
take a look at the Cookbook recipe:
[Persistent storage architecture: Key-value data][].
To learn how to store simpler key-value data,
take a look at the Cookbook recipe:
[Persistent storage architecture: Key-value data][].
如果你需要了解如何存储更简单的键值 (Key-Value) 数据,
请参阅实用教程中的示例:
[持久化存储架构:键值 (Key-Value) 数据][Persistent storage architecture: Key-value data]

Comment on lines +48 to +52
你应该先熟悉 SQL 和 SQLite,
然后再阅读这个教程。
如果你需要帮助,可以在阅读这个教程之前
先阅读 [用 SQLite 实现数据持久化](https://docs.flutter.cn/cookbook/persistence/sqlite)

Copy link
Member

Choose a reason for hiding this comment

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

  • 保留链接引用
  • 翻译建议
Suggested change
你应该先熟悉 SQL 和 SQLite,
然后再阅读这个教程。
如果你需要帮助,可以在阅读这个教程之前
先阅读 [用 SQLite 实现数据持久化](https://docs.flutter.cn/cookbook/persistence/sqlite)
在阅读本教程之前,
你应该先掌握 SQL 和 SQLite 的基础知识。
如果你需要帮助,可以先阅读
[用 SQLite 实现数据持久化][Persist data with SQLite] 教程。

Comment on lines +549 to +551
在这种情况下,如果没有删除任何项目,将返回一个错误,
它表示哪里出了问题。

Copy link
Member

Choose a reason for hiding this comment

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

  • 翻译建议
Suggested change
在这种情况下,如果没有删除任何项目,将返回一个错误,
它表示哪里出了问题。
此时,如果没有删除任何数据项,将返回一个错误,
以表明该操作未能按预期完成。

Comment on lines +585 to +588

这取决于数据库实现以及你的应用程序需求。
建议你咨询数据库包的作者以获取建议。

Copy link
Member

Choose a reason for hiding this comment

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

  • 翻译建议
Suggested change
这取决于数据库实现以及你的应用程序需求。
建议你咨询数据库包的作者以获取建议。
这取决于数据库实现以及你的应用程序需求。
建议你咨询数据库 package 的作者以获取相关建议。

Comment on lines +593 to +594
## [将所有内容整合在一起](https://docs.flutter.cn/app-architecture/design-patterns/sql#putting-it-all-together)

Copy link
Member

Choose a reason for hiding this comment

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

  • 无需引用链接
  • 翻译建议
Suggested change
## [将所有内容整合在一起](https://docs.flutter.cn/app-architecture/design-patterns/sql#putting-it-all-together)
## 整合业务

Comment on lines +601 to +606
在你的应用程序的 `main()` 方法中,
首先初始化 `DatabaseService`
这需要在不同的平台上使用不同的初始化代码。
然后,将新创建的 `DatabaseService` 传递给 `TodoRepository`
`TodoRepository` 本身作为构造函数参数的依赖被传递给 `MainApp`

Copy link
Member

Choose a reason for hiding this comment

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

  • 去除多余的空格
  • 翻译建议(根据当前的架构设计,我们可以强调依赖注入的概念)
Suggested change
在你的应用程序的 `main()` 方法中,
首先初始化 `DatabaseService`
这需要在不同的平台上使用不同的初始化代码。
然后,将新创建的 `DatabaseService` 传递给 `TodoRepository`
`TodoRepository` 本身作为构造函数参数的依赖被传递给 `MainApp`
在应用程序的 `main()` 方法中,
首先初始化 `DatabaseService`(针对不同平台编写特定的初始化代码)
然后将新创建的 `DatabaseService` 实例注入 `TodoRepository`
最后将 `TodoRepository` 作为构造依赖项注入 `MainApp`

Comment on lines +635 to +638
然后,在创建 `TodoListScreen` 时,
也创建 `TodoListViewModel`
并将其作为依赖项传递给它。

Copy link
Member

Choose a reason for hiding this comment

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

  • 去除多余的空格
  • 翻译建议(强调依赖注入的概念)
Suggested change
然后,在创建 `TodoListScreen` 时,
也创建 `TodoListViewModel`
并将其作为依赖项传递给它。
随后,在创建 `TodoListScreen` 时,
需要同步创建 `TodoListViewModel`
并将 `TodoRepository` 作为其依赖项注入。

@AmosHuKe AmosHuKe added the PRI: 待修改 Reviewers 请求了内容修改。 label Oct 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
PRI: 待修改 Reviewers 请求了内容修改。 Status: 校对已认领
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[翻译任务] Persistent storage architecture: SQL - 持久存储架构:SQL
2 participants