-
Notifications
You must be signed in to change notification settings - Fork 365
[完成翻译] src/content/app-architecture/design-patterns/sql.md #1581
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
@aliferne 感谢你的贡献 😄 |
诶,我没注意到有英文文档,那这样的话需要去原来那个文档翻译吗?另外这个PR应该是通过了? |
你直接在这个 PR 分支按照翻译格式改
等修改完成后,我们会找时间来审查内容以及润色~ |
好的,你再看一下吧,我重新commit了一遍,把之前的内容都移到指定的文档了 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@aliferne 感谢你的贡献!
不过还存在部分格式问题,针对翻译相关的建议以及润色已经在下方提出(如果有相关建议,也可以互相交流~)
title: "Persistent storage architecture: SQL" | ||
title: 持久化存储架构:SQL | ||
description: Save complex application data to a user's device with SQL. | ||
description: 使用 SQL 将复杂的应用程序数据保存到用户的设备上。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 需要注释原始内容
- 翻译建议
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 将复杂的应用数据存储至用户设备。 |
大多数 Flutter 应用程序, | ||
无论大小, | ||
在某个时刻都可能需要将数据存储在用户设备上。 | ||
例如 API 密钥、 | ||
用户偏好,或者其他在离线时应该依然可用的数据。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 翻译建议
大多数 Flutter 应用程序, | |
无论大小, | |
在某个时刻都可能需要将数据存储在用户设备上。 | |
例如 API 密钥、 | |
用户偏好,或者其他在离线时应该依然可用的数据。 | |
大多数 Flutter 应用程序, | |
无论规模大小, | |
往往需要在用户设备上存储数据。 | |
例如:API 密钥、用户偏好内容,以及需要支持离线访问的数据。 | |
在这个教程中, | ||
你将学习如何将 SQL 持久化存储的功能集成到 | ||
遵循 Flutter 架构设计模式的 Flutter 应用程序中。 | ||
|
||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 去除多余的换行
- 翻译建议
在这个教程中, | |
你将学习如何将 SQL 持久化存储的功能集成到 | |
遵循 Flutter 架构设计模式的 Flutter 应用程序中。 | |
在本教程中, | |
你将学习如何遵循 Flutter 架构设计模式, | |
并在 Flutter 应用中实现基于 SQL 的复杂数据持久化存储。 | |
To learn how to store simpler key-value data, | ||
take a look at the Cookbook recipe: | ||
[Persistent storage architecture: Key-value data][]. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 遗漏翻译
- 翻译建议
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] |
你应该先熟悉 SQL 和 SQLite, | ||
然后再阅读这个教程。 | ||
如果你需要帮助,可以在阅读这个教程之前 | ||
先阅读 [用 SQLite 实现数据持久化](https://docs.flutter.cn/cookbook/persistence/sqlite)。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 保留链接引用
- 翻译建议
你应该先熟悉 SQL 和 SQLite, | |
然后再阅读这个教程。 | |
如果你需要帮助,可以在阅读这个教程之前 | |
先阅读 [用 SQLite 实现数据持久化](https://docs.flutter.cn/cookbook/persistence/sqlite)。 | |
在阅读本教程之前, | |
你应该先掌握 SQL 和 SQLite 的基础知识。 | |
如果你需要帮助,可以先阅读 | |
[用 SQLite 实现数据持久化][Persist data with SQLite] 教程。 | |
在这种情况下,如果没有删除任何项目,将返回一个错误, | ||
它表示哪里出了问题。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 翻译建议
在这种情况下,如果没有删除任何项目,将返回一个错误, | |
它表示哪里出了问题。 | |
此时,如果没有删除任何数据项,将返回一个错误, | |
以表明该操作未能按预期完成。 | |
|
||
这取决于数据库实现以及你的应用程序需求。 | ||
建议你咨询数据库包的作者以获取建议。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 翻译建议
这取决于数据库实现以及你的应用程序需求。 | |
建议你咨询数据库包的作者以获取建议。 | |
这取决于数据库实现以及你的应用程序需求。 | |
建议你咨询数据库 package 的作者以获取相关建议。 | |
## [将所有内容整合在一起](https://docs.flutter.cn/app-architecture/design-patterns/sql#putting-it-all-together) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 无需引用链接
- 翻译建议
## [将所有内容整合在一起](https://docs.flutter.cn/app-architecture/design-patterns/sql#putting-it-all-together) | |
## 整合业务 | |
在你的应用程序的 `main()` 方法中, | ||
首先初始化 `DatabaseService` , | ||
这需要在不同的平台上使用不同的初始化代码。 | ||
然后,将新创建的 `DatabaseService` 传递给 `TodoRepository` , | ||
而 `TodoRepository` 本身作为构造函数参数的依赖被传递给 `MainApp` 。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 去除多余的空格
- 翻译建议(根据当前的架构设计,我们可以强调依赖注入的概念)
在你的应用程序的 `main()` 方法中, | |
首先初始化 `DatabaseService` , | |
这需要在不同的平台上使用不同的初始化代码。 | |
然后,将新创建的 `DatabaseService` 传递给 `TodoRepository` , | |
而 `TodoRepository` 本身作为构造函数参数的依赖被传递给 `MainApp` 。 | |
在应用程序的 `main()` 方法中, | |
首先初始化 `DatabaseService`(针对不同平台编写特定的初始化代码), | |
然后将新创建的 `DatabaseService` 实例注入 `TodoRepository`, | |
最后将 `TodoRepository` 作为构造依赖项注入 `MainApp`。 | |
然后,在创建 `TodoListScreen` 时, | ||
也创建 `TodoListViewModel` , | ||
并将其作为依赖项传递给它。 | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
- 去除多余的空格
- 翻译建议(强调依赖注入的概念)
然后,在创建 `TodoListScreen` 时, | |
也创建 `TodoListViewModel` , | |
并将其作为依赖项传递给它。 | |
随后,在创建 `TodoListScreen` 时, | |
需要同步创建 `TodoListViewModel`, | |
并将 `TodoRepository` 作为其依赖项注入。 | |
解决的Issue
Resolve #1533