Skip to content

Commit 540afed

Browse files
author
Sergiy Zhovnir
committed
#issue-178 Added common properties for cron group
1 parent 9f974f0 commit 540afed

File tree

3 files changed

+32
-14
lines changed

3 files changed

+32
-14
lines changed

resources/magento2/common.properties

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ common.controller.inheritAction=Inherit Action Class
1010
common.controller.backend.acl=Admin Resource ACL
1111
common.controller.action=Controller Action
1212
common.ok=OK
13+
common.yes=Yes
14+
common.no=No
15+
common.optionName=Option Name
16+
common.optionValue=Option Value
17+
common.optionAdd=Add Option
18+
common.optionDescription=Option Description
1319
common.cancel=Cancel
1420
common.error=Error
1521
common.module.target=Target Module
@@ -39,3 +45,10 @@ common.cli.generate.error=New CLI Command Generation Error
3945
common.cli.class.title=CLI Command Class
4046
common.validationErrorTitle=Validation Error
4147
common.defaultConsoleDirectory=Console
48+
common.cronGroup.description.scheduleGenerateEvery=Frequency (in minutes) that schedules are written to the cron_schedule table.
49+
common.cronGroup.description.scheduleAheadFor=Time (in minutes) in advance that schedules are written to the cron_schedule table.
50+
common.cronGroup.description.scheduleLifetime=Window of time (in minutes) that cron job must start or will be considered missed ("too late" to run).
51+
common.cronGroup.description.historyCleanupEvery=Time (in minutes) that cron history is kept in the database.
52+
common.cronGroup.description.historySuccessLifetime=Time (in minutes) that the record of successfully completed cron jobs are kept in the database.
53+
common.cronGroup.description.historyFailureLifetime=Time (in minutes) that the record of failed cron jobs are kept in the database.
54+
common.cronGroup.description.useSeparateProcess=Run this crongroup’s jobs in a separate php process.

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronGroupDialog.form

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -146,15 +146,15 @@
146146
<grid row="2" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
147147
</constraints>
148148
<properties>
149-
<text value="Option Name"/>
149+
<text resource-bundle="magento2/common" key="common.optionName"/>
150150
</properties>
151151
</component>
152152
<component id="d5e85" class="javax.swing.JLabel">
153153
<constraints>
154154
<grid row="2" column="1" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
155155
</constraints>
156156
<properties>
157-
<text value="Option Value"/>
157+
<text resource-bundle="magento2/common" key="common.optionValue"/>
158158
</properties>
159159
</component>
160160
<component id="2697c" class="javax.swing.JCheckBox" binding="addScheduleGenerateEvery">
@@ -216,15 +216,15 @@
216216
<grid row="2" column="2" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
217217
</constraints>
218218
<properties>
219-
<text value="Add Option"/>
219+
<text resource-bundle="magento2/common" key="common.optionAdd"/>
220220
</properties>
221221
</component>
222222
<component id="f1e69" class="javax.swing.JLabel">
223223
<constraints>
224224
<grid row="3" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
225225
</constraints>
226226
<properties>
227-
<text value="Frequency (in minutes) that schedules are written to the cron_schedule table."/>
227+
<text resource-bundle="magento2/common" key="common.cronGroup.description.scheduleGenerateEvery"/>
228228
</properties>
229229
</component>
230230
<component id="fa5bf" class="javax.swing.JTextField" binding="cronGroupName">
@@ -242,47 +242,47 @@
242242
<grid row="0" column="0" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
243243
</constraints>
244244
<properties>
245-
<text resource-bundle="magento2/common" key="common.cronGroup"/>
245+
<text resource-bundle="magento2/common" key="common.name"/>
246246
</properties>
247247
</component>
248248
<component id="cff9e" class="javax.swing.JLabel">
249249
<constraints>
250250
<grid row="4" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
251251
</constraints>
252252
<properties>
253-
<text value="Time (in minutes) in advance that schedules are written to the cron_schedule table."/>
253+
<text resource-bundle="magento2/common" key="common.cronGroup.description.scheduleAheadFor"/>
254254
</properties>
255255
</component>
256256
<component id="86513" class="javax.swing.JLabel">
257257
<constraints>
258258
<grid row="5" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
259259
</constraints>
260260
<properties>
261-
<text value="Window of time (in minutes) that cron job must start or will be considered missed (“too late” to run)."/>
261+
<text resource-bundle="magento2/common" key="common.cronGroup.description.scheduleLifetime"/>
262262
</properties>
263263
</component>
264264
<component id="47d4e" class="javax.swing.JLabel">
265265
<constraints>
266266
<grid row="6" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
267267
</constraints>
268268
<properties>
269-
<text value="Time (in minutes) that cron history is kept in the database."/>
269+
<text resource-bundle="magento2/common" key="common.cronGroup.description.historyCleanupEvery"/>
270270
</properties>
271271
</component>
272272
<component id="24201" class="javax.swing.JLabel">
273273
<constraints>
274274
<grid row="7" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
275275
</constraints>
276276
<properties>
277-
<text value="Time (in minutes) that the record of successfully completed cron jobs are kept in the database."/>
277+
<text resource-bundle="magento2/common" key="common.cronGroup.description.historySuccessLifetime"/>
278278
</properties>
279279
</component>
280280
<component id="28f5e" class="javax.swing.JLabel">
281281
<constraints>
282282
<grid row="8" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
283283
</constraints>
284284
<properties>
285-
<text value="Time (in minutes) that the record of failed cron jobs are kept in the database."/>
285+
<text resource-bundle="magento2/common" key="common.cronGroup.description.historyFailureLifetime"/>
286286
</properties>
287287
</component>
288288
<component id="217ce" class="javax.swing.JLabel">
@@ -307,15 +307,15 @@
307307
<grid row="9" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
308308
</constraints>
309309
<properties>
310-
<text value="Run this crongroup’s jobs in a separate php process"/>
310+
<text resource-bundle="magento2/common" key="common.cronGroup.description.useSeparateProcess"/>
311311
</properties>
312312
</component>
313313
<component id="e05a0" class="javax.swing.JLabel">
314314
<constraints>
315315
<grid row="2" column="3" row-span="1" col-span="1" vsize-policy="0" hsize-policy="0" anchor="8" fill="0" indent="0" use-parent-layout="false"/>
316316
</constraints>
317317
<properties>
318-
<text value="Option Description"/>
318+
<text resource-bundle="magento2/common" key="common.optionDescription"/>
319319
</properties>
320320
</component>
321321
<component id="8d0ed" class="com.magento.idea.magento2plugin.ui.FilteredComboBox" binding="useSeparateProcess" custom-create="true">

src/com/magento/idea/magento2plugin/actions/generation/dialog/NewCronGroupDialog.java

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,9 @@ private Boolean getAddHistoryFailureLifetime() {
248248
}
249249

250250
private int getUseSeparateProcess() {
251-
return useSeparateProcess.getSelectedItem().toString().equals("Yes") ? 1 : 0;
251+
final String yesString = bundle.message("common.yes");
252+
253+
return useSeparateProcess.getSelectedItem().toString().equals(yesString) ? 1 : 0;
252254
}
253255

254256
private Boolean getAddUseSeparateProcess() {
@@ -261,6 +263,9 @@ private void createUIComponents() {
261263
}
262264

263265
private List<String> getYesNoOptions() {
264-
return new ArrayList<>(Arrays.asList("Yes", "No"));
266+
return new ArrayList<>(Arrays.asList(
267+
bundle.message("common.yes"),
268+
bundle.message("common.no")
269+
));
265270
}
266271
}

0 commit comments

Comments
 (0)