Skip to content

Commit 13b2b9b

Browse files
author
Markus Günther
committed
[FEATURE] Localize the index queue backend module
1 parent 49f0d67 commit 13b2b9b

File tree

3 files changed

+115
-27
lines changed

3 files changed

+115
-27
lines changed

Classes/Backend/SolrModule/IndexQueueModuleController.php

Lines changed: 13 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@
2727
use TYPO3\CMS\Core\Messaging\FlashMessage;
2828
use TYPO3\CMS\Core\Utility\GeneralUtility;
2929
use TYPO3\CMS\Core\Database\DatabaseConnection;
30+
use TYPO3\CMS\Extbase\Utility\LocalizationUtility;
3031

3132
/**
3233
* Index Queue Module
@@ -86,9 +87,11 @@ public function initializeIndexQueueAction() {
8687
);
8788
}
8889
} else {
90+
$messageLabel = 'solr.backend.index_queue_module.flashmessage.initialize.no_selection';
91+
$titleLabel = 'solr.backend.index_queue_module.flashmessage.not_initialized.title';
8992
$this->addFlashMessage(
90-
'No indexing configurations selected.',
91-
'Index Queue not initialized',
93+
LocalizationUtility::translate($messageLabel, 'Solr'),
94+
LocalizationUtility::translate($titleLabel, 'Solr'),
9295
FlashMessage::WARNING
9396
);
9497
}
@@ -103,9 +106,11 @@ public function initializeIndexQueueAction() {
103106
}
104107

105108
if (!empty($initializedIndexingConfigurations)) {
109+
$messageLabel = 'solr.backend.index_queue_module.flashmessage.initialize.success';
110+
$titleLabel = 'solr.backend.index_queue_module.flashmessage.initialize.title';
106111
$this->addFlashMessage(
107-
'Initialized indexing configurations: ' . implode(', ', $messagesForConfigurations),
108-
'Index Queue initialized',
112+
LocalizationUtility::translate($messageLabel, 'Solr', array(implode(', ', $messagesForConfigurations))),
113+
LocalizationUtility::translate($titleLabel, 'Solr'),
109114
FlashMessage::OK
110115
);
111116
}
@@ -123,16 +128,16 @@ public function flushLogErrorsAction() {
123128
$database = $GLOBALS['TYPO3_DB'];
124129
$flushResult = $database->exec_UPDATEquery('tx_solr_indexqueue_item', 'errors NOT LIKE ""', array('errors' => ''));
125130

126-
$message = 'All errors has been flushed';
131+
$label = 'solr.backend.index_queue_module.flashmessage.success.flush_errors';
127132
$severity = FlashMessage::OK;
128133
if (!$flushResult) {
129-
$message = 'An error occured while removing the error log in the index queue.';
134+
$label = 'solr.backend.index_queue_module.flashmessage.error.flush_errors';
130135
$severity = FlashMessage::ERROR;
131136
}
132137

133138
$this->addFlashMessage(
134-
$message,
135-
'Index Queue errors',
139+
LocalizationUtility::translate($label, 'Solr'),
140+
LocalizationUtility::translate('solr.backend.index_queue_module.flashmessage.title', 'Solr'),
136141
$severity
137142
);
138143

Lines changed: 70 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,70 @@
1+
<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
2+
<xliff version="1.0">
3+
<file source-language="en" datatype="plaintext" original="messages" date="2015-03-30T11:42:09Z">
4+
<header>
5+
<generator>LFEditor</generator>
6+
</header>
7+
<body>
8+
<trans-unit id="solr.backend.index_queue_module.description" xml:space="preserve">
9+
<source>The Index Queue manages content indexing. Content enters the Index Queue by initialization below or when new content is created based on configuration. Items in the Index Queue are indexed newest changes first until all items in the queue have been indexed.</source>
10+
</trans-unit>
11+
<trans-unit id="solr.backend.index_queue_module.errors.flush_button" xml:space="preserve">
12+
<source>Flush errors</source>
13+
</trans-unit>
14+
<trans-unit id="solr.backend.index_queue_module.errors.headline" xml:space="preserve">
15+
<source>Indexing Errors</source>
16+
</trans-unit>
17+
<trans-unit id="solr.backend.index_queue_module.errors.id" xml:space="preserve">
18+
<source>ID</source>
19+
</trans-unit>
20+
<trans-unit id="solr.backend.index_queue_module.errors.item_type" xml:space="preserve">
21+
<source>Item Type</source>
22+
</trans-unit>
23+
<trans-unit id="solr.backend.index_queue_module.errors.item_uid" xml:space="preserve">
24+
<source>Item UID</source>
25+
</trans-unit>
26+
<trans-unit id="solr.backend.index_queue_module.errors.show_button" xml:space="preserve">
27+
<source>Show error</source>
28+
</trans-unit>
29+
<trans-unit id="solr.backend.index_queue_module.flashmessage.error.flush_errors" xml:space="preserve">
30+
<source>An error occured while removing the error log in the index queue.</source>
31+
</trans-unit>
32+
<trans-unit id="solr.backend.index_queue_module.flashmessage.initialize.no_selection" xml:space="preserve">
33+
<source>No indexing configurations selected.</source>
34+
</trans-unit>
35+
<trans-unit id="solr.backend.index_queue_module.flashmessage.initialize.success" xml:space="preserve">
36+
<source>Initialized indexing configurations: %s</source>
37+
</trans-unit>
38+
<trans-unit id="solr.backend.index_queue_module.flashmessage.initialize.title" xml:space="preserve">
39+
<source>Index Queue initialized</source>
40+
</trans-unit>
41+
<trans-unit id="solr.backend.index_queue_module.flashmessage.not_initialized.title" xml:space="preserve">
42+
<source>Index Queue not initialized</source>
43+
</trans-unit>
44+
<trans-unit id="solr.backend.index_queue_module.flashmessage.success.flush_errors" xml:space="preserve">
45+
<source>All errors have been reset.</source>
46+
</trans-unit>
47+
<trans-unit id="solr.backend.index_queue_module.flashmessage.title" xml:space="preserve">
48+
<source>Index Queue</source>
49+
</trans-unit>
50+
<trans-unit id="solr.backend.index_queue_module.help" xml:space="preserve">
51+
<source>Initializing the Index Queue is the most complete way to force re-indexing, or to build the Index Queue for the first time. The Index Queue Worker scheduler task will then index the items listed in the Index Queue.</source>
52+
</trans-unit>
53+
<trans-unit id="solr.backend.index_queue_module.status.errors" xml:space="preserve">
54+
<source> Errors:</source>
55+
</trans-unit>
56+
<trans-unit id="solr.backend.index_queue_module.status.headline" xml:space="preserve">
57+
<source>Index Queue Status</source>
58+
</trans-unit>
59+
<trans-unit id="solr.backend.index_queue_module.status.indexed" xml:space="preserve">
60+
<source> Indexed:</source>
61+
</trans-unit>
62+
<trans-unit id="solr.backend.index_queue_module.status.pending" xml:space="preserve">
63+
<source> Pending:</source>
64+
</trans-unit>
65+
<trans-unit id="solr.backend.index_queue_module.title" xml:space="preserve">
66+
<source>Index Queue Initialization</source>
67+
</trans-unit>
68+
</body>
69+
</file>
70+
</xliff>

Resources/Private/Templates/IndexQueueModule/Index.html

Lines changed: 32 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -8,25 +8,21 @@
88

99

1010
<div class="well">
11-
The Index Queue manages content indexing. Content enters the Index
12-
Queue by initialization below or when new content is created based on
13-
configuration. Items in the Index Queue are indexed newest changes first
14-
until all items in the queue have been indexed.
11+
<f:translate key="solr.backend.index_queue_module.description" />
1512
</div>
1613

1714

1815

19-
<h2>Index Queue Initialization</h2>
16+
<h2>
17+
<f:translate key="solr.backend.index_queue_module.title" />
18+
</h2>
2019

2120
<f:form name="editform" actionUri="{f:uri.action(controller:'Administration', arguments:{module:'{module.name}', moduleAction:'initializeIndexQueue'} )}">
2221

2322
<f:format.raw>{indexQueueInitializationSelector}</f:format.raw>
2423
<f:form.submit name="initializeIndexQueue" value="Queue Selected Content for Indexing" />
2524
<solr:backend.button.HelpButton title="Index Queue Initialization">
26-
Initializing the Index Queue is the most complete way to force
27-
re-indexing, or to build the Index Queue for the first time. The Index
28-
Queue Worker scheduler task will then index the items listed in the
29-
Index Queue.
25+
<f:translate key="solr.backend.index_queue_module.help" />
3026
</solr:backend.button.HelpButton>
3127

3228
</f:form>
@@ -41,13 +37,21 @@ <h2>Index Queue Initialization</h2>
4137

4238
<div class="row-fluid">
4339
<div class="span8 well">
44-
<h2>Indexing Errors</h2>
40+
<h2>
41+
<f:translate key="solr.backend.index_queue_module.errors.headline" />
42+
</h2>
4543

4644
<table class="table">
4745
<tr>
48-
<th>ID</th>
49-
<th>Item Type</th>
50-
<th>Item UID</th>
46+
<th>
47+
<f:translate key="solr.backend.index_queue_module.errors.id" />
48+
</th>
49+
<th>
50+
<f:translate key="solr.backend.index_queue_module.errors.item_type" />
51+
</th>
52+
<th>
53+
<f:translate key="solr.backend.index_queue_module.errors.item_uid" />
54+
</th>
5155
<th></th>
5256
</tr>
5357

@@ -60,35 +64,44 @@ <h2>Indexing Errors</h2>
6064
<script type="text/plain">
6165
{item.errors}
6266
</script>
63-
<a href="javascript:void(0);" class="show_error">Show error</a>
67+
<a href="javascript:void(0);" class="show_error">
68+
<f:translate key="solr.backend.index_queue_module.errors.show_button" />
69+
</a>
6470
</td>
6571
</tr>
6672
</f:for>
6773
</table>
6874

6975
<f:if condition="{indexqueue_errors}">
7076
<a href="{f:uri.action(controller:'Administration', arguments:{module:'{module.name}', moduleAction:'flushLogErrors'} )}"
71-
class="btn btn-default" >Flush errors</a>
77+
class="btn btn-default" >
78+
<f:translate key="solr.backend.index_queue_module.errors.flush_button" />
79+
</a>
7280
</f:if>
7381
</div>
7482

7583
<div class="span4 well stats_container">
76-
<h2>Index Queue Status</h2>
84+
<h2>
85+
<f:translate key="solr.backend.index_queue_module.status.headline" />
86+
</h2>
7787

7888
<canvas id="indexqueue_stats_chart" width="100" height="100"></canvas>
7989

8090
<div style="clear: both;"></div>
8191

8292
<div class="legend">
83-
<span class="color" style="background: #EB813F;"></span> Pending:
93+
<span class="color" style="background: #EB813F;"></span>
94+
<f:translate key="solr.backend.index_queue_module.status.pending" />
8495
<span id="pending_numbers"></span>
8596
</div>
8697
<div class="legend">
87-
<span class="color" style="background: #FF3D3D;"></span> Errors:
98+
<span class="color" style="background: #FF3D3D;"></span>
99+
<f:translate key="solr.backend.index_queue_module.status.errors" />
88100
<span id="error_numbers"></span>
89101
</div>
90102
<div class="legend">
91-
<span class="color" style="background: #9FC299;"></span> Indexed:
103+
<span class="color" style="background: #9FC299;"></span>
104+
<f:translate key="solr.backend.index_queue_module.status.indexed" />
92105
<span id="indexed_numbers"></span>
93106
</div>
94107
</div>

0 commit comments

Comments
 (0)