You are here

private function CshsOptionsFromHelper::getTranslatedValue in Client-side Hierarchical Select 8.2

Same name and namespace in other branches
  1. 8.3 src/CshsOptionsFromHelper.php \Drupal\cshs\CshsOptionsFromHelper::getTranslatedValue()

Returns the translated label.

Parameters

string $value: The value for translate.

Return value

string The translated value.

1 call to CshsOptionsFromHelper::getTranslatedValue()
CshsOptionsFromHelper::getTranslatedNoneLabel in src/CshsOptionsFromHelper.php
Returns the translated label for the "no selection" option.

File

src/CshsOptionsFromHelper.php, line 416

Class

CshsOptionsFromHelper
Defines a class for getting options for a cshs form element from vocabulary.

Namespace

Drupal\cshs

Code

private function getTranslatedValue(string $value) : string {
  $value = \trim($value);

  // phpcs:ignore Drupal.Semantics.FunctionT.NotLiteralString
  return $value === '' ? $value : (string) $this
    ->t(Html::escape($value));
}