You are here

public static function LabelHelper::getLocalityLabel in Address 8

Gets the locality label for the given type.

Parameters

string $locality_type: The locality type.

Return value

string The locality label.

1 call to LabelHelper::getLocalityLabel()
LabelHelper::getFieldLabels in src/LabelHelper.php
Gets the field labels suitable for the given address format.

File

src/LabelHelper.php, line 129

Class

LabelHelper
Provides translated labels for the library enums.

Namespace

Drupal\address

Code

public static function getLocalityLabel($locality_type) {
  if (!$locality_type) {
    return NULL;
  }
  LocalityType::assertExists($locality_type);
  $labels = self::getLocalityLabels();
  return $labels[$locality_type];
}