function ConfigTranslationHooks::help
Implements hook_help().
File
-
core/
modules/ config_translation/ src/ Hook/ ConfigTranslationHooks.php, line 20
Class
- ConfigTranslationHooks
- Hook implementations for config_translation.
Namespace
Drupal\config_translation\HookCode
public function help($route_name, RouteMatchInterface $route_match) {
switch ($route_name) {
case 'help.page.config_translation':
$output = '';
$output .= '<h2>' . t('About') . '</h2>';
$output .= '<p>' . t('The Configuration Translation module allows you to translate configuration text; for example, the site name, vocabularies, menus, or date formats. Together with the modules <a href=":language">Language</a>, <a href=":content-translation">Content Translation</a>, and <a href=":locale">Interface Translation</a>, it allows you to build multilingual websites. For more information, see the <a href=":doc_url">online documentation for the Configuration Translation module</a>.', [
':doc_url' => 'https://www.drupal.org/documentation/modules/config_translation',
':config' => Url::fromRoute('help.page', [
'name' => 'config',
])->toString(),
':language' => Url::fromRoute('help.page', [
'name' => 'language',
])->toString(),
':locale' => Url::fromRoute('help.page', [
'name' => 'locale',
])->toString(),
':content-translation' => \Drupal::moduleHandler()->moduleExists('content_translation') ? Url::fromRoute('help.page', [
'name' => 'content_translation',
])->toString() : '#',
]) . '</p>';
$output .= '<h2>' . t('Uses') . '</h2>';
$output .= '<dl>';
$output .= '<dt>' . t('Enabling translation') . '</dt>';
$output .= '<dd>' . t('In order to translate configuration, the website must have at least two <a href=":url">languages</a>.', [
':url' => Url::fromRoute('entity.configurable_language.collection')->toString(),
]) . '</dd>';
$output .= '<dt>' . t('Translating configuration text') . '</dt>';
$output .= '<dd>' . t('Users with the <em>Translate user edited configuration</em> permission can access the configuration translation overview, and manage translations for specific languages. The <a href=":translation-page">Configuration translation</a> page shows a list of all configuration text that can be translated, either as individual items or as lists. After you click on <em>Translate</em>, you are provided with a list of all languages. You can <em>add</em> or <em>edit</em> a translation for a specific language. Users with specific configuration permissions can also <em>edit</em> the text for the site\'s default language. For some configuration text items (for example for the site information), the specific translation pages can also be accessed directly from their configuration pages.', [
':translation-page' => Url::fromRoute('config_translation.mapper_list')->toString(),
]) . '</dd>';
$output .= '<dt>' . t('Translating date formats') . '</dt>';
$output .= '<dd>' . t('You can choose to translate date formats on the <a href=":translation-page">Configuration translation</a> page. This allows you not only to translate the label text, but also to set a language-specific <em>PHP date format</em>.', [
':translation-page' => Url::fromRoute('config_translation.mapper_list')->toString(),
]) . '</dd>';
$output .= '</dl>';
return $output;
case 'config_translation.mapper_list':
$output = '<p>' . t('This page lists all configuration items on your site that have translatable text, like your site name, role names, etc.') . '</p>';
return $output;
}
}
Buggy or inaccurate documentation? Please file an issue. Need support? Need help programming? Connect with the Drupal community.