diff --git a/locale/zh_CN/LC_MESSAGES/Behavioral/Memento/README.po b/locale/zh_CN/LC_MESSAGES/Behavioral/Memento/README.po index 913069a..fa2378c 100644 --- a/locale/zh_CN/LC_MESSAGES/Behavioral/Memento/README.po +++ b/locale/zh_CN/LC_MESSAGES/Behavioral/Memento/README.po @@ -1,4 +1,4 @@ -# +# msgid "" msgstr "" "Project-Id-Version: DesignPatternsPHP 1.0\n" @@ -19,67 +19,117 @@ msgstr "" msgid "Purpose" msgstr "" -#: ../../Behavioral/Memento/README.rst:7 -msgid "" -"Provide the ability to restore an object to its previous state (undo via " -"rollback)." -msgstr "" - -#: ../../Behavioral/Memento/README.rst:10 -msgid "" -"The memento pattern is implemented with three objects: the originator, a " -"caretaker and a memento. The originator is some object that has an internal " -"state. The caretaker is going to do something to the originator, but wants " -"to be able to undo the change. The caretaker first asks the originator for a" -" memento object. Then it does whatever operation (or sequence of operations)" -" it was going to do. To roll back to the state before the operations, it " -"returns the memento object to the originator. The memento object itself is " -"an opaque object (one which the caretaker cannot, or should not, change). " -"When using this pattern, care should be taken if the originator may change " -"other objects or resources - the memento pattern operates on a single " -"object." -msgstr "" - -#: ../../Behavioral/Memento/README.rst:23 +#: ../../Behavioral/Memento/README.rst:39 msgid "Examples" msgstr "" -#: ../../Behavioral/Memento/README.rst:25 +#: ../../Behavioral/Memento/README.rst:41 msgid "The seed of a pseudorandom number generator" msgstr "" -#: ../../Behavioral/Memento/README.rst:26 +#: ../../Behavioral/Memento/README.rst:42 msgid "The state in a finite state machine" msgstr "" -#: ../../Behavioral/Memento/README.rst:29 +#: ../../Behavioral/Memento/README.rst:46 msgid "UML Diagram" msgstr "" -#: ../../Behavioral/Memento/README.rst:36 +#: ../../Behavioral/Memento/README.rst:53 msgid "Code" msgstr "" -#: ../../Behavioral/Memento/README.rst:38 +#: ../../Behavioral/Memento/README.rst:55 msgid "You can also find these code on `GitHub`_" msgstr "" -#: ../../Behavioral/Memento/README.rst:40 +#: ../../Behavioral/Memento/README.rst:57 msgid "Memento.php" msgstr "" -#: ../../Behavioral/Memento/README.rst:46 +#: ../../Behavioral/Memento/README.rst:63 msgid "Originator.php" msgstr "" -#: ../../Behavioral/Memento/README.rst:52 +#: ../../Behavioral/Memento/README.rst:69 msgid "Caretaker.php" msgstr "" -#: ../../Behavioral/Memento/README.rst:59 +#: ../../Behavioral/Memento/README.rst:76 msgid "Test" msgstr "" -#: ../../Behavioral/Memento/README.rst:61 +#: ../../Behavioral/Memento/README.rst:78 msgid "Tests/MementoTest.php" msgstr "" + +#: ../../Behavioral/Memento/README.rst:7 +msgid "" +"It provides the ability to restore an object to it's previous state (undo " +"via rollback) or to gain access to state of the object, without revealing " +"it's implementation (i.e., the object is not required to have a functional " +"for return the current state)." +msgstr "" + +#: ../../Behavioral/Memento/README.rst:12 +msgid "" +"The memento pattern is implemented with three objects: the Originator, a " +"Caretaker and a Memento." +msgstr "" + +#: ../../Behavioral/Memento/README.rst:15 +msgid "" +"Memento – an object that *contains a concrete unique snapshot of state* of " +"any object or resource: string, number, array, an instance of class and so " +"on. The uniqueness in this case does not imply the prohibition existence of " +"similar states in different snapshots. That means the state can be extracted" +" as the independent clone. Any object stored in the Memento should be *a " +"full copy of the original object rather than a reference* to the original " +"object. The Memento object is a \"opaque object\" (the object that no one " +"can or should change)." +msgstr "" + +#: ../../Behavioral/Memento/README.rst:24 +msgid "" +"Originator – it is an object that contains the *actual state of an external " +"object is strictly specified type*. Originator is able to create a unique " +"copy of this state and return it wrapped in a Memento. The Originator does " +"not know the history of changes. You can set a concrete state to Originator " +"from the outside, which will be considered as actual. The Originator must " +"make sure that given state corresponds the allowed type of object. " +"Originator may (but not should) have any methods, but they *they can't make " +"changes to the saved object state*." +msgstr "" + +#: ../../Behavioral/Memento/README.rst:33 +msgid "" +"Caretaker *controls the states history*. He may make changes to an object; " +"take a decision to save the state of an external object in the Originator; " +"ask from the Originator snapshot of the current state; or set the Originator" +" state to equivalence with some snapshot from history." +msgstr "" + +#: ../../Behavioral/Memento/README.rst:43 +msgid "" +"Control for intermediate states of `ORM Model `_ before saving" +msgstr "" + +#~ msgid "" +#~ "Provide the ability to restore an object to its previous state (undo via " +#~ "rollback)." +#~ msgstr "" + +#~ msgid "" +#~ "The memento pattern is implemented with three objects: the originator, a " +#~ "caretaker and a memento. The originator is some object that has an internal " +#~ "state. The caretaker is going to do something to the originator, but wants " +#~ "to be able to undo the change. The caretaker first asks the originator for a" +#~ " memento object. Then it does whatever operation (or sequence of operations)" +#~ " it was going to do. To roll back to the state before the operations, it " +#~ "returns the memento object to the originator. The memento object itself is " +#~ "an opaque object (one which the caretaker cannot, or should not, change). " +#~ "When using this pattern, care should be taken if the originator may change " +#~ "other objects or resources - the memento pattern operates on a single " +#~ "object." +#~ msgstr "" diff --git a/locale/zh_CN/LC_MESSAGES/Creational/Multiton/README.po b/locale/zh_CN/LC_MESSAGES/Creational/Multiton/README.po index 7ce7048..d187f1b 100644 --- a/locale/zh_CN/LC_MESSAGES/Creational/Multiton/README.po +++ b/locale/zh_CN/LC_MESSAGES/Creational/Multiton/README.po @@ -1,4 +1,4 @@ -# +# msgid "" msgstr "" "Project-Id-Version: DesignPatternsPHP 1.0\n" @@ -19,8 +19,7 @@ msgstr "多例" msgid "" "**THIS IS CONSIDERED TO BE AN ANTI-PATTERN! FOR BETTER TESTABILITY AND " "MAINTAINABILITY USE DEPENDENCY INJECTION!**" -msgstr "" -"**多例模式已经被考虑列入到反模式中!请使用依赖注入获得更好的代码可测试性和可控性!**" +msgstr "**多例模式已经被考虑列入到反模式中!请使用依赖注入获得更好的代码可测试性和可控性!**" #: ../../Creational/Multiton/README.rst:8 msgid "Purpose" @@ -61,5 +60,6 @@ msgid "Multiton.php" msgstr "" #: ../../Creational/Multiton/README.rst:38 -msgid "测试" -msgstr "" +msgid "Test" +msgstr "测试" + diff --git a/locale/zh_CN/LC_MESSAGES/More/Delegation/README.po b/locale/zh_CN/LC_MESSAGES/More/Delegation/README.po index 169e8fd..0b52512 100644 --- a/locale/zh_CN/LC_MESSAGES/More/Delegation/README.po +++ b/locale/zh_CN/LC_MESSAGES/More/Delegation/README.po @@ -1,4 +1,4 @@ -# +# msgid "" msgstr "" "Project-Id-Version: DesignPatternsPHP 1.0\n" @@ -19,10 +19,6 @@ msgstr "" msgid "Purpose" msgstr "" -#: ../../More/Delegation/README.rst:7 ../../More/Delegation/README.rst:12 -msgid "..." -msgstr "" - #: ../../More/Delegation/README.rst:10 msgid "Examples" msgstr "" @@ -58,3 +54,22 @@ msgstr "" #: ../../More/Delegation/README.rst:47 msgid "Tests/DelegationTest.php" msgstr "" + +#: ../../More/Delegation/README.rst:7 +msgid "" +"Demonstrate the Delegator pattern, where an object, instead of performing " +"one of its stated tasks, delegates that task to an associated helper object." +" In this case TeamLead professes to writeCode and Usage uses this, while " +"TeamLead delegates writeCode to JuniorDeveloper's writeBadCode function. " +"This inverts the responsibility so that Usage is unknowingly executing " +"writeBadCode." +msgstr "" + +#: ../../More/Delegation/README.rst:12 +msgid "" +"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to see " +"it all tied together." +msgstr "" + +#~ msgid "..." +#~ msgstr "" diff --git a/locale/zh_CN/LC_MESSAGES/Structural/Adapter/README.po b/locale/zh_CN/LC_MESSAGES/Structural/Adapter/README.po index b351fc9..99ac6ec 100644 --- a/locale/zh_CN/LC_MESSAGES/Structural/Adapter/README.po +++ b/locale/zh_CN/LC_MESSAGES/Structural/Adapter/README.po @@ -13,11 +13,11 @@ msgstr "" #: ../../Structural/Adapter/README.rst:2 msgid "`Adapter / Wrapper`__" -msgstr "" +msgstr "`适配器模式`__" #: ../../Structural/Adapter/README.rst:5 msgid "Purpose" -msgstr "" +msgstr "目的" #: ../../Structural/Adapter/README.rst:7 msgid "" @@ -26,32 +26,36 @@ msgid "" "incompatible interfaces by providing it's interface to clients while using " "the original interface." msgstr "" +"将某个类的接口转换成与另一个接口兼容。适配器通过将原始接口进行转换,给用户" +"提供一个兼容接口,使得原来因为接口不同而无法一起使用的类可以得到兼容。" #: ../../Structural/Adapter/README.rst:13 msgid "Examples" -msgstr "" +msgstr "例子" #: ../../Structural/Adapter/README.rst:15 msgid "DB Client libraries adapter" -msgstr "" +msgstr "数据库客户端库适配器" #: ../../Structural/Adapter/README.rst:16 msgid "" "using multiple different webservices and adapters normalize data so that the" " outcome is the same for all" msgstr "" +"使用不同的webservices,通过适配器来标准化输出数据,从而保证不同webservice输出的" +"数据是一致的" #: ../../Structural/Adapter/README.rst:20 msgid "UML Diagram" -msgstr "" +msgstr "UML 图" #: ../../Structural/Adapter/README.rst:27 msgid "Code" -msgstr "" +msgstr "代码" #: ../../Structural/Adapter/README.rst:29 msgid "You can also find these code on `GitHub`_" -msgstr "" +msgstr "你可以在 `GitHub`_ 上找到这些代码" #: ../../Structural/Adapter/README.rst:31 msgid "PaperBookInterface.php" @@ -75,7 +79,7 @@ msgstr "" #: ../../Structural/Adapter/README.rst:62 msgid "Test" -msgstr "" +msgstr "测试" #: ../../Structural/Adapter/README.rst:64 msgid "Tests/AdapterTest.php" diff --git a/locale/zh_CN/LC_MESSAGES/Structural/Bridge/README.po b/locale/zh_CN/LC_MESSAGES/Structural/Bridge/README.po index a27619b..54266dc 100644 --- a/locale/zh_CN/LC_MESSAGES/Structural/Bridge/README.po +++ b/locale/zh_CN/LC_MESSAGES/Structural/Bridge/README.po @@ -13,21 +13,22 @@ msgstr "" #: ../../Structural/Bridge/README.rst:2 msgid "`Bridge`__" -msgstr "" +msgstr "`桥接模式`__" #: ../../Structural/Bridge/README.rst:5 msgid "Purpose" -msgstr "" +msgstr "目的" #: ../../Structural/Bridge/README.rst:7 msgid "" "Decouple an abstraction from its implementation so that the two can vary " "independently." msgstr "" +"解耦一个对象的实现与抽象,这样两者可以独立地变化。" #: ../../Structural/Bridge/README.rst:11 msgid "Sample:" -msgstr "" +msgstr "例子" #: ../../Structural/Bridge/README.rst:13 msgid "`Symfony DoctrineBridge `__" @@ -35,15 +36,15 @@ msgstr "" #: ../../Structural/Bridge/README.rst:17 msgid "UML Diagram" -msgstr "" +msgstr "UML 图" #: ../../Structural/Bridge/README.rst:24 msgid "Code" -msgstr "" +msgstr "代码" #: ../../Structural/Bridge/README.rst:26 msgid "You can also find these code on `GitHub`_" -msgstr "" +msgstr "你可以在 `GitHub`_ 上找到这些代码" #: ../../Structural/Bridge/README.rst:28 msgid "Workshop.php" @@ -71,7 +72,7 @@ msgstr "" #: ../../Structural/Bridge/README.rst:65 msgid "Test" -msgstr "" +msgstr "测试" #: ../../Structural/Bridge/README.rst:67 msgid "Tests/BridgeTest.php" diff --git a/locale/zh_CN/LC_MESSAGES/Structural/Composite/README.po b/locale/zh_CN/LC_MESSAGES/Structural/Composite/README.po index 90ddd21..8c615d0 100644 --- a/locale/zh_CN/LC_MESSAGES/Structural/Composite/README.po +++ b/locale/zh_CN/LC_MESSAGES/Structural/Composite/README.po @@ -13,45 +13,49 @@ msgstr "" #: ../../Structural/Composite/README.rst:2 msgid "`Composite`__" -msgstr "" +msgstr "`组合模式`__" #: ../../Structural/Composite/README.rst:5 msgid "Purpose" -msgstr "" +msgstr "目的" #: ../../Structural/Composite/README.rst:7 msgid "" "To treat a group of objects the same way as a single instance of the object." -msgstr "" +msgstr "以单个对象的方式来对待一组对象" #: ../../Structural/Composite/README.rst:11 msgid "Examples" -msgstr "" +msgstr "例子" #: ../../Structural/Composite/README.rst:13 msgid "" "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 " "its child elements and calls ``render()`` on them" -msgstr "" +msgstr "" +"form类的实例包含多个子元素,而它也像单个子元素那样响应render()请求,当" +"调用``render()``方法时,它会历遍所有的子元素,调用``render()``方法" #: ../../Structural/Composite/README.rst:16 msgid "" "``Zend_Config``: a tree of configuration options, each one is a " "``Zend_Config`` object itself" msgstr "" +"``Zend_Config``: 配置选项树, 其每一个分支都是 " +"``Zend_Config`` 对象" #: ../../Structural/Composite/README.rst:20 msgid "UML Diagram" -msgstr "" +msgstr "UML 图" #: ../../Structural/Composite/README.rst:27 msgid "Code" -msgstr "" +msgstr "代码" #: ../../Structural/Composite/README.rst:29 msgid "You can also find these code on `GitHub`_" -msgstr "" +msgstr "你可以在 `GitHub`_ 上找到这些代码" #: ../../Structural/Composite/README.rst:31 msgid "FormElement.php" @@ -71,7 +75,7 @@ msgstr "" #: ../../Structural/Composite/README.rst:56 msgid "Test" -msgstr "" +msgstr "测试" #: ../../Structural/Composite/README.rst:58 msgid "Tests/CompositeTest.php" diff --git a/locale/zh_CN/LC_MESSAGES/Structural/DataMapper/README.po b/locale/zh_CN/LC_MESSAGES/Structural/DataMapper/README.po index 5ccd9a3..1dca56f 100644 --- a/locale/zh_CN/LC_MESSAGES/Structural/DataMapper/README.po +++ b/locale/zh_CN/LC_MESSAGES/Structural/DataMapper/README.po @@ -13,11 +13,11 @@ msgstr "" #: ../../Structural/DataMapper/README.rst:2 msgid "`Data Mapper`__" -msgstr "" +msgstr "`数据映射器`__" #: ../../Structural/DataMapper/README.rst:5 msgid "Purpose" -msgstr "" +msgstr "目的" #: ../../Structural/DataMapper/README.rst:7 msgid "" @@ -31,34 +31,42 @@ msgid "" "many different domain entity types, dedicated mappers will handle one or a " "few." msgstr "" +"数据映射器是一个数据访问层,用于将数据在持久性数据存储(通常是一个关系数据库)" +"和内存中的数据表示(领域层)之间进行相互转换。其目的是为了将数据的内存表示、持久存储、" +"数据访问进行分离。该层由一个或者多个映射器组成(或者数据访问对象),并且进行数据的转换。" +"映射器的实现在范围上有所不同。通用映射器将处理许多不同领域的实体类型," +"而专用映射器将处理一个或几个。" #: ../../Structural/DataMapper/README.rst:17 msgid "" "The key point of this pattern is, unlike Active Record pattern, the data " "model follows Single Responsibility Principle." msgstr "" +"此模式的主要特点是,与Active Record不同,其数据模式遵循单一职责原则" +"(Single Responsibility Principle)。" #: ../../Structural/DataMapper/README.rst:21 msgid "Examples" -msgstr "" +msgstr "例子" #: ../../Structural/DataMapper/README.rst:23 msgid "" "DB Object Relational Mapper (ORM) : Doctrine2 uses DAO named as " "\"EntityRepository\"" msgstr "" - +"DB Object Relational Mapper (ORM) : Doctrine2 使用 DAO " +"\"EntityRepository\" 作为DAO" #: ../../Structural/DataMapper/README.rst:27 msgid "UML Diagram" -msgstr "" +msgstr "UML 图" #: ../../Structural/DataMapper/README.rst:34 msgid "Code" -msgstr "" +msgstr "代码" #: ../../Structural/DataMapper/README.rst:36 msgid "You can also find these code on `GitHub`_" -msgstr "" +msgstr "你可以在 `GitHub`_ 上找到这些代码" #: ../../Structural/DataMapper/README.rst:38 msgid "User.php" @@ -70,7 +78,7 @@ msgstr "" #: ../../Structural/DataMapper/README.rst:51 msgid "Test" -msgstr "" +msgstr "测试" #: ../../Structural/DataMapper/README.rst:53 msgid "Tests/DataMapperTest.php" diff --git a/locale/zh_CN/LC_MESSAGES/Structural/DependencyInjection/README.po b/locale/zh_CN/LC_MESSAGES/Structural/DependencyInjection/README.po index 5111f59..426e487 100644 --- a/locale/zh_CN/LC_MESSAGES/Structural/DependencyInjection/README.po +++ b/locale/zh_CN/LC_MESSAGES/Structural/DependencyInjection/README.po @@ -13,7 +13,7 @@ msgstr "" #: ../../Structural/DependencyInjection/README.rst:2 msgid "`Dependency Injection`__" -msgstr "`依赖注入`__" +msgstr "`依赖注入`" #: ../../Structural/DependencyInjection/README.rst:5 msgid "Purpose" diff --git a/locale/zh_CN/LC_MESSAGES/Structural/Registry/README.po b/locale/zh_CN/LC_MESSAGES/Structural/Registry/README.po index 843138c..636207b 100644 --- a/locale/zh_CN/LC_MESSAGES/Structural/Registry/README.po +++ b/locale/zh_CN/LC_MESSAGES/Structural/Registry/README.po @@ -1,4 +1,4 @@ -# +# msgid "" msgstr "" "Project-Id-Version: DesignPatternsPHP 1.0\n" @@ -30,12 +30,6 @@ msgstr "" msgid "Examples" msgstr "" -#: ../../Structural/Registry/README.rst:14 -msgid "" -"Zend Framework: ``Zend_Registry`` holds the application's logger object, " -"front controller etc." -msgstr "" - #: ../../Structural/Registry/README.rst:16 msgid "" "Yii Framework: ``CWebApplication`` holds all the application components, " @@ -65,3 +59,14 @@ msgstr "" #: ../../Structural/Registry/README.rst:40 msgid "Tests/RegistryTest.php" msgstr "" + +#: ../../Structural/Registry/README.rst:14 +msgid "" +"Zend Framework 1: ``Zend_Registry`` holds the application's logger object, " +"front controller etc." +msgstr "" + +#~ msgid "" +#~ "Zend Framework: ``Zend_Registry`` holds the application's logger object, " +#~ "front controller etc." +#~ msgstr ""