protected function LingotekConfigManagementForm::formatTranslations in Lingotek Translation 3.6.x
Same name and namespace in other branches
- 8 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 8.2 src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 4.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 3.0.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 3.1.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 3.2.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 3.3.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 3.4.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 3.5.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 3.7.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
- 3.8.x src/Form/LingotekConfigManagementForm.php \Drupal\lingotek\Form\LingotekConfigManagementForm::formatTranslations()
Formats the translation statuses for display.
Parameters
\Drupal\config_translation\ConfigMapperInterface $mapper: The mapper.
array $translations: Pairs of language - status.
Return value
array A render array.
1 call to LingotekConfigManagementForm::formatTranslations()
- LingotekConfigManagementForm::getTranslationsStatuses in src/
Form/ LingotekConfigManagementForm.php - Gets the translation status of an entity in a format ready to display.
File
- src/
Form/ LingotekConfigManagementForm.php, line 1569
Class
- LingotekConfigManagementForm
- Form for bulk management of content.
Namespace
Drupal\lingotek\FormCode
protected function formatTranslations(ConfigMapperInterface $mapper, array $translations) {
$languages = [];
foreach ($translations as $langcode => $data) {
if ($this->languageManager
->getLanguage($langcode)) {
$languages[] = [
'language' => $langcode,
'status' => $data['status'],
'status_text' => $this
->getTargetStatusText($mapper, $data['status'], $langcode),
'url' => $data['url'],
'new_window' => $data['new_window'],
];
}
}
return [
'data' => [
'#type' => 'lingotek_target_statuses',
'#mapper' => $mapper,
'#source_langcode' => $mapper
->getLangcode(),
'#statuses' => $languages,
],
];
}