public function LingotekFake::getLocalesInfo in Lingotek Translation 8.2
Same name and namespace in other branches
- 4.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
- 3.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
- 3.1.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
- 3.2.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
- 3.3.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
- 3.4.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
- 3.5.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
- 3.6.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
- 3.7.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
- 3.8.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocalesInfo()
Get the available locales on Lingotek.
Return value
array Array of locales. Empty array if there is an error. The array has the locale as key, and the value is a nested array with the following keys: code, language_code, title, language, country_code, and country.
Overrides LingotekInterface::getLocalesInfo
File
- tests/
modules/ lingotek_test/ src/ LingotekFake.php, line 439
Class
Namespace
Drupal\lingotek_testCode
public function getLocalesInfo() {
if (\Drupal::state()
->get('lingotek.locales_error', FALSE)) {
throw new LingotekApiException('{"messages":["HTTP 401 Unauthorized"]}', 401);
}
return [
'es-ES' => [
'code' => 'es-ES',
'language_code' => 'ES',
'title' => 'Spanish (Spain)',
'language' => 'Spanish',
'country_code' => 'ES',
'country' => 'Spain',
],
'de-AT' => [
'code' => 'de-AT',
'language_code' => 'DE',
'title' => 'German (Austria)',
'language' => 'German',
'country_code' => 'AT',
'country' => 'Austria',
],
'de-DE' => [
'code' => 'de-DE',
'language_code' => 'DE',
'title' => 'German (Germany)',
'language' => 'German',
'country_code' => 'DE',
'country' => 'Germany',
],
];
}