Merge pull request #469 from autoload/main

docs: add Chinese translation of Interpreter Pattern
This commit is contained in:
Dominik Liebler
2021-11-15 20:11:55 +01:00
committed by GitHub
14 changed files with 210 additions and 103 deletions

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"

View File

@@ -51,11 +51,9 @@ msgstr "例子"
#: ../../Behavioral/Command/README.rst:23 #: ../../Behavioral/Command/README.rst:23
msgid "" msgid ""
"A text editor : all events are Command which can be undone, stacked and " "A text editor : all events are commands which can be undone, stacked and saved."
"saved."
msgstr "" msgstr ""
"文本编辑器:所有事件都可以撤销、堆放、保存的" "文本编辑器:所有事件都可以撤销、堆放、保存的命令。"
"命令。"
#: ../../Behavioral/Command/README.rst:27 #: ../../Behavioral/Command/README.rst:27
msgid "" msgid ""

View File

@@ -0,0 +1,55 @@
#
msgid ""
msgstr ""
"Project-Id-Version: DesignPatternsPHP 1.0\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#: ../../Behavioral/Interpreter/README.rst:2
msgid "`Interpreter`__"
msgstr "`解释器模式`__"
#: ../../Behavioral/Interpreter/README.rst:5
msgid "Purpose"
msgstr "目的"
#: ../../Behavioral/Interpreter/README.rst:7
msgid ""
"For a given language, it defines the representation of its grammar as "
"\"No Terminal Expression" and \"Terminal Expression", "
"as well as an interpreter for the sentences of that language."
msgstr ""
"对于给定的语言,它定义了其语法的表示为【非终结符表达式】和【终结符达式】,"
"以及改语言的句子解释器。"
#: ../../Behavioral/Interpreter/README.rst:12
msgid "Examples"
msgstr "例子"
#: ../../Behavioral/Interpreter/README.rst:14
msgid ""
"An example of a binary logic interpreter, each definition is defined by its own class"
msgstr ""
"一个二进制逻辑解释器的例子,每个定义都是由它自己的类定义的"
#: ../../Behavioral/Interpreter/README.rst:17
msgid "UML Diagram"
msgstr "UML 图"
#: ../../Behavioral/Interpreter/README.rst:24
msgid "Code"
msgstr "代码"
#: ../../Behavioral/Interpreter/README.rst:26
msgid "You can also find this code on `GitHub`_"
msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/Interpreter/README.rst:62
msgid "Test"
msgstr "测试"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -13,18 +13,18 @@ msgstr ""
#: ../../Behavioral/Iterator/README.rst:2 #: ../../Behavioral/Iterator/README.rst:2
msgid "`Iterator`__" msgid "`Iterator`__"
msgstr "" msgstr "`迭代器模式`__"
#: ../../Behavioral/Iterator/README.rst:5 #: ../../Behavioral/Iterator/README.rst:5
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/Iterator/README.rst:7 #: ../../Behavioral/Iterator/README.rst:7
msgid "To make an object iterable and to make it appear like a collection of objects." msgid "To make an object iterable and to make it appear like a collection of objects."
msgstr "" msgstr "使一个对象可迭代,并使它看起来像对象集合。"
#: ../../Behavioral/Iterator/README.rst:11 #: ../../Behavioral/Iterator/README.rst:11
msgid "Examples" msgid "例子"
msgstr "" msgstr ""
#: ../../Behavioral/Iterator/README.rst:13 #: ../../Behavioral/Iterator/README.rst:13
@@ -32,10 +32,11 @@ msgid ""
"to process a file line by line by just running over all lines (which have an" "to process a file line by line by just running over all lines (which have an"
" object representation) for a file (which of course is an object, too)" " object representation) for a file (which of course is an object, too)"
msgstr "" msgstr ""
"通过遍历文件的所有行(对象表现形式的)来逐行处理文件(也是对象)"
#: ../../Behavioral/Iterator/README.rst:18 #: ../../Behavioral/Iterator/README.rst:18
msgid "Note" msgid "Note"
msgstr "" msgstr "注意"
#: ../../Behavioral/Iterator/README.rst:20 #: ../../Behavioral/Iterator/README.rst:20
msgid "" msgid ""
@@ -43,19 +44,21 @@ msgid ""
"suited for this! Often you would want to implement the Countable interface " "suited for this! Often you would want to implement the Countable interface "
"too, to allow ``count($object)`` on your iterable object" "too, to allow ``count($object)`` on your iterable object"
msgstr "" msgstr ""
"标准PHP库(SPL)定义了一个最适合这种模式的接口迭代器! "
"通常也要实现Countable接口允许在iterable对象上使用count($object)"
#: ../../Behavioral/Iterator/README.rst:25 #: ../../Behavioral/Iterator/README.rst:25
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/Iterator/README.rst:32 #: ../../Behavioral/Iterator/README.rst:32
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/Iterator/README.rst:34 #: ../../Behavioral/Iterator/README.rst:34
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/Iterator/README.rst:61 #: ../../Behavioral/Iterator/README.rst:61
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -13,11 +13,11 @@ msgstr ""
#: ../../Behavioral/Mediator/README.rst:2 #: ../../Behavioral/Mediator/README.rst:2
msgid "`Mediator`__" msgid "`Mediator`__"
msgstr "" msgstr "`中介者模式`__"
#: ../../Behavioral/Mediator/README.rst:5 #: ../../Behavioral/Mediator/README.rst:5
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/Mediator/README.rst:7 #: ../../Behavioral/Mediator/README.rst:7
msgid "" msgid ""
@@ -25,6 +25,9 @@ msgid ""
"together. It is a good alternative to Observer IF you have a \"central " "together. It is a good alternative to Observer IF you have a \"central "
"intelligence\", like a controller (but not in the sense of the MVC)." "intelligence\", like a controller (but not in the sense of the MVC)."
msgstr "" msgstr ""
"这种模式提供了一种简单的解耦多组件之间的协同工作方式。"
"如果你有一个“智能中心”,比如控制器(但不是 MVC 的意义上),"
"它是观察者的一个很好的替代品。"
#: ../../Behavioral/Mediator/README.rst:11 #: ../../Behavioral/Mediator/README.rst:11
msgid "" msgid ""
@@ -32,19 +35,22 @@ msgid ""
"and it is a good thing because in OOP, one good friend is better than many. " "and it is a good thing because in OOP, one good friend is better than many. "
"This is the key-feature of this pattern." "This is the key-feature of this pattern."
msgstr "" msgstr ""
"所有组件(称为同事)仅与 Mediator 接口耦合,"
"这是一件好事,因为在 OOP 中,一个好朋友胜过多个。"
"这是这种模式的关键特征。"
#: ../../Behavioral/Mediator/README.rst:16 #: ../../Behavioral/Mediator/README.rst:16
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/Mediator/README.rst:23 #: ../../Behavioral/Mediator/README.rst:23
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/Mediator/README.rst:25 #: ../../Behavioral/Mediator/README.rst:25
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/Mediator/README.rst:64 #: ../../Behavioral/Mediator/README.rst:64
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"

