Gördüğünüz 8 mevcut dili nasıl | Drupal 8

Gördüğünüz 8 mevcut dili nasıl

Submitted by editor on Fri, 11/06/2015 - 10:57
Question

programlı Drupal8 (geçerli sayfa veya kullanıcı dili) seçili olan dili Nasıl ?

Siteye 8

//Ankara kodu
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();

//dil adı:
$language =  \Drupal::languageManager()->getCurrentLanguage()->getName();

 

 

Drupal 7

global $language;
$language=$language->language;

Comments

funnyjokes

Thu, 04/12/2018 - 05:40

In reply to by editor

The information you share is very useful. It is closely related to my work and has helped me grow. Thank you!
color switch

Navneet Singh (not verified)

Sun, 01/15/2017 - 10:18

Drupal 7:

global $language;
// return lang code;
return $language->language;

Drupal 8:

return $language = \Drupal::languageManager()->getCurrentLanguage()->getId();

Add new comment