1<?php 2 3namespace Drupal\language_test\Plugin\LanguageNegotiation; 4 5use Drupal\language\LanguageNegotiationMethodBase; 6use Symfony\Component\HttpFoundation\Request; 7 8/** 9 * Class for identifying language from a selected language. 10 * 11 * @LanguageNegotiation( 12 * id = "test_language_negotiation_method", 13 * weight = -10, 14 * name = @Translation("Test"), 15 * description = @Translation("This is a test language negotiation method."), 16 * types = {Drupal\Core\Language\LanguageInterface::TYPE_CONTENT, 17 * "test_language_type", "fixed_test_language_type"} 18 * ) 19 */ 20class LanguageNegotiationTest extends LanguageNegotiationMethodBase { 21 22 /** 23 * The language negotiation method id. 24 */ 25 const METHOD_ID = 'test_language_negotiation_method'; 26 27 /** 28 * {@inheritdoc} 29 */ 30 public function getLangcode(Request $request = NULL) { 31 return 'it'; 32 } 33 34} 35