Skip to content

Commit 1f7138c

Browse files
suxiaolinguokan-shang
authored andcommitted
Chinese translation part three
finish Builder translattion finish Pool translattion correct words translation correct words translation correct words translation finish locale/zh_CN/LC_MESSAGES/Structural/README.po translation finish DependencyInjection translation
1 parent 41f3805 commit 1f7138c

File tree

4 files changed

+50
-23
lines changed

4 files changed

+50
-23
lines changed

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

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

1414
#: ../../Creational/Builder/README.rst:2
1515
msgid "`Builder`__"
16-
msgstr ""
16+
msgstr "生成器模式"
1717

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

2222
#: ../../Creational/Builder/README.rst:7
2323
msgid "Builder is an interface that build parts of a complex object."
24-
msgstr ""
24+
msgstr "生成器的目的是将复杂对象的创建过程(流程)进行抽象,生成器表现为接口的形式。"
2525

2626
#: ../../Creational/Builder/README.rst:9
2727
msgid ""
2828
"Sometimes, if the builder has a better knowledge of what it builds, this "
2929
"interface could be an abstract class with default methods (aka adapter)."
3030
msgstr ""
31+
"在特定的情况下,比如如果生成器对将要创建的对象有足够多的了解,那么代表生成器的接口(interface)可以是"
32+
"一个抽象类(也就是说可以有一定的具体实现,就像众所周知的适配器模式)。"
3133

3234
#: ../../Creational/Builder/README.rst:12
3335
msgid ""
3436
"If you have a complex inheritance tree for objects, it is logical to have a "
3537
"complex inheritance tree for builders too."
3638
msgstr ""
39+
"如果对象有复杂的继承树,理论上创建对象的生成器也同样具有复杂的继承树。"
3740

3841
#: ../../Creational/Builder/README.rst:15
3942
msgid ""
4043
"Note: Builders have often a fluent interface, see the mock builder of "
4144
"PHPUnit for example."
4245
msgstr ""
46+
"提示:生成器通常具有流畅的接口,推荐阅读关于 PHPUnit 的mock生成器获取更好的理解。"
4347

4448
#: ../../Creational/Builder/README.rst:19
4549
msgid "Examples"
46-
msgstr ""
50+
msgstr "例子"
4751

4852
#: ../../Creational/Builder/README.rst:21
4953
msgid "PHPUnit: Mock Builder"
5054
msgstr ""
55+
"PHPUnit: Mock 生成器"
5156

5257
#: ../../Creational/Builder/README.rst:24
5358
msgid "UML Diagram"
54-
msgstr ""
59+
msgstr "UML 图"
5560

5661
#: ../../Creational/Builder/README.rst:31
5762
msgid "Code"
58-
msgstr ""
63+
msgstr "代码"
5964

6065
#: ../../Creational/Builder/README.rst:33
6166
msgid "You can also find these code on `GitHub`_"
62-
msgstr ""
67+
msgstr "你可以在 `GitHub`_ 上找到这些代码"
6368

6469
#: ../../Creational/Builder/README.rst:35
6570
msgid "Director.php"
@@ -103,7 +108,7 @@ msgstr ""
103108

104109
#: ../../Creational/Builder/README.rst:96
105110
msgid "Test"
106-
msgstr ""
111+
msgstr "测试"
107112

108113
#: ../../Creational/Builder/README.rst:98
109114
msgid "Tests/DirectorTest.php"

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

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

1414
#: ../../Creational/Pool/README.rst:2
1515
msgid "`Pool`__"
16-
msgstr ""
16+
msgstr "对象池"
1717

