Skip to content

Commit 98aa292

Browse files
committed
translate some Structural patterns
1 parent 58f0fc6 commit 98aa292

File tree

9 files changed

+170
-83
lines changed

9 files changed

+170
-83
lines changed
Lines changed: 83 additions & 33 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
#
22
msgid ""
33
msgstr ""
44
"Project-Id-Version: DesignPatternsPHP 1.0\n"
@@ -19,67 +19,117 @@ msgstr ""
1919
msgid "Purpose"
2020
msgstr ""
2121

22-
#: ../../Behavioral/Memento/README.rst:7
23-
msgid ""
24-
"Provide the ability to restore an object to its previous state (undo via "
25-
"rollback)."
26-
msgstr ""
27-
28-
#: ../../Behavioral/Memento/README.rst:10
29-
msgid ""
30-
"The memento pattern is implemented with three objects: the originator, a "
31-
"caretaker and a memento. The originator is some object that has an internal "
32-
"state. The caretaker is going to do something to the originator, but wants "
33-
"to be able to undo the change. The caretaker first asks the originator for a"
34-
" memento object. Then it does whatever operation (or sequence of operations)"
35-
" it was going to do. To roll back to the state before the operations, it "
36-
"returns the memento object to the originator. The memento object itself is "
37-
"an opaque object (one which the caretaker cannot, or should not, change). "
38-
"When using this pattern, care should be taken if the originator may change "
39-
"other objects or resources - the memento pattern operates on a single "
40-
"object."
41-
msgstr ""
42-
43-
#: ../../Behavioral/Memento/README.rst:23
22+
#: ../../Behavioral/Memento/README.rst:39
4423
msgid "Examples"
4524
msgstr ""
4625

47-
#: ../../Behavioral/Memento/README.rst:25
26+
#: ../../Behavioral/Memento/README.rst:41
4827
msgid "The seed of a pseudorandom number generator"
4928
msgstr ""
5029

51-
#: ../../Behavioral/Memento/README.rst:26
30+
#: ../../Behavioral/Memento/README.rst:42
5231
msgid "The state in a finite state machine"
5332
msgstr ""
5433

55-
#: ../../Behavioral/Memento/README.rst:29
34+
#: ../../Behavioral/Memento/README.rst:46
5635
msgid "UML Diagram"
5736
msgstr ""
5837

59-
#: ../../Behavioral/Memento/README.rst:36
38+
#: ../../Behavioral/Memento/README.rst:53
6039
msgid "Code"
6140
msgstr ""
6241

63-
#: ../../Behavioral/Memento/README.rst:38
42+
#: ../../Behavioral/Memento/README.rst:55
6443
msgid "You can also find these code on `GitHub`_"
6544
msgstr ""
6645

67-
#: ../../Behavioral/Memento/README.rst:40
46+
#: ../../Behavioral/Memento/README.rst:57
6847
msgid "Memento.php"
6948
msgstr ""
7049

71-
#: ../../Behavioral/Memento/README.rst:46
50+
#: ../../Behavioral/Memento/README.rst:63
7251
msgid "Originator.php"
7352
msgstr ""
7453

75-
#: ../../Behavioral/Memento/README.rst:52
54+
#: ../../Behavioral/Memento/README.rst:69
7655
msgid "Caretaker.php"
7756
msgstr ""
7857

79-
#: ../../Behavioral/Memento/README.rst:59
58+
#: ../../Behavioral/Memento/README.rst:76
8059
msgid "Test"
8160
msgstr ""
8261

