You are here

public function CurrencyHelper::getLanguages in Commerce Currency Resolver 8

Return formatted array of languages.

Return value

array List of keyed languages ['HR' => 'Croatian'].

Overrides CurrencyHelperInterface::getLanguages

File

src/CurrencyHelper.php, line 130

Class

CurrencyHelper
Helper for various parts of the module.

Namespace

Drupal\commerce_currency_resolver

Code

public function getLanguages() {
  $languages = $this->languageManager
    ->getLanguages();
  $data = [];
  foreach ($languages as $key => $lang) {
    $data[$key] = $lang
      ->getName();
  }
  return $data;
}