1818
#: ../../Creational/Pool/README.rst:4
1919
msgid ""
@@ -24,6 +24,10 @@ msgid ""
2424
"object. When the client has finished, it returns the object, which is a "
2525
"specific type of factory object, to the pool rather than destroying it."
2626
msgstr ""
27+
"**对象池设计模式** 是创建型设计模式,它会对新创建的对象应用一系列的初始化操作,让对象保持立即可使用的状态"
28+
" - 一个存放对象的 \"池子\" - 而不是对对象进行一次性的的使用(创建并使用,完成之后立即销毁)。对象池的使用者会对对象池发起请求,以期望"
29+
"获取一个对象,并使用获取到的对象进行一系列操作,当使用者对对象的使用完成之后,使用者会将由对象池的对象创建工厂创建的对象返回给对象池,而不是"
30+
"用完之后销毁获取到的对象。"
2731

2832
#: ../../Creational/Pool/README.rst:11
2933
msgid ""
@@ -34,6 +38,9 @@ msgid ""
3438
"creation of the new objects (especially over network) may take variable "
3539
"time."
3640
msgstr ""
41+
"对象池在某些情况下会带来重要的性能提升,比如耗费资源的对象初始化操作,实例化类的代价很高,但每次实例化的数量较少的情况下。"
42+
"对象池中将被创建的对象会在真正被使用时被提前创建,避免在使用时让使用者浪费对象创建所需的大量时间(比如在对象某些操作需要访问网络资源的情况下)"
43+
"从池子中取得对象的时间是可预测的,但新建一个实例所需的时间是不确定。"
3744

3845
#: ../../Creational/Pool/README.rst:18
3946
msgid ""
@@ -43,18 +50,21 @@ msgid ""
4350
"simple object pooling (that hold no external resources, but only occupy "
4451
"memory) may not be efficient and could decrease performance."
4552
msgstr ""
53+
"总之,对象池会为你节省宝贵的程序执行时间,比如像数据库连接,socket连接,大量耗费资源的代表数字资源的对象,像字体或者位图。"
54+
"不过,在特定情况下,简单的对象创建池(没有请求外部的资源,仅仅将自身保存在内存中)或许并不会提升效率和性能,这时候,就需要使用者"
55+
"酌情考虑了。"
4656

4757
#: ../../Creational/Pool/README.rst:25
4858
msgid "UML Diagram"
49-
msgstr ""
59+
msgstr "UML 图"
5060

5161
#: ../../Creational/Pool/README.rst:32
5262
msgid "Code"
53-
msgstr ""
63+
msgstr "代码"
5464

5565
#: ../../Creational/Pool/README.rst:34
5666
msgid "You can also find these code on `GitHub`_"
57-
msgstr ""
67+
msgstr "你可以在 `GitHub`_ 上找到这些代码"
5868

5969
#: ../../Creational/Pool/README.rst:36
6070
msgid "Pool.php"
@@ -70,7 +80,7 @@ msgstr ""
7080

7181
#: ../../Creational/Pool/README.rst:55
7282
msgid "Test"
73-
msgstr ""
83+
msgstr "测试"
7484

7585
#: ../../Creational/Pool/README.rst:57
7686
msgid "Tests/PoolTest.php"

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

Lines changed: 19 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -13,21 +13,21 @@ msgstr ""
1313

1414
#: ../../Structural/DependencyInjection/README.rst:2
1515
msgid "`Dependency Injection`__"
16-
msgstr ""
16+
msgstr "`依赖注入`__"
1717

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

2222
#: ../../Structural/DependencyInjection/README.rst:7
2323
msgid ""
2424
"To implement a loosely coupled architecture in order to get better testable,"
2525
" maintainable and extendable code."
26-
msgstr ""
26+
msgstr "实现了松耦合的软件架构,可得到更好的测试,管理和扩展的代码"
2727

2828
#: ../../Structural/DependencyInjection/README.rst:11
2929
msgid "Usage"
30-
msgstr ""
30+
msgstr "用例"
3131

3232
#: ../../Structural/DependencyInjection/README.rst:13
3333
msgid ""
@@ -36,6 +36,8 @@ msgid ""
3636
" ``Connection``, which is not very good for testing and extending "
3737
"``Connection``."
3838
msgstr ""
39+
"通过配置需要注入的依赖,``Connection`` 能从 ``$config`` 中获取到所有它需要的依赖。如果没有"
40+
"依赖注入,``Connection`` 会直接创建它需要的依赖,这样不利于测试和扩展``Connection``。"
3941

