I've been trying to look for a way on how to optimize theme suggestions for different languages. The code below is a snippet of what I have been working on.
One is for english and one is for Spanish. Is there a way I can minimize this into a single code instead of breaking it down for multiple languages?
// Template based on current url
// News Press Room
if ($current_url == '/iom/news-press-room') {
$suggestions[] = 'page__news_press_room';
}
// News Press Room(Spanish)
if ($current_url == '/iom/es/news-press-room') {
$suggestions[] = 'page__news_press_room';
}
node
, independently from the alias or language prefix in the path. – 4k4 Sep 18 '18 at 11:12