Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
89 changes: 48 additions & 41 deletions _translations/po/zh-CN/guide_caching_data.md.po

Large diffs are not rendered by default.

16 changes: 8 additions & 8 deletions _translations/po/zh-CN/guide_caching_overview.md.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,39 +19,39 @@ msgstr ""
#: ../src/guide/caching/overview.md ../src/guide/index.md
#, no-wrap
msgid "Caching"
msgstr ""
msgstr "缓存"

#. type: Plain text
#: ../src/guide/caching/overview.md
msgid "Caching is an inexpensive and effective way to improve the performance of an application. By storing relatively static data in cache and serving it from cache when requested, the application saves the time that it otherwise would require to generate the data from scratch every time."
msgstr ""
msgstr "缓存是提高应用程序性能的一种廉价而有效的方法。通过将相对静态的数据存储在缓存中,并在请求时从缓存中提供数据,应用程序节省了每次从头生成数据所需的时间。"

#. type: Plain text
#: ../src/guide/caching/overview.md
msgid "Caching can occur at different levels and places in an application. On the server-side, at the lower level, cache may be used to store basic data, such as a list of most recent article information fetched from the database; and at the higher level, cache may be used to store fragments or whole of Web pages, such as the rendering result of the most recent articles. On the client-side, you may use HTTP caching to keep most recently visited page content in the browser cache."
msgstr ""
msgstr "缓存可以在应用程序的不同级别和位置发生。在服务器端,在较低级别,缓存可用于存储基本数据,例如从数据库获取的最新文章信息列表;在较高级别,缓存可用于存储 Web 页面的片段或整体,例如最新文章的渲染结果。在客户端,您可以使用 HTTP 缓存将最近访问的页面内容保存在浏览器缓存中。"

#. type: Plain text
#: ../src/guide/caching/overview.md
msgid "Yii supports all these caching mechanisms:"
msgstr ""
msgstr "Yii 支持所有这些缓存机制:"

#. type: Bullet: '* '
#: ../src/guide/caching/overview.md
msgid "[Data caching](data.md)"
msgstr ""
msgstr "[数据缓存](data.md)"

#. type: Bullet: '* '
#: ../src/guide/caching/overview.md
msgid "[Fragment caching](fragment.md)"
msgstr ""
msgstr "[片段缓存](fragment.md)"

#. type: Bullet: '* '
#: ../src/guide/caching/overview.md
msgid "[Page caching](page.md)"
msgstr ""
msgstr "[页面缓存](page.md)"

#. type: Bullet: '* '
#: ../src/guide/caching/overview.md
msgid "[HTTP caching](http.md)"
msgstr ""
msgstr "[HTTP 缓存](http.md)"
62 changes: 33 additions & 29 deletions _translations/po/zh-CN/guide_concept_aliases.md.po
Original file line number Diff line number Diff line change
Expand Up @@ -19,28 +19,28 @@ msgstr ""
#: ../src/guide/concept/aliases.md
#, no-wrap
msgid "Aliases"
msgstr ""
msgstr "别名"

#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "You can use aliases to represent file paths or URLs so that you don't have to hard-code absolute paths or URLs in your project. An alias must start with the `@` character to be differentiated from normal file paths and URLs. Alias defined without leading `@` will be prefixed with `@` character."
msgstr ""
msgstr "您可以使用别名来表示文件路径或 URL,这样您就不必在项目中硬编码绝对路径或 URL。别名必须以 `@` 字符开头,以便与普通文件路径和 URL 区分开来。定义时没有前导 `@` 的别名将自动添加 `@` 字符前缀。"

#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "Default Yii application has some aliases pre-defined in `config/params.php`. For example, the alias `@public` represents the web root path; `@baseUrl` represents the base URL for the currently running Web application."
msgstr ""
msgstr "默认的 Yii 应用程序在 `config/params.php` 中预定义了一些别名。例如,别名 `@public` 表示 Web 根路径;`@baseUrl` 表示当前运行的 Web 应用程序的基础 URL。"

#. type: Title ##
#: ../src/guide/concept/aliases.md
#, no-wrap
msgid "Defining aliases <span id=\"defining-aliases\"></span>"
msgstr ""
msgstr "定义别名 <span id=\"defining-aliases\"></span>"

#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "You can define an alias via application's `config/params.php`:"
msgstr ""
msgstr "您可以通过应用程序的 `config/params.php` 定义别名:"

#. type: Fenced code block (php)
#: ../src/guide/concept/aliases.md
Expand Down Expand Up @@ -73,16 +73,18 @@ msgid ""
"> [!NOTE]\n"
"> The file path or URL being aliased may *not* necessarily refer to an existing file or resource.\n"
msgstr ""
"> [!NOTE]\n"
"> 被别名化的文件路径或 URL *不一定*指向现有的文件或资源。\n"

