mirror of
https://github.com/DesignPatternsPHP/DesignPatternsPHP.git
synced 2025-07-28 18:50:11 +02:00
fix: typo
This commit is contained in:
@@ -24,10 +24,9 @@ msgstr "目的"
|
|||||||
|
|
||||||
#: ../../Creational/AbstractFactory/README.rst:7
|
#: ../../Creational/AbstractFactory/README.rst:7
|
||||||
msgid ""
|
msgid ""
|
||||||
"To create series of related or dependent objects without specifying their "
|
"To create series of related or dependent objects without specifying their concrete classes. Usually "
|
||||||
"concrete classes. Usually the created classes all implement the same "
|
"the created classes all implement the same interface. The client of the abstract factory does not "
|
||||||
"interface. The client of the abstract factory does not care about how these "
|
"care about how these objects are created, it just knows how they go together."
|
||||||
"objects are created, he just knows how they go together."
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"创建一系列互相关联或依赖的对象时不需要指定将要创建的对象对应的类,因为这些将被创建的对象对应的类都实现了同一个接口。"
|
"创建一系列互相关联或依赖的对象时不需要指定将要创建的对象对应的类,因为这些将被创建的对象对应的类都实现了同一个接口。"
|
||||||
"抽象工厂的使用者不需要关心对象的创建过程,它只需要知道这些对象是如何协调工作的。"
|
"抽象工厂的使用者不需要关心对象的创建过程,它只需要知道这些对象是如何协调工作的。"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||||
@@ -21,13 +21,13 @@ msgstr "目的"
|
|||||||
|
|
||||||
#: ../../Creational/FactoryMethod/README.rst:7
|
#: ../../Creational/FactoryMethod/README.rst:7
|
||||||
msgid ""
|
msgid ""
|
||||||
"The good point over the SimpleFactory is you can subclass it to implement "
|
"The good point over the SimpleFactory is you can subclass it to implement different ways to create "
|
||||||
"different ways to create objects"
|
"objects."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"比简单工厂模式好的一点是工厂方法可以通过继承实现不同的创建对象的逻辑。"
|
"比简单工厂模式好的一点是工厂方法可以通过继承实现不同的创建对象的逻辑。"
|
||||||
|
|
||||||
#: ../../Creational/FactoryMethod/README.rst:10
|
#: ../../Creational/FactoryMethod/README.rst:10
|
||||||
msgid "For simple case, this abstract class could be just an interface"
|
msgid "For simple cases, this abstract class could be just an interface."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"举个简单的例子,这些抽象类都仅仅是一个接口"
|
"举个简单的例子,这些抽象类都仅仅是一个接口"
|
||||||
|
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||||
@@ -28,7 +28,7 @@ msgid ""
|
|||||||
"``factory`` or ``build``."
|
"``factory`` or ``build``."
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"和抽象工厂类似,静态工厂模式用来创建一系列互相关联或依赖的对象,和抽象工厂模式不同的是静态工厂"
|
"和抽象工厂类似,静态工厂模式用来创建一系列互相关联或依赖的对象,和抽象工厂模式不同的是静态工厂"
|
||||||
"模式只用一个静态方法就解决了所有类型的对象创建,通常被命名为``工厂`` 或者 ``构建器``"
|
"模式只用一个静态方法就解决了所有类型的对象创建,通常被命名为 ``工厂`` 或者 ``构建器``"
|
||||||
|
|
||||||
#: ../../Creational/StaticFactory/README.rst:20
|
#: ../../Creational/StaticFactory/README.rst:20
|
||||||
msgid "UML Diagram"
|
msgid "UML Diagram"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||||
@@ -33,9 +33,9 @@ msgid ""
|
|||||||
"a form class instance handles all its form elements like a single instance "
|
"a form class instance handles all its form elements like a single instance "
|
||||||
"of the form, when ``render()`` is called, it subsequently runs through all "
|
"of the form, when ``render()`` is called, it subsequently runs through all "
|
||||||
"its child elements and calls ``render()`` on them"
|
"its child elements and calls ``render()`` on them"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"form类的实例包含多个子元素,而它也像单个子元素那样响应render()请求,当"
|
"form类的实例包含多个子元素,而它也像单个子元素那样响应render()请求,当"
|
||||||
"调用``render()``方法时,它会历遍所有的子元素,调用``render()``方法"
|
"调用 ``render()`` 方法时,它会历遍所有的子元素,调用 ``render()`` 方法"
|
||||||
|
|
||||||
#: ../../Structural/Composite/README.rst:20
|
#: ../../Structural/Composite/README.rst:20
|
||||||
msgid "UML Diagram"
|
msgid "UML Diagram"
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||||
@@ -31,13 +31,12 @@ msgstr "用例"
|
|||||||
|
|
||||||
#: ../../Structural/DependencyInjection/README.rst:13
|
#: ../../Structural/DependencyInjection/README.rst:13
|
||||||
msgid ""
|
msgid ""
|
||||||
"Configuration gets injected and ``Connection`` will get all that it needs "
|
"``DatabaseConfiguration`` gets injected and ``DatabaseConnection`` will get all that it needs from "
|
||||||
"from ``$config``. Without DI, the configuration would be created directly in"
|
"``$config``. Without DI, the configuration would be created directly in ``DatabaseConnection``, which is "
|
||||||
" ``Connection``, which is not very good for testing and extending "
|
"not very good for testing and extending it."
|
||||||
"``Connection``."
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"通过配置需要注入的依赖,``Connection`` 能从 ``$config`` 中获取到所有它需要的依赖。如果没有"
|
"通过配置需要注入的依赖,``Connection`` 能从 ``$config`` 中获取到所有它需要的依赖。如果没有"
|
||||||
"依赖注入,``Connection`` 会直接创建它需要的依赖,这样不利于测试和扩展``Connection``。"
|
"依赖注入,``Connection`` 会直接创建它需要的依赖,这样不利于测试和扩展 ``Connection``。"
|
||||||
|
|
||||||
#: ../../Structural/DependencyInjection/README.rst:18
|
#: ../../Structural/DependencyInjection/README.rst:18
|
||||||
msgid ""
|
msgid ""
|
||||||
@@ -65,7 +64,7 @@ msgid ""
|
|||||||
"``Connection`` object"
|
"``Connection`` object"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Doctrine2 ORM 使用了依赖注入,它通过配置注入了 ``Connection`` 对象。为了达到方便测试的目的,"
|
"Doctrine2 ORM 使用了依赖注入,它通过配置注入了 ``Connection`` 对象。为了达到方便测试的目的,"
|
||||||
"可以很容易的通过配置创建一个mock的``Connection`` 对象。"
|
"可以很容易的通过配置创建一个mock的 ``Connection`` 对象。"
|
||||||
|
|
||||||
#: ../../Structural/DependencyInjection/README.rst:32
|
#: ../../Structural/DependencyInjection/README.rst:32
|
||||||
msgid ""
|
msgid ""
|
||||||
|
@@ -1,4 +1,4 @@
|
|||||||
#
|
#
|
||||||
msgid ""
|
msgid ""
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
"Project-Id-Version: DesignPatternsPHP 1.0\n"
|
||||||
@@ -21,9 +21,8 @@ msgstr "目的"
|
|||||||
|
|
||||||
#: ../../Structural/Facade/README.rst:7
|
#: ../../Structural/Facade/README.rst:7
|
||||||
msgid ""
|
msgid ""
|
||||||
"The primary goal of a Facade Pattern is not to avoid you having to read the"
|
"The primary goal of a Facade Pattern is not to avoid you having to read the manual of a complex "
|
||||||
"manual of a complex API. It's only a side-effect. The first goal is to"
|
"API. It's only a side-effect. The first goal is to reduce coupling and follow the Law of Demeter."
|
||||||
"reduce coupling and follow the Law of Demeter."
|
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"外观模式的目的不是为了让你避免阅读烦人的API文档(当然,它有这样的作用),"
|
"外观模式的目的不是为了让你避免阅读烦人的API文档(当然,它有这样的作用),"
|
||||||
"它的主要目的是为了减少耦合并且遵循得墨忒耳定律(Law of Demeter)"
|
"它的主要目的是为了减少耦合并且遵循得墨忒耳定律(Law of Demeter)"
|
||||||
|
@@ -21,9 +21,10 @@ msgstr "目的"
|
|||||||
|
|
||||||
#: ../../Structural/Registry/README.rst:7
|
#: ../../Structural/Registry/README.rst:7
|
||||||
msgid ""
|
msgid ""
|
||||||
"To implement a central storage for objects often used throughout the "
|
"To implement a central storage for objects often used throughout the application, is typically "
|
||||||
"application, is typically implemented using an abstract class with only "
|
"implemented using an abstract class with only static methods (or using the Singleton pattern). "
|
||||||
"static methods (or using the Singleton pattern)"
|
"Remember that this introduces global state, which should be avoided at all times! Instead "
|
||||||
|
"implement it using Dependency Injection!"
|
||||||
msgstr ""
|
msgstr ""
|
||||||
"为应用中常用的对象实现一个中央存储,通常用一个只有静态方法的抽象类来实现"
|
"为应用中常用的对象实现一个中央存储,通常用一个只有静态方法的抽象类来实现"
|
||||||
"(或者使用单例模式)"
|
"(或者使用单例模式)"
|
||||||
|
Reference in New Issue
Block a user