83-
#: ../../Behavioral/Memento/README.rst:61
62+
#: ../../Behavioral/Memento/README.rst:78
8463
msgid "Tests/MementoTest.php"
8564
msgstr ""
65+
66+
#: ../../Behavioral/Memento/README.rst:7
67+
msgid ""
68+
"It provides the ability to restore an object to it's previous state (undo "
69+
"via rollback) or to gain access to state of the object, without revealing "
70+
"it's implementation (i.e., the object is not required to have a functional "
71+
"for return the current state)."
72+
msgstr ""
73+
74+
#: ../../Behavioral/Memento/README.rst:12
75+
msgid ""
76+
"The memento pattern is implemented with three objects: the Originator, a "
77+
"Caretaker and a Memento."
78+
msgstr ""
79+
80+
#: ../../Behavioral/Memento/README.rst:15
81+
msgid ""
82+
"Memento – an object that *contains a concrete unique snapshot of state* of "
83+
"any object or resource: string, number, array, an instance of class and so "
84+
"on. The uniqueness in this case does not imply the prohibition existence of "
85+
"similar states in different snapshots. That means the state can be extracted"
86+
" as the independent clone. Any object stored in the Memento should be *a "
87+
"full copy of the original object rather than a reference* to the original "
88+
"object. The Memento object is a \"opaque object\" (the object that no one "
89+
"can or should change)."
90+
msgstr ""
91+
92+
#: ../../Behavioral/Memento/README.rst:24
93+
msgid ""
94+
"Originator – it is an object that contains the *actual state of an external "
95+
"object is strictly specified type*. Originator is able to create a unique "
96+
"copy of this state and return it wrapped in a Memento. The Originator does "
97+
"not know the history of changes. You can set a concrete state to Originator "
98+
"from the outside, which will be considered as actual. The Originator must "
99+
"make sure that given state corresponds the allowed type of object. "
100+
"Originator may (but not should) have any methods, but they *they can't make "
101+
"changes to the saved object state*."
102+
msgstr ""
103+
104+
#: ../../Behavioral/Memento/README.rst:33
105+
msgid ""
106+
"Caretaker *controls the states history*. He may make changes to an object; "
107+
"take a decision to save the state of an external object in the Originator; "
108+
"ask from the Originator snapshot of the current state; or set the Originator"
109+
" state to equivalence with some snapshot from history."
110+
msgstr ""
111+
112+
#: ../../Behavioral/Memento/README.rst:43
113+
msgid ""
114+
"Control for intermediate states of `ORM Model <http://en.wikipedia.org/wiki"
115+
"/Object-relational_mapping>`_ before saving"
116+
msgstr ""
117+
118+
#~ msgid ""
119+
#~ "Provide the ability to restore an object to its previous state (undo via "
120+
#~ "rollback)."
121+
#~ msgstr ""
122+
123+
#~ msgid ""
124+
#~ "The memento pattern is implemented with three objects: the originator, a "
125+
#~ "caretaker and a memento. The originator is some object that has an internal "
126+
#~ "state. The caretaker is going to do something to the originator, but wants "
127+
#~ "to be able to undo the change. The caretaker first asks the originator for a"
128+
#~ " memento object. Then it does whatever operation (or sequence of operations)"
129+
#~ " it was going to do. To roll back to the state before the operations, it "
130+
#~ "returns the memento object to the originator. The memento object itself is "
131+
#~ "an opaque object (one which the caretaker cannot, or should not, change). "
132+
#~ "When using this pattern, care should be taken if the originator may change "
133+
#~ "other objects or resources - the memento pattern operates on a single "
134+
#~ "object."
135+
#~ msgstr ""

locale/zh_CN/LC_MESSAGES/Creational/Multiton/README.po

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
#
22
msgid ""
33
msgstr ""
44
"Project-Id-Version: DesignPatternsPHP 1.0\n"
@@ -19,8 +19,7 @@ msgstr "多例"
1919
msgid ""
2020
"**THIS IS CONSIDERED TO BE AN ANTI-PATTERN! FOR BETTER TESTABILITY AND "
2121
"MAINTAINABILITY USE DEPENDENCY INJECTION!**"
22-
msgstr ""
23-
"**多例模式已经被考虑列入到反模式中!请使用依赖注入获得更好的代码可测试性和可控性!**"
22+
msgstr "**多例模式已经被考虑列入到反模式中!请使用依赖注入获得更好的代码可测试性和可控性!**"
2423

2524
#: ../../Creational/Multiton/README.rst:8
2625
msgid "Purpose"
@@ -61,5 +60,6 @@ msgid "Multiton.php"
6160
msgstr ""
6261

6362
#: ../../Creational/Multiton/README.rst:38
64-
msgid "测试"
65-
msgstr ""
63+
msgid "Test"
64+
msgstr "测试"
65+

locale/zh_CN/LC_MESSAGES/More/Delegation/README.po

Lines changed: 20 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
#
1+
#
22
msgid ""
33
msgstr ""
44
"Project-Id-Version: DesignPatternsPHP 1.0\n"
@@ -19,10 +19,6 @@ msgstr ""
1919
msgid "Purpose"
2020
msgstr ""
2121

22-
#: ../../More/Delegation/README.rst:7 ../../More/Delegation/README.rst:12
23-
msgid "..."
24-
msgstr ""
25-
2622
#: ../../More/Delegation/README.rst:10
2723
msgid "Examples"
2824
msgstr ""
@@ -58,3 +54,22 @@ msgstr ""
5854
#: ../../More/Delegation/README.rst:47
5955
msgid "Tests/DelegationTest.php"
6056
msgstr ""
57+
58+
#: ../../More/Delegation/README.rst:7
59+
msgid ""
60+
"Demonstrate the Delegator pattern, where an object, instead of performing "
61+
"one of its stated tasks, delegates that task to an associated helper object."
62+
" In this case TeamLead professes to writeCode and Usage uses this, while "
63+
"TeamLead delegates writeCode to JuniorDeveloper's writeBadCode function. "
64+
"This inverts the responsibility so that Usage is unknowingly executing "
65+
"writeBadCode."
66+
msgstr ""
67+
68+
#: ../../More/Delegation/README.rst:12
69+
msgid ""
70+
"Please review JuniorDeveloper.php, TeamLead.php, and then Usage.php to see "
71+
"it all tied together."
72+
msgstr ""
73+
74+
#~ msgid "..."
75+
#~ msgstr ""

