Returns the localized links for the given path.
@returns A renderable array of language switch links.
string $path: The path for which language switch links should be provided.
function _translation_entity_get_switch_links($path) {
$links = language_negotiation_get_switch_links(Language::TYPE_CONTENT, $path);
if (empty($links)) {
// If content language is set up to fall back to the interface language,
// then there will be no switch links for Language::TYPE_CONTENT, ergo we
// also need to use interface switch links.
$links = language_negotiation_get_switch_links(Language::TYPE_INTERFACE, $path);
}
return $links;
}