পেতে কিভাবে বর্তমান ভাষা Drupal এর 8 | Drupal 8

পেতে কিভাবে বর্তমান ভাষা Drupal এর 8

Translation

The original text is written in English and This translation is Powered by Yandex.Translate. Please always refer to the english version.
Thank you for your comprehension.

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

কিভাবে পেতে বর্তমানে নির্বাচিত ভাষা (বর্তমান পাতা বা ব্যবহারকারী ভাষা) programmatically Drupal8 ?

Drupal এর 8

//পেতে lanuage কোড:
$language = \Drupal::languageManager()->getCurrentLanguage()->getId();

//পান ভাষা নাম:
$language =  \Drupal::languageManager()->getCurrentLanguage()->getName();

 

Drupal এর 7

আন্তর্জাতিক $<একটি 

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

Comments

Thonglanguage (not verified)

Fri, 08/18/2017 - 06:01

In reply to by editor

Bạn dịch như vậy cũng tốt lắm rồi, không có vấn đề gì hết. Bạn có thể xem thêm trên trang: https://thonglanguage.com

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