#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "Given a defined alias, you may derive a new alias by appending a slash `/` followed with one or more path segments. For example, `@foo` is a root alias, while `@foo/bar/file.php` is a derived alias."
msgstr ""
msgstr "给定一个已定义的别名,您可以通过附加斜杠 `/` 后跟一个或多个路径段来派生新别名。例如,`@foo` 是根别名,而 `@foo/bar/file.php` 是派生别名。"

#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "You can define an alias using another alias (either root or derived):"
msgstr ""
msgstr "您可以使用另一个别名(根别名或派生别名)来定义别名:"

#. type: Fenced code block (php)
#: ../src/guide/concept/aliases.md
Expand All @@ -93,7 +95,7 @@ msgstr ""
#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "The `yiisoft/aliases` parameter initializes `Aliases` service from [`yiisoft/aliases`](https://github.com/yiisoft/aliases) package. You can set extra aliases in runtime by using the service:"
msgstr ""
msgstr "`yiisoft/aliases` 参数从 [`yiisoft/aliases`](https://github.com/yiisoft/aliases) 包初始化 `Aliases` 服务。您可以在运行时使用该服务设置额外的别名:"

#. type: Fenced code block (php)
#: ../src/guide/concept/aliases.md
Expand All @@ -111,12 +113,12 @@ msgstr ""
#: ../src/guide/concept/aliases.md
#, no-wrap
msgid "Using aliases in configuration <span id=\"using-aliases-in-configuration\"></span>"
msgstr ""
msgstr "在配置中使用别名 <span id=\"using-aliases-in-configuration\"></span>"

#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "It's preferred to resolve aliases at the configuration level, so services get URLs and paths as ready to use strings:"
msgstr ""
msgstr "最好在配置级别解析别名,这样服务就可以获得可直接使用的 URL 和路径字符串:"

#. type: Fenced code block (php)
#: ../src/guide/concept/aliases.md
Expand All @@ -142,12 +144,12 @@ msgstr ""
#: ../src/guide/concept/aliases.md
#, no-wrap
msgid "Resolving aliases <span id=\"resolving-aliases\"></span>"
msgstr ""
msgstr "解析别名 <span id=\"resolving-aliases\"></span>"

#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "You can use `Aliases` service to resolve an alias or derived alias into the file path or URL it represents:"
msgstr ""
msgstr "您可以使用 `Aliases` 服务将别名或派生别名解析为它所代表的文件路径或 URL:"

#. type: Fenced code block (php)
#: ../src/guide/concept/aliases.md
Expand All @@ -166,7 +168,7 @@ msgstr ""
#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "The path/URL represented by a derived alias is determined by replacing the root alias part with its corresponding path/URL in the derived alias."
msgstr ""
msgstr "派生别名所代表的 path/URL 是通过将派生别名中的根别名部分替换为其对应的 path/URL 来确定的。"

#. type: Plain text
#: ../src/guide/concept/aliases.md
Expand All @@ -175,11 +177,13 @@ msgid ""
"> [!NOTE]\n"
"> The `get()` method doesn't check whether the resulting path/URL refers to an existing file or resource.\n"
msgstr ""
"> [!NOTE]\n"
"> `get()` 方法不检查结果 path/URL 是否指向现有的文件或资源。\n"

#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "A root alias may also contain slash `/` characters. The `get()` method is intelligent enough to tell, which part of an alias is a root alias and thus correctly determines the corresponding file path or URL:"
msgstr ""
msgstr "根别名也可以包含斜杠 `/` 字符。`get()` 方法足够智能,可以判断别名的哪一部分是根别名,从而正确确定相应的文件路径或 URL:"

#. type: Fenced code block (php)
#: ../src/guide/concept/aliases.md
Expand All @@ -200,75 +204,75 @@ msgstr ""
#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "If `@foo/bar` isn't defined as a root alias, the last statement would display `/path/to/foo/bar/file.php`."
msgstr ""
msgstr "如果 `@foo/bar` 未定义为根别名,最后一条语句将显示 `/path/to/foo/bar/file.php`。"

#. type: Title ##
#: ../src/guide/concept/aliases.md
#, no-wrap
msgid "Predefined aliases <span id=\"predefined-aliases\"></span>"
msgstr ""
msgstr "预定义别名 <span id=\"predefined-aliases\"></span>"

