public function LingotekFake::getLocales in Lingotek Translation 3.3.x
Same name and namespace in other branches
- 8 tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 8.2 tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 4.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 3.0.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 3.1.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 3.2.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 3.4.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 3.5.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 3.6.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 3.7.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
- 3.8.x tests/modules/lingotek_test/src/LingotekFake.php \Drupal\lingotek_test\LingotekFake::getLocales()
Get the available locales on Lingotek.
Return value
array Array of locales (as in de-DE, es-ES). Empty array if there is an error.
Overrides LingotekInterface::getLocales
File
- tests/
modules/ lingotek_test/ src/ LingotekFake.php, line 370
Class
Namespace
Drupal\lingotek_testCode
public function getLocales() {
if (\Drupal::state()
->get('lingotek.locales_error', FALSE)) {
throw new LingotekApiException('{"messages":["HTTP 401 Unauthorized"]}', 401);
}
return [
'es-ES',
'de-AT',
'de-DE',
];
}