Skip to content
Snippets Groups Projects
Commit 05298632 authored by Rajab Natshah's avatar Rajab Natshah
Browse files

Issue #2845837: [8.4.x] Fixed issues with installing varbase with Arabic or...

Issue #2845837: [8.4.x] Fixed issues with installing varbase with Arabic or French as the default language of install and default language for the site.
parent 16515acc
No related branches found
No related tags found
No related merge requests found
...@@ -115,6 +115,7 @@ class AssemblerForm extends FormBase { ...@@ -115,6 +115,7 @@ class AssemblerForm extends FormBase {
'continue' => [ 'continue' => [
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Assemble and install'), '#value' => $this->t('Assemble and install'),
'#button_type' => 'primary',
], ],
'#type' => 'actions', '#type' => 'actions',
'#weight' => 5, '#weight' => 5,
......
...@@ -8,8 +8,6 @@ use Drupal\Core\Form\FormStateInterface; ...@@ -8,8 +8,6 @@ use Drupal\Core\Form\FormStateInterface;
use Drupal\Core\StringTranslation\TranslationInterface; use Drupal\Core\StringTranslation\TranslationInterface;
use Symfony\Component\DependencyInjection\ContainerInterface; use Symfony\Component\DependencyInjection\ContainerInterface;
use Drupal\Core\Language\LanguageManager; use Drupal\Core\Language\LanguageManager;
use Symfony\Component\HttpFoundation\Request;
use Drupal\Component\Utility\UserAgent;
/** /**
* Defines form for selecting Varbase's Multiligual configuration options form. * Defines form for selecting Varbase's Multiligual configuration options form.
...@@ -90,19 +88,18 @@ class ConfigureMultilingualForm extends FormBase { ...@@ -90,19 +88,18 @@ class ConfigureMultilingualForm extends FormBase {
} }
asort($select_options); asort($select_options);
$request = Request::createFromGlobals(); $default_langcode = \Drupal::configFactory()->getEditable('system.site')->get('default_langcode');
$browser_langcode = UserAgent::getBestMatchingLangcode($request->server->get('HTTP_ACCEPT_LANGUAGE'), $browser_options);
// Save the default language name. // Save the default language name.
$default_language_name = $select_options[$browser_langcode]; $default_language_name = $select_options[$default_langcode];
// Remove the default language from the list of multilingual languages. // Remove the default language from the list of multilingual languages.
if (isset($select_options[$browser_langcode])) { if (isset($select_options[$default_langcode])) {
unset($select_options[$browser_langcode]); unset($select_options[$default_langcode]);
} }
if (isset($browser_options[$browser_langcode])) { if (isset($browser_options[$default_langcode])) {
unset($browser_options[$browser_langcode]); unset($browser_options[$default_langcode]);
} }
$form['#title'] = $this->t('Multilingual configuration'); $form['#title'] = $this->t('Multilingual configuration');
...@@ -142,6 +139,7 @@ class ConfigureMultilingualForm extends FormBase { ...@@ -142,6 +139,7 @@ class ConfigureMultilingualForm extends FormBase {
'continue' => [ 'continue' => [
'#type' => 'submit', '#type' => 'submit',
'#value' => $this->t('Save and continue'), '#value' => $this->t('Save and continue'),
'#button_type' => 'primary',
], ],
'#type' => 'actions', '#type' => 'actions',
'#weight' => 5, '#weight' => 5,
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment