diff --git a/core/lib/Drupal/Core/Entity/Annotation/EntityType.php b/core/lib/Drupal/Core/Entity/Annotation/EntityType.php index 0487d03..8899bb5 100644 --- a/core/lib/Drupal/Core/Entity/Annotation/EntityType.php +++ b/core/lib/Drupal/Core/Entity/Annotation/EntityType.php @@ -134,7 +134,14 @@ class EntityType extends Plugin { public $static_cache = TRUE; /** - * Boolean indicating whether entities of this type have mutlilingual support. + * Boolean indicating whether language is supported for entities of this type. + * + * @var bool (optional) + */ + public $language_supported = TRUE; + + /** + * Boolean indicating whether entities of this type have multilingual support. * * @var bool (optional) */ diff --git a/core/modules/contact/lib/Drupal/contact/Plugin/Core/Entity/Message.php b/core/modules/contact/lib/Drupal/contact/Plugin/Core/Entity/Message.php index 4bc9dbc..75b04cc 100644 --- a/core/modules/contact/lib/Drupal/contact/Plugin/Core/Entity/Message.php +++ b/core/modules/contact/lib/Drupal/contact/Plugin/Core/Entity/Message.php @@ -29,6 +29,7 @@ * "bundle" = "category" * }, * fieldable = TRUE, + * language_supported = FALSE, * bundle_keys = { * "bundle" = "id" * } diff --git a/core/modules/file/lib/Drupal/file/Plugin/Core/Entity/File.php b/core/modules/file/lib/Drupal/file/Plugin/Core/Entity/File.php index 6e10b39..61fdf5c 100644 --- a/core/modules/file/lib/Drupal/file/Plugin/Core/Entity/File.php +++ b/core/modules/file/lib/Drupal/file/Plugin/Core/Entity/File.php @@ -24,6 +24,7 @@ * "render" = "Drupal\Core\Entity\EntityRenderController" * }, * base_table = "file_managed", + * language_supported = FALSE, * entity_keys = { * "id" = "fid", * "label" = "filename", diff --git a/core/modules/language/language.admin.inc b/core/modules/language/language.admin.inc index f59fb38..7816a90 100644 --- a/core/modules/language/language.admin.inc +++ b/core/modules/language/language.admin.inc @@ -799,6 +799,13 @@ function language_content_settings_form(array $form, array $form_state, array $s } } + asort($labels); + //uasort($supported, function ($a, $b) { + // return strnatcmp($labels[$a],$labels[$b]); + // } + //); + //dpm($supported); + $path = drupal_get_path('module', 'language'); $form = array( '#labels' => $labels, diff --git a/core/modules/language/language.module b/core/modules/language/language.module index 6bbb5a7..1efab88 100644 --- a/core/modules/language/language.module +++ b/core/modules/language/language.module @@ -201,10 +201,13 @@ function language_theme() { function language_entity_supported() { $supported = array(); foreach (entity_get_info() as $entity_type => $info) { - if (!empty($info['fieldable']) && !empty($info['translatable'])) { + // Filter to just content that has language support. Assume that anything + // with config_prefix is config and not content. + if (!empty($info['language_supported']) && empty($info['config_prefix'])) { $supported[$entity_type] = $entity_type; } } + dpm($supported); return $supported; } diff --git a/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php b/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php index 305fc33..050b9c7 100644 --- a/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php +++ b/core/modules/menu_link/lib/Drupal/menu_link/Plugin/Core/Entity/MenuLink.php @@ -31,6 +31,7 @@ * static_cache = FALSE, * base_table = "menu_links", * uri_callback = "menu_link_uri", + * language_supported = FALSE, * entity_keys = { * "id" = "mlid", * "label" = "link_title",