Programatically set the language
You should consider using Drush (or Bash running Drush) for that. With drush site:install you can set the default language via --locale.

The following command will (re)install Drupal using the expert install profile and set default language to Ukrainian.

drush si expert --locale=uk


Source: https://drushcommands.com/drush-9x/site/site:install/