View File

@@ -11,7 +11,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2016-06-03 23:59+0200\n" "POT-Creation-Date: 2016-06-03 23:59+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=utf-8\n" "Content-Type: text/plain; charset=utf-8\n"
@@ -20,25 +20,28 @@ msgstr ""
#: ../../Behavioral/Memento/README.rst:2 #: ../../Behavioral/Memento/README.rst:2
msgid "`Memento`__" msgid "`Memento`__"
msgstr "" msgstr "`备忘录模式`__"
#: ../../Behavioral/Memento/README.rst:5 #: ../../Behavioral/Memento/README.rst:5
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/Memento/README.rst:7 #: ../../Behavioral/Memento/README.rst:7
msgid "" msgid ""
"It provides the ability to restore an object to it's previous state (undo" "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 " "via rollback) or to gain access to state of the object, without revealing "
"revealing it's implementation (i.e., the object is not required to have a" "it's implementation (i.e., the object is not required to have a function "
" functional for return the current state)." "to return the current state)."
msgstr "" msgstr ""
"它提供了将对象恢复到之前状态(通过回滚撤销)或访问对象状态的能力,"
"而不需要揭示它的实现(对象不需要具有返回当前状态的函数)。"
#: ../../Behavioral/Memento/README.rst:12 #: ../../Behavioral/Memento/README.rst:12
msgid "" msgid ""
"The memento pattern is implemented with three objects: the Originator, a " "The memento pattern is implemented with three objects: the Originator, a "
"Caretaker and a Memento." "Caretaker and a Memento."
msgstr "" msgstr ""
"memento模式由三个对象实现Originator, Caretaker, Memento。"
#: ../../Behavioral/Memento/README.rst:15 #: ../../Behavioral/Memento/README.rst:15
msgid "" msgid ""
@@ -51,6 +54,11 @@ msgid ""
"reference* to the original object. The Memento object is a \"opaque " "reference* to the original object. The Memento object is a \"opaque "
"object\" (the object that no one can or should change)." "object\" (the object that no one can or should change)."
msgstr "" msgstr ""
"Memento 包含任何对象或资源状态的具体唯一快照的对象:字符串、数字、数组、"
"类的实例等。 这种情况下的唯一性并不意味着禁止在不同的快照中存在相似的状态。 "
"这意味着可以将状态提取为独立克隆。 存储在 Memento 中的任何对象都应该是原始对"
"象的完整副本,而不是对原始对象的引用。 Memento 对象是一个“不透明对象”"
"(没有人可以或不应该更改的对象)。"
#: ../../Behavioral/Memento/README.rst:24 #: ../../Behavioral/Memento/README.rst:24
msgid "" msgid ""
@@ -63,6 +71,11 @@ msgid ""
"type of object. Originator may (but not should) have any methods, but " "type of object. Originator may (but not should) have any methods, but "
"they *they can't make changes to the saved object state*." "they *they can't make changes to the saved object state*."
msgstr "" msgstr ""
"Originator—它是一个包含外部对象实际状态的对象是严格指定的类型。"
"Originator能够创建此状态的唯一副本并将其包裹在Memento中返回。 "
"Originator不知道变化的历史。 您可以从外部将具体状态设置为Originator"
"这将被视为实际状态。 Originator必须确保给定的状态对应于允许的对象类型。"
"Originator可能但不应该有任何方法但他们不能对保存的对象状态进行更改。"
#: ../../Behavioral/Memento/README.rst:33 #: ../../Behavioral/Memento/README.rst:33
msgid "" msgid ""
@@ -71,38 +84,41 @@ msgid ""
"Originator; ask from the Originator snapshot of the current state; or set" "Originator; ask from the Originator snapshot of the current state; or set"
" the Originator state to equivalence with some snapshot from history." " the Originator state to equivalence with some snapshot from history."
msgstr "" msgstr ""
"Caretaker控制着状态的历史。 他可以对一个对象进行更改; 决定在Originator中保存外部对象的状态"
"从当前状态的Originator快照中询问 或将Originator状态设置为与历史记录中的某些快照等效。"
#: ../../Behavioral/Memento/README.rst:39 #: ../../Behavioral/Memento/README.rst:39
msgid "Examples" msgid "Examples"
msgstr "" msgstr "例子"
#: ../../Behavioral/Memento/README.rst:41 #: ../../Behavioral/Memento/README.rst:41
msgid "The seed of a pseudorandom number generator" msgid "The seed of a pseudorandom number generator"
msgstr "" msgstr "发送一个随机数"
#: ../../Behavioral/Memento/README.rst:42 #: ../../Behavioral/Memento/README.rst:42
msgid "The state in a finite state machine" msgid "The state in a finite state machine"
msgstr "" msgstr "并将这个随机数存在时序机中"
#: ../../Behavioral/Memento/README.rst:43 #: ../../Behavioral/Memento/README.rst:43
msgid "" msgid ""
"Control for intermediate states of `ORM Model " "Control for intermediate states of `ORM Model "
"<http://en.wikipedia.org/wiki/Object-relational_mapping>`_ before saving" "<http://en.wikipedia.org/wiki/Object-relational_mapping>`_ before saving"
msgstr "" msgstr ""
"保存之前控制 ORM Model 中的状态"
#: ../../Behavioral/Memento/README.rst:46 #: ../../Behavioral/Memento/README.rst:46
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/Memento/README.rst:53 #: ../../Behavioral/Memento/README.rst:53
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/Memento/README.rst:55 #: ../../Behavioral/Memento/README.rst:55
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/Memento/README.rst:76 #: ../../Behavioral/Memento/README.rst:76
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -13,29 +13,30 @@ msgstr ""
#: ../../Behavioral/NullObject/README.rst:2 #: ../../Behavioral/NullObject/README.rst:2
msgid "`Null Object`__" msgid "`Null Object`__"
msgstr "" msgstr "`空对象模式`__"
#: ../../Behavioral/NullObject/README.rst:5 #: ../../Behavioral/NullObject/README.rst:5
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/NullObject/README.rst:7 #: ../../Behavioral/NullObject/README.rst:7
msgid "" msgid ""
"NullObject is not a GoF design pattern but a schema which appears frequently" "NullObject is not a GoF design pattern but a schema which appears frequently"
" enough to be considered a pattern. It has the following benefits:" " enough to be considered a pattern. It has the following benefits:"
msgstr "" msgstr ""
"空对象模式不是一个GoF设计模式但是它出现非常频繁足以被认为是设计模式。它的好处如下"
#: ../../Behavioral/NullObject/README.rst:11 #: ../../Behavioral/NullObject/README.rst:11
msgid "Client code is simplified" msgid "Client code is simplified"
msgstr "" msgstr "简化客户端代码"
#: ../../Behavioral/NullObject/README.rst:12 #: ../../Behavioral/NullObject/README.rst:12
msgid "Reduces the chance of null pointer exceptions" msgid "Reduces the chance of null pointer exceptions"
msgstr "" msgstr "减少空指针异常的次数"
#: ../../Behavioral/NullObject/README.rst:13 #: ../../Behavioral/NullObject/README.rst:13
msgid "Fewer conditionals require less test cases" msgid "Fewer conditionals require less test cases"
msgstr "" msgstr "减少测试用例的复杂性"
#: ../../Behavioral/NullObject/README.rst:15 #: ../../Behavioral/NullObject/README.rst:15
msgid "" msgid ""
@@ -45,35 +46,38 @@ msgid ""
"``$obj->callSomething();`` by eliminating the conditional check in client " "``$obj->callSomething();`` by eliminating the conditional check in client "
"code." "code."
msgstr "" msgstr ""
"返回一个对象或null的方法应该返回一个对象或NullObject。NullObjects简化了样板代码"
"如if (!is_null($obj)) {$obj->callSomething();}只需要$obj->callSomething();"
"通过消除客户端代码中的条件签入。"
#: ../../Behavioral/NullObject/README.rst:22 #: ../../Behavioral/NullObject/README.rst:22
msgid "Examples" msgid "Examples"
msgstr "" msgstr "例子"
#: ../../Behavioral/NullObject/README.rst:24 #: ../../Behavioral/NullObject/README.rst:24
msgid "Null logger or null output to preserve a standard way of interaction between objects, even if the shouldn't do anything" msgid "Null logger or null output to preserve a standard way of interaction between objects, even if the shouldn't do anything"
msgstr "" msgstr "Null logger或Null输出以保持对象之间交互的标准方式即使他们不做任何事情"
#: ../../Behavioral/NullObject/README.rst:26 #: ../../Behavioral/NullObject/README.rst:26
msgid "null handler in a Chain of Responsibilities pattern" msgid "null handler in a Chain of Responsibilities pattern"
msgstr "" msgstr "责任链模式中的空处理程序"
#: ../../Behavioral/NullObject/README.rst:27 #: ../../Behavioral/NullObject/README.rst:27
msgid "null command in a Command pattern" msgid "null command in a Command pattern"
msgstr "" msgstr "命令模式中的空命令"
#: ../../Behavioral/NullObject/README.rst:30 #: ../../Behavioral/NullObject/README.rst:30
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/NullObject/README.rst:37 #: ../../Behavioral/NullObject/README.rst:37
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/NullObject/README.rst:39 #: ../../Behavioral/NullObject/README.rst:39
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/NullObject/README.rst:66 #: ../../Behavioral/NullObject/README.rst:66
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -13,11 +13,11 @@ msgstr ""
#: ../../Behavioral/Observer/README.rst:2 #: ../../Behavioral/Observer/README.rst:2
msgid "`Observer`__" msgid "`Observer`__"
msgstr "" msgstr "`观察者模式`__"
#: ../../Behavioral/Observer/README.rst:5 #: ../../Behavioral/Observer/README.rst:5
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/Observer/README.rst:7 #: ../../Behavioral/Observer/README.rst:7
msgid "" msgid ""
@@ -26,38 +26,42 @@ msgid ""
"notified. It is used to shorten the amount of coupled objects and uses loose" "notified. It is used to shorten the amount of coupled objects and uses loose"
" coupling instead." " coupling instead."
msgstr "" msgstr ""
"要实现对象的发布/订阅行为,只要[Subject]对象改变它的状态,就会通知附加的[observer]。"
"它用于减轻对象的耦合度,并使用松耦合代替。"
#: ../../Behavioral/Observer/README.rst:13 #: ../../Behavioral/Observer/README.rst:13
msgid "Examples" msgid "Examples"
msgstr "" msgstr "例子"
#: ../../Behavioral/Observer/README.rst:15 #: ../../Behavioral/Observer/README.rst:15
msgid "" msgid ""
"a message queue system is observed to show the progress of a job in a GUI" "a message queue system is observed to show the progress of a job in a GUI"
msgstr "" msgstr ""
"通过观察消息队列系统可以在GUI中显示作业的进度"
#: ../../Behavioral/Observer/README.rst:19 #: ../../Behavioral/Observer/README.rst:19
msgid "Note" msgid "Note"
msgstr "" msgstr "注意"
#: ../../Behavioral/Observer/README.rst:21 #: ../../Behavioral/Observer/README.rst:21
msgid "" msgid ""
"PHP already defines two interfaces that can help to implement this pattern: " "PHP already defines two interfaces that can help to implement this pattern: "
"SplObserver and SplSubject." "SplObserver and SplSubject."
msgstr "" msgstr ""
"PHP已经定义了两个接口来帮助实现这个模式:SplObserver和SplSubject。"
#: ../../Behavioral/Observer/README.rst:25 #: ../../Behavioral/Observer/README.rst:25
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/Observer/README.rst:32 #: ../../Behavioral/Observer/README.rst:32
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/Observer/README.rst:34 #: ../../Behavioral/Observer/README.rst:34
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/Observer/README.rst:49 #: ../../Behavioral/Observer/README.rst:49
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -13,11 +13,11 @@ msgstr ""
#: ../../Behavioral/Specification/README.rst:2 #: ../../Behavioral/Specification/README.rst:2
msgid "`Specification`__" msgid "`Specification`__"
msgstr "" msgstr "`规格模式`__"
#: ../../Behavioral/Specification/README.rst:5 #: ../../Behavioral/Specification/README.rst:5
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/Specification/README.rst:7 #: ../../Behavioral/Specification/README.rst:7
msgid "" msgid ""
@@ -26,10 +26,12 @@ msgid ""
"``isSatisfiedBy`` that returns either true or false depending on whether the" "``isSatisfiedBy`` that returns either true or false depending on whether the"
" given object satisfies the specification." " given object satisfies the specification."
msgstr "" msgstr ""
"构建清晰的业务规则规范,在其中可以对对象进行检查。每个规范类有一个名为[isSatisfiedBy]"
"的方法根据给定对象是否满足规范返回true或false。"
#: ../../Behavioral/Specification/README.rst:13 #: ../../Behavioral/Specification/README.rst:13
msgid "Examples" msgid "Examples"
msgstr "" msgstr "例子"
#: ../../Behavioral/Specification/README.rst:15 #: ../../Behavioral/Specification/README.rst:15
msgid "`RulerZ <https://github.com/K-Phoen/rulerz>`__" msgid "`RulerZ <https://github.com/K-Phoen/rulerz>`__"
@@ -37,16 +39,16 @@ msgstr ""
#: ../../Behavioral/Specification/README.rst:18 #: ../../Behavioral/Specification/README.rst:18
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/Specification/README.rst:25 #: ../../Behavioral/Specification/README.rst:25
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/Specification/README.rst:27 #: ../../Behavioral/Specification/README.rst:27
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/Specification/README.rst:72 #: ../../Behavioral/Specification/README.rst:72
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -13,11 +13,11 @@ msgstr ""
#: ../../Behavioral/State/README.rst:2 #: ../../Behavioral/State/README.rst:2
msgid "`State`__" msgid "`State`__"
msgstr "" msgstr "`状态模式`__"
#: ../../Behavioral/State/README.rst:5 #: ../../Behavioral/State/README.rst:5
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/State/README.rst:7 #: ../../Behavioral/State/README.rst:7
msgid "" msgid ""
@@ -25,19 +25,21 @@ msgid ""
"state. This can be a cleaner way for an object to change its behavior at " "state. This can be a cleaner way for an object to change its behavior at "
"runtime without resorting to large monolithic conditional statements." "runtime without resorting to large monolithic conditional statements."
msgstr "" msgstr ""
"根据对象的状态封装一种事务的不同行为。 这更简洁的方式可以在对象在运行时更改其行为,"
"而无需求助于大型的判断条件语句。"
#: ../../Behavioral/State/README.rst:12 #: ../../Behavioral/State/README.rst:12
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/State/README.rst:19 #: ../../Behavioral/State/README.rst:19
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/State/README.rst:21 #: ../../Behavioral/State/README.rst:21
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/State/README.rst:54 #: ../../Behavioral/State/README.rst:54
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -13,27 +13,27 @@ msgstr ""
#: ../../Behavioral/Strategy/README.rst:2 #: ../../Behavioral/Strategy/README.rst:2
msgid "`Strategy`__" msgid "`Strategy`__"
msgstr "" msgstr "`策略模式`__"
#: ../../Behavioral/Strategy/README.rst:5 #: ../../Behavioral/Strategy/README.rst:5
msgid "Terminology:" msgid "Terminology:"
msgstr "" msgstr "术语"
#: ../../Behavioral/Strategy/README.rst:7 #: ../../Behavioral/Strategy/README.rst:7
msgid "Context" msgid "Context"
msgstr "" msgstr "上下文"
#: ../../Behavioral/Strategy/README.rst:8 #: ../../Behavioral/Strategy/README.rst:8
msgid "Strategy" msgid "Strategy"
msgstr "" msgstr "策略"
#: ../../Behavioral/Strategy/README.rst:9 #: ../../Behavioral/Strategy/README.rst:9
msgid "Concrete Strategy" msgid "Concrete Strategy"
msgstr "" msgstr "具体的策略"
#: ../../Behavioral/Strategy/README.rst:12 #: ../../Behavioral/Strategy/README.rst:12
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/Strategy/README.rst:14 #: ../../Behavioral/Strategy/README.rst:14
msgid "" msgid ""
@@ -41,32 +41,36 @@ msgid ""
"pattern is a good alternative to inheritance (instead of having an abstract " "pattern is a good alternative to inheritance (instead of having an abstract "
"class that is extended)." "class that is extended)."
msgstr "" msgstr ""
"分开策略,并使它们之间能够快速切换。"
"此外,这种模式也是继承的一种很好的替代方法(而不是扩展抽象类)"
#: ../../Behavioral/Strategy/README.rst:19 #: ../../Behavioral/Strategy/README.rst:19
msgid "Examples" msgid "Examples"
msgstr "" msgstr "例子"
#: ../../Behavioral/Strategy/README.rst:21 #: ../../Behavioral/Strategy/README.rst:21
msgid "sorting a list of objects, one strategy by date, the other by id" msgid "sorting a list of objects, one strategy by date, the other by id"
msgstr "" msgstr "对对象列表进行排序一种策略是根据日期另一种策略是根据id"
#: ../../Behavioral/Strategy/README.rst:22 #: ../../Behavioral/Strategy/README.rst:22
msgid "" msgid ""
"simplify unit testing: e.g. switching between file and in-memory storage" "simplify unit testing: e.g. switching between file and in-memory storage"
msgstr "" msgstr ""
"简化单元测试:例如在文件和内存存储之间切换"
#: ../../Behavioral/Strategy/README.rst:26 #: ../../Behavioral/Strategy/README.rst:26
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/Strategy/README.rst:33 #: ../../Behavioral/Strategy/README.rst:33
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/Strategy/README.rst:35 #: ../../Behavioral/Strategy/README.rst:35
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/Strategy/README.rst:62 #: ../../Behavioral/Strategy/README.rst:62
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -13,15 +13,15 @@ msgstr ""
#: ../../Behavioral/TemplateMethod/README.rst:2 #: ../../Behavioral/TemplateMethod/README.rst:2
msgid "`Template Method`__" msgid "`Template Method`__"
msgstr "" msgstr "`模板方法模式`__"
#: ../../Behavioral/TemplateMethod/README.rst:5 #: ../../Behavioral/TemplateMethod/README.rst:5
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/TemplateMethod/README.rst:7 #: ../../Behavioral/TemplateMethod/README.rst:7
msgid "Template Method is a behavioral design pattern." msgid "Template Method is a behavioral design pattern."
msgstr "" msgstr "模板方法是一种行为设计模式。"
#: ../../Behavioral/TemplateMethod/README.rst:9 #: ../../Behavioral/TemplateMethod/README.rst:9
msgid "" msgid ""
@@ -29,6 +29,8 @@ msgid ""
"subclasses of this abstract template \"finish\" the behavior of an " "subclasses of this abstract template \"finish\" the behavior of an "
"algorithm." "algorithm."
msgstr "" msgstr ""
"你可能已经遇到过很多次了。"
"它的思想是让这个抽象模板的子类【完成】算法的行为策略。"
#: ../../Behavioral/TemplateMethod/README.rst:13 #: ../../Behavioral/TemplateMethod/README.rst:13
msgid "" msgid ""
@@ -36,6 +38,8 @@ msgid ""
"class is not called by subclasses but the inverse. How? With abstraction of " "class is not called by subclasses but the inverse. How? With abstraction of "
"course." "course."
msgstr "" msgstr ""
"也就是【好莱坞原则】:【别打给我们,我们打给你】。"
"这个类不是由子类调用的,而是由相反的子类调用的。怎么样?当然是抽象的。"
#: ../../Behavioral/TemplateMethod/README.rst:17 #: ../../Behavioral/TemplateMethod/README.rst:17
msgid "" msgid ""
@@ -43,25 +47,29 @@ msgid ""
"libraries. The user has just to implement one method and the superclass do " "libraries. The user has just to implement one method and the superclass do "
"the job." "the job."
msgstr "" msgstr ""
"换句话说,这是一个算法框架,非常适合框架库。"
"用户只需要实现一个方法,超类就可以完成这项工作。"
#: ../../Behavioral/TemplateMethod/README.rst:21 #: ../../Behavioral/TemplateMethod/README.rst:21
msgid "" msgid ""
"It is an easy way to decouple concrete classes and reduce copy-paste, that's" "It is an easy way to decouple concrete classes and reduce copy-paste, that's"
" why you'll find it everywhere." " why you'll find it everywhere."
msgstr "" msgstr ""
"它是解耦具体类和减少复制黏贴的一种简单方法,"
"这就是为什么你会发现它无处不在。"
#: ../../Behavioral/TemplateMethod/README.rst:25 #: ../../Behavioral/TemplateMethod/README.rst:25
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/TemplateMethod/README.rst:32 #: ../../Behavioral/TemplateMethod/README.rst:32
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/TemplateMethod/README.rst:34 #: ../../Behavioral/TemplateMethod/README.rst:34
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/TemplateMethod/README.rst:55 #: ../../Behavioral/TemplateMethod/README.rst:55
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"

