-
Notifications
You must be signed in to change notification settings - Fork 17
/
Copy path2020-05-05-introducing-command-mode.adoc.po
218 lines (184 loc) · 11 KB
/
2020-05-05-introducing-command-mode.adoc.po
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
# SOME DESCRIPTIVE TITLE
# Copyright (C) YEAR Free Software Foundation, Inc.
# This file is distributed under the same license as the PACKAGE package.
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
#
#, fuzzy
msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"POT-Creation-Date: 2022-05-12 15:52+0000\n"
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
"Language-Team: LANGUAGE <[email protected]>\n"
"Language: zh_CN\n"
"MIME-Version: 1.0\n"
"Content-Type: text/plain; charset=UTF-8\n"
"Content-Transfer-Encoding: 8bit\n"
#. type: YAML Front Matter: title
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy, no-wrap
msgid "Introducing Command Mode"
msgstr "引入命令模式"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "Ever wanted to use Quarkus awesome API's and full feature set from a command line application ?"
msgstr "有没有想过从一个命令行程序中使用Quarkus强大的API和全部功能集?"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "Did you need to run a scheduled batch job now and then and not wanting to embed it into your main Quarkus built service ?"
msgstr "你是否需要不时地运行一个预定的批处理作业,并且不想将其嵌入到你的主要Quarkus构建的服务中?"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "image:https://i.imgflip.com/3xwzsh.jpg[]"
msgstr "image:https://i.imgflip.com/3xwzsh.jpg[alt=\"3xwzsh\"]"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "Quarkus has thus far been used to write applications that runs via an endpoint i.e. long running webserver via http or short-lived function in a serverless environment."
msgstr "迄今为止,Quarkus被用来编写通过端点运行的应用程序,即通过http长期运行的webserver或无服务器环境下的短期功能。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "In Quarkus 1.4 command mode lets you write apps that run without an endpoint and optionally exits immediately."
msgstr "在Quarkus 1.4中,命令模式让你可以编写没有端点的应用程序,并且可以选择立即退出。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "This enables you to use Quarkus for writing a whole new style of applications - think command line clients (CLI), batch scripts, console apps, etc."
msgstr "这使你能够使用Quarkus来编写一个全新风格的应用程序--想想命令行客户端(CLI)、批处理脚本、控制台应用程序等。"
#. type: Title ==
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy, no-wrap
msgid "How to use it"
msgstr "如何使用它"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "Below is a simple `GreetingMain` class which uses the traditional `GreetingService` from all our quickstarts."
msgstr "下面是一个简单的 `GreetingMain` 类,它使用了我们所有快速启动的传统 `GreetingService` 。"
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "The `@QuarkusMain` annotation tells Quarkus that this is the main entry point."
msgstr "`@QuarkusMain` 注释告诉 Quarkus 这是主要入口点。"
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "The `run` method is invoked once Quarkus starts, and the application stops when it finishes. If you would like to access request scoped beans you can annotate the `run` method with `@ActivateRequestContext`. This is useful to write or reuse your existing business logic using i.e. Hibernate Panache Entity beans query methods."
msgstr "一旦 Quarkus 启动,就会调用 `run` 方法,应用程序结束后就会停止。如果你想访问请求作用域的 Bean,你可以用 `@ActivateRequestContext` 来注解 `run` 方法。这对使用 Hibernate Panache Entity beans 查询方法编写或重用现有业务逻辑非常有用。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "You can add this to a `GreetingMain.java` and compile to a .jar or to full native (using `mvnw package -Dnative`) and when run you get something like:"
msgstr "你可以把这个添加到 `GreetingMain.java` ,然后编译成.jar或完全本地的(使用 `mvnw package -Dnative` ),当运行时你会得到类似的东西。"
#. type: Title ===
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy, no-wrap
msgid "Clean output"
msgstr "清洁输出"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "When working with a cli the default console log output can be verbose. For now the best way to turn that off is by setting the following properties:"
msgstr "当使用cli工作时,默认的控制台日志输出可以是verbose。目前,关闭该功能的最好方法是通过设置以下属性。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "These could be set in a custom profile called `cli` by adding a `%cli.` prefix."
msgstr "这些可以在一个名为 `cli` 的自定义配置文件中通过添加 `%cli.` 的前缀来设置。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "This has some issues and possible solution are being discussed in issue https://github.com/quarkusio/quarkus/issues/8871[#8871]."
msgstr "这有一些问题,可能的解决方案正在问题 link:https://github.com/quarkusio/quarkus/issues/8871[#8871] 中讨论。"
#. type: Title ===
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy, no-wrap
msgid "Development mode"
msgstr "发展模式"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "Command mode works with `quarkus:dev` aka. dev-mode."
msgstr "命令模式与 `quarkus:dev` aka.dev-mode一起工作。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "When you run with `mvn quarkus:dev` you can add `-Dquarkus.args=yourvalue` as arguments you want to pass into the command line."
msgstr "当你用 `mvn quarkus:dev` 运行时,你可以添加 `-Dquarkus.args=yourvalue` 作为你想传入命令行的参数。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "`quarkusargs` will be split on whitespace and honors escaped quotes to. Thus with `mvn quarkus:dev -Dquarkus.args=\"foo bar \\\"baz qux\\\"\"` the app will start and after end look like this:"
msgstr " `quarkusargs` 将在空白处进行分割,并以转义引号为荣。因此,使用 ,应用程序将开始,结束后看起来像这样。 `mvn quarkus:dev -Dquarkus.args=\"foo bar \\\"baz qux\\\"\"` "
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "You can now Press Enter multiple times to force a rerun and if you edited source code Press Enter will trigger build and then restart with no real overhead."
msgstr "你现在可以多次按回车键来强制重新运行,如果你编辑了源代码,按回车键将触发构建,然后重新启动,没有任何实际开销。"
#. type: Title ===
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy, no-wrap
msgid "Main methods"
msgstr "主要方法"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "As part of adding command mode via a `@QuarkusMain` annotated class you can now have your own `static void main()` method. Below snippet is the minimum to run Quarkus from a main method."
msgstr "作为通过 `@QuarkusMain` 注释的类添加命令模式的一部分,你现在可以有自己的 `static void main()` 方法。下面的片段是在一个主方法中运行Quarkus的最低限度。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "To use it with the above `@QuarksMain` class would look something like this:"
msgstr "要将其与上述 `@QuarksMain` 类一起使用,看起来会是这样的。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "That is all. This allows you to not only customize start/stop of your Quarks app and what many asked for: ability to launch/debug a Quarkus app directly from an IDE."
msgstr "这就是全部。这不仅允许你自定义你的Quarks应用程序的启动/停止,而且也是许多人要求的:能够直接从IDE启动/调试Quarkus应用程序。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "You can see a fully working example of these classes in the https://github.com/quarkusio/quarkus-quickstarts/tree/development/getting-started-command-mode[command-mode quickstart]."
msgstr "你可以在 link:https://github.com/quarkusio/quarkus-quickstarts/tree/development/getting-started-command-mode[命令模式快速入门] 中看到这些类的一个完全工作的例子。"
#. type: Title ===
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy, no-wrap
msgid "Minimal CLI App"
msgstr "最小的CLI应用"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "It is worth noticing that your cli app can still be serving out an endpoint - in fact, in the default app as we just made the rest endpoint is still starting and running. You just don't notice it. Quarkus is that fast."
msgstr "值得注意的是,您的 cli 应用程序仍然可以提供端点服务,事实上,在我们刚刚制作的默认应用程序中,其余端点仍在启动和运行。只是你没有注意到而已。Quarkus 就是这么快。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "In case you truly want a minimal extension you remove the `quarkus-resteasy` extension in your `pom.xml` and put `arc` instead."
msgstr "如果您真的想要一个最小的扩展名,请删除 `pom.xml` 中的 `quarkus-resteasy` 扩展名,并使用 `arc` 代替。"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "Then nothing else than your Quarkus main class will be run."
msgstr "这样,除了你的 Quarkus 主类外,就不会运行其他任何程序了。"
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "What is next ?"
msgstr "下一步是什么?"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "You tell us! What would you like to do with a command app with Quarkus ?"
msgstr "请告诉我们!您想用 Quarkus 命令应用程序做什么?"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "For now we are enjoying writing CLI's but how many others will join us!"
msgstr "现在,我们正享受着编写 CLI 的乐趣,但还有多少人会加入我们的行列呢?"
#. type: Plain text
#: _posts/2020-05-05-introducing-command-mode.adoc
#, fuzzy
msgid "Let us know of your ideas at https://github.com/quarkusio/quarkus/issues."
msgstr "请将您的想法发送至 link:https://github.com/quarkusio/quarkus/issues[https://github.com/quarkusio/quarkus/issues。]"