Snippets Collections
    let languages = ["Afrikaans","Arabic","Bengali","Bulgarian","Catalan","Cantonese","Croatian","Czech","Danish","Dutch","Lithuanian","Malay","Malayalam","Panjabi","Tamil","English","Finnish","French","German","Greek","Hebrew","Hindi","Hungarian","Indonesian","Italian","Japanese","Javanese","Korean","Norwegian","Polish","Portuguese","Romanian","Russian","Serbian","Slovak","Slovene","Spanish","Swedish","Telugu","Thai","Turkish","Ukrainian","Vietnamese","Welsh","Algerian","Aramaic","Armenian","Berber","Burmese","Bosnian","Brazilian","Bulgarian","Cypriot","Corsica","Creole","Scottish","Egyptian","Esperanto","Estonian","Finn","Flemish","Georgian","Hawaiian","Indonesian","Inuit","Irish","Icelandic","Latin","Mandarin","Nepalese","Sanskrit","Urdu","Tagalog","Tahitian","Tibetan","Gypsy","Wu"
    ]
global $language;
$lang = $language->language;
$base_node = node_load(XXXXX);

$translations = translation_node_get_translations($base_node->tnid);
$translated_node = (isset($translations[$lang])?node_load($translations[$lang]->nid):$base_node);
star

Wed Jun 01 2022 07:44:59 GMT+0000 (UTC)

#ios #swift #languages #language
star

Fri Sep 03 2021 09:25:59 GMT+0000 (UTC) https://api.drupal.org/api/drupal/modules%21translation%21translation.module/function/translation_node_get_translations/7.x

#drupal #drupal7 #node #translation #languages

Save snippets that work with our extensions

Available in the Chrome Web Store Get Firefox Add-on Get VS Code extension