4042
#: ../../Structural/DependencyInjection/README.rst:18
4143
msgid ""
@@ -46,10 +48,14 @@ msgid ""
4648
" Read more about Inversion of control `here "
4749
"<http://en.wikipedia.org/wiki/Inversion_of_control>`__."
4850
msgstr ""
51+
"注意我们一直在遵循控制反转的设计原则,``Connection`` 通过要求 ``$config`` 实现 ``Parameters`` 的接口。这样就达到了组建间"
52+
"的解耦。我们不需要关心信息的来源,只需要关心 ``$config`` 中一定有方法来获取我们需要的信息。"
53+
"阅读更多的关于控制反转的资料请点"
54+
" `这里<http://en.wikipedia.org/wiki/Inversion_of_control>`__."
4955

5056
#: ../../Structural/DependencyInjection/README.rst:26
5157
msgid "Examples"
52-
msgstr ""
58+
msgstr "例子"
5359

5460
#: ../../Structural/DependencyInjection/README.rst:28
5561
msgid ""
@@ -58,25 +64,29 @@ msgid ""
5864
"create a mock object of the configuration and inject that into the "
5965
"``Connection`` object"
6066
msgstr ""
67+
"Doctrine2 ORM 使用了依赖注入,它通过配置注入了 ``Connection`` 对象。为了达到方便测试的目的,"
68+
"可以很容易的通过配置创建一个mock的``Connection`` 对象。"
6169

6270
#: ../../Structural/DependencyInjection/README.rst:32
6371
msgid ""
6472
"Symfony and Zend Framework 2 already have containers for DI that create "
6573
"objects via a configuration array and inject them where needed (i.e. in "
6674
"Controllers)"
6775
msgstr ""
76+
"Symfony 和 Zend Framework 2 也有了专门的依赖注入容器,用来通过配置数据创建需要的对象"
77+
"(比如在控制器中使用依赖注入容器获取所需的对象)"
6878

6979
#: ../../Structural/DependencyInjection/README.rst:37
7080
msgid "UML Diagram"
71-
msgstr ""
81+
msgstr "UML 图"
7282

7383
#: ../../Structural/DependencyInjection/README.rst:44
7484
msgid "Code"
75-
msgstr ""
85+
msgstr "代码"
7686

7787
#: ../../Structural/DependencyInjection/README.rst:46
7888
msgid "You can also find these code on `GitHub`_"
79-
msgstr ""
89+
msgstr "你可以在 `GitHub`_ 上找到这些代码"
8090

8191
#: ../../Structural/DependencyInjection/README.rst:48
8292
msgid "AbstractConfig.php"
@@ -96,7 +106,7 @@ msgstr ""
96106

97107
#: ../../Structural/DependencyInjection/README.rst:73
98108
msgid "Test"
99-
msgstr ""
109+
msgstr "测试"
100110

101111
#: ../../Structural/DependencyInjection/README.rst:75
102112
msgid "Tests/DependencyInjectionTest.php"

locale/zh_CN/LC_MESSAGES/Structural/README.po

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,11 +13,13 @@ msgstr ""
1313

1414
#: ../../Structural/README.rst:2
1515
msgid "`Structural`__"
16-
msgstr ""
16+
msgstr "`结构型设计模式`__"
1717

1818
#: ../../Structural/README.rst:4
1919
msgid ""
2020
"In Software Engineering, Structural Design Patterns are Design Patterns that"
2121
" ease the design by identifying a simple way to realize relationships "
2222
"between entities."
2323
msgstr ""
24+
"在软件工程中,结构型设计模式集是用来抽象真实程序中的对象实体之间的关系,并使"
25+
"这种关系可被描述,概括和具体化。"

0 commit comments

Comments
 (0)