#. type: Plain text
#: ../src/guide/concept/aliases.md
msgid "[Yii application](https://github.com/yiisoft/app) predefines a set of aliases to reference commonly used file paths and URLs:"
msgstr ""
msgstr "[Yii 应用程序](https://github.com/yiisoft/app) 预定义了一组别名来引用常用的文件路径和 URL:"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@root` - the base directory of the currently running application."
msgstr ""
msgstr "`@root` - 当前运行应用程序的基础目录。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@assets` - application's public directory where it publishes assets."
msgstr ""
msgstr "`@assets` - 应用程序发布资源的公共目录。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@assetsUrl` - URL of base directory with published assets."
msgstr ""
msgstr "`@assetsUrl` - 已发布资源的基础目录的 URL。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@baseUrl` - the base URL of the currently running Web application. Defaults to `/`."
msgstr ""
msgstr "`@baseUrl` - 当前运行的 Web 应用程序的基础 URL。默认为 `/`。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@npm` - node packages directory."
msgstr ""
msgstr "`@npm` - node 包目录。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@bower` - bower packages directory."
msgstr ""
msgstr "`@bower` - bower 包目录。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@vendor` - Composer's `vendor` directory."
msgstr ""
msgstr "`@vendor` - Composer 的 `vendor` 目录。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@public` - application's publicly accessible directory that with `index.php`."
msgstr ""
msgstr "`@public` - 应用程序的公共可访问目录,包含 `index.php`。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@runtime` - the runtime path of the currently running application. Defaults to `@root/runtime`."
msgstr ""
msgstr "`@runtime` - 当前运行应用程序的运行时路径。默认为 `@root/runtime`。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@layout` - the directory with layouts."
msgstr ""
msgstr "`@layout` - 布局目录。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@resources` - directory with views, asset sources and other resources."
msgstr ""
msgstr "`@resources` - 包含视图、资源源文件和其他资源的目录。"

#. type: Bullet: '- '
#: ../src/guide/concept/aliases.md
msgid "`@views` - application view templates base directory."
msgstr ""
msgstr "`@views` - 应用程序视图模板基础目录。"
14 changes: 7 additions & 7 deletions _translations/po/zh-CN/guide_concept_autoloading.md.po
Original file line number Diff line number Diff line change
Expand Up @@ -30,17 +30,17 @@ msgstr "参考资料"
#: ../src/guide/concept/autoloading.md
#, no-wrap
msgid "Class autoloading"
msgstr ""
msgstr "类自动加载"

#. type: Plain text
#: ../src/guide/concept/autoloading.md
msgid "Since Yii uses [Composer](https://getcomposer.org) to manage packages, it automatically loads classes from these packages without the need to `require` their file explicitly. When it installs packages, it generates a [PSR-4 compatible autoloader](https://www.php-fig.org/psr/psr-4/). To use it, `require_once` autoloader `/vendor/autoload.php` in your `index.php` entry point file."
msgstr ""
msgstr "由于 Yii 使用 [Composer](https://getcomposer.org) 来管理包,它会自动从这些包中加载类,而无需显式 `require` 它们的文件。当它安装包时,会生成一个 [兼容 PSR-4 的自动加载器](https://www.php-fig.org/psr/psr-4/)。要使用它,请在您的 `index.php` 入口文件中 `require_once` 自动加载器 `/vendor/autoload.php`。"

#. type: Plain text
#: ../src/guide/concept/autoloading.md
msgid "You can use autoloader not only for the packages installed, but for your application as well since it's also a package. To load classes of a certain namespace, add the following to `composer.json`:"
msgstr ""
msgstr "您不仅可以为已安装的包使用自动加载器,还可以为您的应用程序使用,因为它也是一个包。要加载特定命名空间的类,请将以下内容添加到 `composer.json`:"

#. type: Fenced code block (json)
#: ../src/guide/concept/autoloading.md
Expand All @@ -58,19 +58,19 @@ msgstr ""
#. type: Plain text
#: ../src/guide/concept/autoloading.md
msgid "Where `App\\\\` is a root namespace and `src/` is a directory where you have your classes. You can add more source roots if needed. When done, execute `composer dump-autoload` or simply `composer du` and classes from the corresponding namespaces will start loading automatically."
msgstr ""
msgstr "其中 `App\\\\` 是根命名空间,`src/` 是您放置类的目录。如果需要,您可以添加更多源根目录。完成后,执行 `composer dump-autoload` 或简单地执行 `composer du`,相应命名空间的类将开始自动加载。"

#. type: Plain text
#: ../src/guide/concept/autoloading.md
msgid "If you need development-environment-specific autoloading that isn't used when executing Composer with `--no-dev` flag, add it to `autoload-dev` section instead of `autoload`."
msgstr ""
msgstr "如果您需要开发环境特定的自动加载,在使用 `--no-dev` 标志执行 Composer 时不使用,请将其添加到 `autoload-dev` 部分而不是 `autoload`。"

#. type: Bullet: '- '
#: ../src/guide/concept/autoloading.md
msgid "[PSR-4: Autoloader](https://www.php-fig.org/psr/psr-4/)."
msgstr ""
msgstr "[PSR-4: 自动加载器](https://www.php-fig.org/psr/psr-4/)。"

#. type: Bullet: '- '
#: ../src/guide/concept/autoloading.md
msgid "[Composer guide on autoloading](https://getcomposer.org/doc/01-basic-usage.md#autoloading)."
msgstr ""
msgstr "[Composer 自动加载指南](https://getcomposer.org/doc/01-basic-usage.md#autoloading)。"
Loading
Loading