locale/zh_CN/LC_MESSAGES/Structural/Adapter/README.po

Lines changed: 12 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,11 @@ msgstr ""
1313

1414
#: ../../Structural/Adapter/README.rst:2
1515
msgid "`Adapter / Wrapper`__"
16-
msgstr ""
16+
msgstr "`适配器模式`__"
1717

1818
#: ../../Structural/Adapter/README.rst:5
1919
msgid "Purpose"
20-
msgstr ""
20+
msgstr "目的"
2121

2222
#: ../../Structural/Adapter/README.rst:7
2323
msgid ""
@@ -26,32 +26,36 @@ msgid ""
2626
"incompatible interfaces by providing it's interface to clients while using "
2727
"the original interface."
2828
msgstr ""
29+
"将某个类的接口转换成与另一个接口兼容。适配器通过将原始接口进行转换,给用户"
30+
"提供一个兼容接口,使得原来因为接口不同而无法一起使用的类可以得到兼容。"
2931

3032
#: ../../Structural/Adapter/README.rst:13
3133
msgid "Examples"
32-
msgstr ""
34+
msgstr "例子"
3335

3436
#: ../../Structural/Adapter/README.rst:15
3537
msgid "DB Client libraries adapter"
36-
msgstr ""
38+
msgstr "数据库客户端库适配器"
3739

3840
#: ../../Structural/Adapter/README.rst:16
3941
msgid ""
4042
"using multiple different webservices and adapters normalize data so that the"
4143
" outcome is the same for all"
4244
msgstr ""
45+
"使用不同的webservices,通过适配器来标准化输出数据,从而保证不同webservice输出的"
46+
"数据是一致的"
4347

4448
#: ../../Structural/Adapter/README.rst:20
4549
msgid "UML Diagram"
46-
msgstr ""
50+
msgstr "UML 图"
4751

4852
#: ../../Structural/Adapter/README.rst:27
4953
msgid "Code"
50-
msgstr ""
54+
msgstr "代码"
5155

5256
#: ../../Structural/Adapter/README.rst:29
5357
msgid "You can also find these code on `GitHub`_"
54-
msgstr ""
58+
msgstr "你可以在 `GitHub`_ 上找到这些代码"
5559

5660
#: ../../Structural/Adapter/README.rst:31
5761
msgid "PaperBookInterface.php"
@@ -75,7 +79,7 @@ msgstr ""
7579

7680
#: ../../Structural/Adapter/README.rst:62
7781
msgid "Test"
78-
msgstr ""
82+
msgstr "测试"
7983

8084
#: ../../Structural/Adapter/README.rst:64
8185
msgid "Tests/AdapterTest.php"

locale/zh_CN/LC_MESSAGES/Structural/Bridge/README.po

Lines changed: 8 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -13,37 +13,38 @@ msgstr ""
1313

1414
#: ../../Structural/Bridge/README.rst:2
1515
msgid "`Bridge`__"
16-
msgstr ""
16+
msgstr "`桥接模式`__"
1717

1818
#: ../../Structural/Bridge/README.rst:5
1919
msgid "Purpose"
20-
msgstr ""
20+
msgstr "目的"
2121

2222
#: ../../Structural/Bridge/README.rst:7
2323
msgid ""
2424
"Decouple an abstraction from its implementation so that the two can vary "
2525
"independently."
2626
msgstr ""
27+
"解耦一个对象的实现与抽象,这样两者可以独立地变化。"
2728

2829
#: ../../Structural/Bridge/README.rst:11
2930
msgid "Sample:"
30-
msgstr ""
31+
msgstr "例子"
3132

3233
#: ../../Structural/Bridge/README.rst:13
3334
msgid "`Symfony DoctrineBridge <https://github.com/symfony/DoctrineBridge>`__"
3435
msgstr ""
3536

3637
#: ../../Structural/Bridge/README.rst:17
3738
msgid "UML Diagram"
38-
msgstr ""
39+
msgstr "UML 图"
3940

4041
#: ../../Structural/Bridge/README.rst:24
4142
msgid "Code"
42-
msgstr ""
43+
msgstr "代码"
4344

4445
#: ../../Structural/Bridge/README.rst:26
4546
msgid "You can also find these code on `GitHub`_"
46-
msgstr ""
47+
msgstr "你可以在 `GitHub`_ 上找到这些代码"
4748

4849
#: ../../Structural/Bridge/README.rst:28
4950
msgid "Workshop.php"
@@ -71,7 +72,7 @@ msgstr ""
7172

7273
#: ../../Structural/Bridge/README.rst:65
7374
msgid "Test"
74-
msgstr ""
75+
msgstr "测试"
7576

7677
#: ../../Structural/Bridge/README.rst:67
7778
msgid "Tests/BridgeTest.php"

0 commit comments

Comments
 (0)