Skip to content

Commit

Permalink
Merge pull request #3485 from rbayet/feat-healthcheck-tweaks-i18n
Browse files Browse the repository at this point in the history
[Healthchecks] tweaks and i18n
  • Loading branch information
rbayet authored Jan 14, 2025
2 parents dd36854 + 0700a10 commit 2efd9cf
Show file tree
Hide file tree
Showing 13 changed files with 100 additions and 58 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -80,18 +80,25 @@ public function getDescription(): string
if ($ghostCount > 0) {
// Description when ghost indices are found.
// @codingStandardsIgnoreStart
return __(
'You have <strong>%1 ghost indices</strong>. Ghost indices have a footprint on your Elasticsearch cluster health. '
. 'You should consider removing them.<br/>'
. 'Click <a href="%2"><strong>here</strong></a> to go to the <strong>Elasticsuite Indices</strong> page to take appropriate actions.',
$ghostCount,
$this->getElasticsuiteIndicesUrl()
return implode(
'<br />',
[
__(
'You have <strong>%1 ghost indices</strong>. Ghost indices have a footprint on your Elasticsearch cluster health. '
. 'You should consider removing them.',
$ghostCount
),
__(
'Click <a href="%1"><strong>here</strong></a> to go to the <strong>Elasticsuite Indices</strong> page to take appropriate actions.',
$this->getElasticsuiteIndicesUrl()
)
]
);
// @codingStandardsIgnoreEnd
}

// Description when no ghost indices are found.
return __('There are no ghost indexes in your Elasticsearch cluster. No action is required at this time.');
return __('There are no ghost indices in your Elasticsearch cluster. No action is required at this time.');
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
*
* Checks for shard misconfigurations in the Elasticsearch cluster.
*/
class ShardsConfigCheck implements CheckInterface
class PrimaryShardsConfigCheck implements CheckInterface
{
/**
* Route to Stores -> Configuration section.
Expand Down Expand Up @@ -83,7 +83,7 @@ public function __construct(
*/
public function getIdentifier(): string
{
return 'shards_config_check';
return 'primary_shards_config_check';
}

/**
Expand All @@ -101,14 +101,23 @@ public function getDescription(): string
if ($status === CheckInterface::WARNING_STATUS) {
// Description when the shard's configuration is incorrect.
// @codingStandardsIgnoreStart
return __(
'The number of shards configured for Elasticsuite <strong>is incorrect.</strong> '
. 'You don\'t need to use <strong>%1 shards</strong> since your biggest Elasticsuite index is only <strong>%2</strong>.<br/>'
. 'Click <a href="%3"><strong>here</strong></a> to go to the <strong>Elasticsuite Basic Settings</strong> page and change your <strong>Number of Shards per Index</strong> parameter according to our <a href="%4" target="_blank"><strong>Wiki page</strong></a>.',
$numberOfShards,
$maxIndexSize['human_size'],
$this->getElasticsuiteConfigUrl(),
self::ES_INDICES_SETTINGS_WIKI_PAGE
return implode(
'<br />',
[
__(
'The <strong>number of shards</strong> configured for Elasticsuite is <strong>incorrect</strong>.'
),
__(
'You do not need to use <strong>%1 shards</strong> since your biggest Elasticsuite index is only <strong>%2</strong>.',
$numberOfShards,
$maxIndexSize['human_size']
),
__(
'Click <a href="%1"><strong>here</strong></a> to go to the <strong>Elasticsuite Config</strong> page and change your <strong>Number of Shards per Index</strong> parameter according to our <a href="%2" target="_blank"><strong>Wiki page</strong></a>.',
$this->getElasticsuiteConfigUrl(),
self::ES_INDICES_SETTINGS_WIKI_PAGE
)
]
);
// @codingStandardsIgnoreEnd
}
Expand Down Expand Up @@ -142,7 +151,7 @@ public function getStatus(): string
*/
public function getSortOrder(): int
{
return 30; // Adjust as necessary.
return 20; // Adjust as necessary.
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -95,14 +95,20 @@ public function getDescription(): string
if ($status === CheckInterface::WARNING_STATUS) {
// Description when the replicas configuration is incorrect.
// @codingStandardsIgnoreStart
return __(
'The number of replicas configured for Elasticsuite <strong>is incorrect.</strong> '
. 'You can\'t use <strong>%1 replicas</strong> since there is only <strong>%2 nodes</strong> in your Elasticsearch cluster.<br/>'
. 'Click <a href="%3"><strong>here</strong></a> to go to the <strong>Elasticsuite Basic Settings</strong> page and change your <strong>Number of Replicas per Index</strong> parameter according to our <a href="%4" target="_blank"><strong>Wiki page</strong></a>.',
$this->helper->getNumberOfReplicas(),
$this->getNumberOfNodes(),
$this->getElasticsuiteConfigUrl(),
self::ES_INDICES_SETTINGS_WIKI_PAGE
return implode(
'<br />',
[
__(
'The <strong>number of replicas</strong> configured for Elasticsuite is <strong>incorrect</strong>. You cannot use <strong>%1 replicas</strong> since there is only <strong>%2 nodes</strong> in your Elasticsearch cluster.',
$this->helper->getNumberOfReplicas(),
$this->getNumberOfNodes()
),
__(
'Click <a href="%1"><strong>here</strong></a> to go to the <strong>Elasticsuite Config</strong> page and change your <strong>Number of Replicas per Index</strong> parameter according to our <a href="%2" target="_blank"><strong>Wiki page</strong></a>.',
$this->getElasticsuiteConfigUrl(),
self::ES_INDICES_SETTINGS_WIKI_PAGE
),
]
);
// @codingStandardsIgnoreEnd
}
Expand Down Expand Up @@ -135,7 +141,7 @@ public function getStatus(): string
*/
public function getSortOrder(): int
{
return 20; // Adjust as necessary.
return 30; // Adjust as necessary.
}

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -86,8 +86,8 @@ public function getText()

// @codingStandardsIgnoreStart
return __(
'You have <strong>%1 health checks</strong> in a <strong>warning</strong> state. '
. 'Please head to the <a href="%2"><strong>Elasticsuite Healthcheck</strong></a> page to get more details and see how to fix them.',
'You have <strong>%1 health checks</strong> in <strong>Warning</strong> state. '
. 'We invite you to head to the <a href="%2"><strong>Elasticsuite Healthcheck</strong></a> page to get more details and to see how to fix them.',
$issuesCount,
$this->getElasticsuiteHealthcheckUrl()
);
Expand Down
2 changes: 1 addition & 1 deletion src/module-elasticsuite-core/etc/adminhtml/di.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
<arguments>
<argument name="checks" xsi:type="array">
<item name="ghost_indices_check" xsi:type="object">Smile\ElasticsuiteCore\Model\Healthcheck\GhostIndicesCheck</item>
<item name="shards_config_check" xsi:type="object">Smile\ElasticsuiteCore\Model\Healthcheck\ShardsConfigCheck</item>
<item name="primary_shards_config_check" xsi:type="object">Smile\ElasticsuiteCore\Model\Healthcheck\PrimaryShardsConfigCheck</item>
<item name="replicas_config_check" xsi:type="object">Smile\ElasticsuiteCore\Model\Healthcheck\ReplicasConfigCheck</item>
</argument>
</arguments>
Expand Down
14 changes: 12 additions & 2 deletions src/module-elasticsuite-core/i18n/de_DE.csv
Original file line number Diff line number Diff line change
Expand Up @@ -74,8 +74,6 @@
"Search engine powered by %1","Suchmaschine unterstützt von %1"
"Miscellaneous","Sonstiges"
"The value should be different to zero.","Der Wert sollte sich von Null unterscheiden."
"The number of replicas configured for Elasticsuite is incorrect. You cannot use <strong>%1 replicas</strong> since there is only <strong>%2 nodes</strong> in your Elasticsearch cluster.","Die Anzahl der Repliken, die für Elasticsuite konfiguriert wurden, ist falsch. Sie können <strong>%1 Repliken</strong> nicht verwenden, da es nur <strong>%2 Knoten</strong> in Ihrem Elasticsearch Cluster gibt."
"Click here to go to the <a href=""%1""><strong>Elasticsuite Config</strong></a> page and change your <strong>Number of Replicas per Index</strong> parameter according to our <a href=""%2"" target=""_blank""><strong>wiki page</strong></a>.","Klicken Sie hier, um zur <a href=""%1""><strong>Elasticsuite Konfiguration</strong></a> Seite zu wechseln und Ihre <strong>Anzahl der Replikas pro Index</strong> Parameter entsprechend unserer <a href=""%2"" target=""_blank""><strong>Wiki-Seite</strong></a> zu ändern."
"Span Match Configuration","Span Match Konfiguration"
"Enable Boost on Span Match","Boost bei Span Match aktivieren"
"Span Match Boost Value","Span Match Boost Wert"
Expand Down Expand Up @@ -120,3 +118,15 @@
"If enabled, when indexing a reference like ""DC3000"", it will be as if ""DC3"" was indexed instead (leading to independant elements ""DC"", ""3"" and ""DC3"" in the search index). This will allow someone searching for ""dc3"" or ""dc 3"" to find the product with the exact ""DC3000"" sku.","Wenn aktiviert, wenn eine Referenz wie ""DC3000"" indiziert wird wird es sein, als ob ""DC3"" stattdessen indiziert wurde (was zu unabhängigen Elementen ""DC"", ""3"" und ""DC3"" im Suchindex). Dadurch kann jemand, der nach ""dc3"" oder ""dc 3"" sucht, das Produkt mit dem genauen ""DC3000"" sku finden."
"Reduce series of contiguous zeroes in numeric parts","Reduziert die Serie der angrenzenden Nullen in numerischen Teilen"
"If enabled, when indexing a reference like ""PL20004"", it will be as if ""PL204"" was indexed instead (leading to independant elements ""PL"", ""204"" and ""PL204"" in the search index). This will allow someone searching for ""pl204"", ""pl 204"", ""pl2004"" or ""pl 2004"" to find the product with the exact ""PL2004"" sku.","Wenn aktiviert, wenn eine Referenz wie ""PL20004"" indiziert wird wird es sein, als ob ""PL204"" stattdessen indiziert wurde (was zu unabhängigen Elementen ""PL"", ""204"" und ""PL204"" im Suchindex führt). Dadurch kann jemand, der nach ""pl204"", ""pl 204"", ""pl2004"" oder ""pl 2004"" sucht, das Produkt mit dem genauen ""PL2004"" sku finden."
"You have <strong>%1 health checks</strong> in <strong>Warning</strong> state. We invite you to head to the <a href=""%2""><strong>Elasticsuite Healthcheck</strong></a> page to get more details and to see how to fix them.","Sie haben <strong>%1 Gesundheitsprüfungen</strong> im Status <strong>Warnung</strong>. Wir laden Sie ein, die Seite <a href=""%2""><strong>Elasticsuite Healthcheck</strong></a> zu besuchen, um weitere Details zu erhalten und zu erfahren, wie Sie diese beheben können."
"The number of shards is properly configured for the Elasticsearch cluster. No action is required at this time.","Die Anzahl der Sherben ist für den Elasticsearch-Cluster ordnungsgemäß konfiguriert. Derzeit sind keine Maßnahmen erforderlich."
"The <strong>number of shards</strong> configured for Elasticsuite is <strong>incorrect</strong>.","Die <strong>Anzahl der Scherben</strong> für Elasticsuite konfigurierten ist <strong>falsch</strong>."
"You do not need to use <strong>%1 shards</strong> since your biggest Elasticsuite index is only <strong>%2</strong>.","Sie müssen keine <strong>%1 Scherben</strong> verwenden, da Ihr größter Elasticsuite-Index nur <strong>%2</strong> ist."
"Click <a href=""%1""><strong>here</strong></a> to go to the <strong>Elasticsuite Config</strong> page and change your <strong>Number of Shards per Index</strong> parameter according to our <a href=""%2"" target=""_blank""><strong>Wiki page</strong></a>.","Klicken Sie <a href=""%1""><strong>hier</strong></a>, um zur <strong>Elasticsuite Konfiguration</strong> Seite zu wechseln und Ihre <strong>Anzahl der Scherben pro Index</strong> Parameter entsprechend unserer <a href=""%2"" target=""_blank""><strong>Wiki-Seite</strong></a> zu ändern."
"The number of replicas is properly configured for the Elasticsearch cluster. No action is required at this time.","Die Anzahl der Replikate ist für den Elasticsearch-Cluster ordnungsgemäß konfiguriert. Derzeit sind keine Maßnahmen erforderlich."
"The <strong>number of replicas</strong> configured for Elasticsuite is <strong>incorrect</strong>. You cannot use <strong>%1 replicas</strong> since there is only <strong>%2 nodes</strong> in your Elasticsearch cluster.","Die <strong>Anzahl der Repliken</strong>, die für Elasticsuite konfiguriert wurden, ist <strong>falsch</strong>. Sie können <strong>%1 Repliken</strong> nicht verwenden, da es nur <strong>%2 Knoten</strong> in Ihrem Elasticsearch Cluster gibt."
"Click <a href=""%1""><strong>here</strong></a> to go to the <strong>Elasticsuite Config</strong> page and change your <strong>Number of Replicas per Index</strong> parameter according to our <a href=""%2"" target=""_blank""><strong>Wiki page</strong></a>.","Klicken Sie <a href=""%1""><strong>hier</strong></a>, um zur <strong>Elasticsuite Konfiguration</strong> Seite zu wechseln und Ihre <strong>Anzahl der Replikas pro Index</strong> Parameter entsprechend unserer <a href=""%2"" target=""_blank""><strong>Wiki-Seite</strong></a> zu ändern."
"There are no ghost indices in your Elasticsearch cluster. No action is required at this time.","In Ihrem Elasticsearch-Cluster gibt es keine Geisterindizes. Derzeit sind keine Maßnahmen erforderlich."
"You have <strong>%1 ghost indices</strong>. Ghost indices have a footprint on your Elasticsearch cluster health. You should consider removing them.","Sie haben <strong>%1 Geister-Indizes</strong>. Geister-Indizes haben einen Fußabdruck auf Ihrer Elasticsearch Cluster-Gesundheit. Sie sollten in Erwägung ziehen, sie zu entfernen."
"Click here to go to the <a href=""%1""><strong>Elasticsuite Indices</strong></a> page to take appropriate actions.","Klicken Sie hier, um zu den <a href=""%1""><strong>Elasticsuite Indizes</strong></a> Seite zu gelangen, um entsprechende Aktionen durchzuführen."
"Click <a href=""%1""><strong>here</strong></a> to go to the <strong>Elasticsuite Indices</strong> page to take appropriate actions.","Klicken Sie <a href=""%1""><strong>hier</<strong></a>, um zu den <strong>Elasticsuite Indizes</strong> Seite zu gelangen, um entsprechende Aktionen durchzuführen."
Loading

0 comments on commit 2efd9cf

Please sign in to comment.