View File

@@ -5,7 +5,7 @@ msgstr ""
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2015-05-29 12:18+0200\n" "POT-Creation-Date: 2015-05-29 12:18+0200\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n" "PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n" "Last-Translator: David Wan <autoloadone@gmail.com>\n"
"Language-Team: LANGUAGE <LL@li.org>\n" "Language-Team: LANGUAGE <LL@li.org>\n"
"MIME-Version: 1.0\n" "MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n" "Content-Type: text/plain; charset=UTF-8\n"
@@ -13,11 +13,11 @@ msgstr ""
#: ../../Behavioral/Visitor/README.rst:2 #: ../../Behavioral/Visitor/README.rst:2
msgid "`Visitor`__" msgid "`Visitor`__"
msgstr "" msgstr "`访问者模式`__"
#: ../../Behavioral/Visitor/README.rst:5 #: ../../Behavioral/Visitor/README.rst:5
msgid "Purpose" msgid "Purpose"
msgstr "" msgstr "目的"
#: ../../Behavioral/Visitor/README.rst:7 #: ../../Behavioral/Visitor/README.rst:7
msgid "" msgid ""
@@ -26,6 +26,9 @@ msgid ""
" classes have to define a contract to allow visitors (the ``Role::accept`` " " classes have to define a contract to allow visitors (the ``Role::accept`` "
"method in the example)." "method in the example)."
msgstr "" msgstr ""
"访问者模式允许将对象上的操作外包给其他对象。"
"这样做的主要原因是保持关注数据结构和数据操作的分离。"
"但是类必须定义一个允许访问的契约(示例中的Role::accept方法)。"
#: ../../Behavioral/Visitor/README.rst:12 #: ../../Behavioral/Visitor/README.rst:12
msgid "" msgid ""
@@ -33,19 +36,21 @@ msgid ""
"In that case, each Visitor has to choose itself which method to invoke on " "In that case, each Visitor has to choose itself which method to invoke on "
"the visitor." "the visitor."
msgstr "" msgstr ""
"契约是一个抽象类,但你也可以就是一个接口。"
"在这种情况下每个Visitor必须自己选择要调用哪个方法。"
#: ../../Behavioral/Visitor/README.rst:17 #: ../../Behavioral/Visitor/README.rst:17
msgid "UML Diagram" msgid "UML Diagram"
msgstr "" msgstr "UML 图"
#: ../../Behavioral/Visitor/README.rst:24 #: ../../Behavioral/Visitor/README.rst:24
msgid "Code" msgid "Code"
msgstr "" msgstr "代码"
#: ../../Behavioral/Visitor/README.rst:26 #: ../../Behavioral/Visitor/README.rst:26
msgid "You can also find this code on `GitHub`_" msgid "You can also find this code on `GitHub`_"
msgstr "" msgstr "在 `GitHub`_ 上查看代码"
#: ../../Behavioral/Visitor/README.rst:59 #: ../../Behavioral/Visitor/README.rst:59
msgid "Test" msgid "Test"
msgstr "" msgstr "测试"