<commit_before><?php

namespace Frontend\Modules\Location\Actions;

use Frontend\Core\Engine\Base\Block as FrontendBaseBlock;
use Frontend\Modules\Location\Engine\Model as FrontendLocationModel;

/**
 * This is the index-action, it has an overview of locations.
 */
class Index extends FrontendBaseBlock
{
    /**
     * @var array
     */
    protected $items = [];

    /**
     * @var array
     */
    protected $settings = [];

    public function execute(): void
    {
        // define Google Maps API key
        $apikey = $this->get('fork.settings')->get('Core', 'google_maps_key');

        // check Google Maps API key, otherwise show error
        if ($apikey == null) {
            trigger_error('Please provide a Google Maps API key.');
        }
        $this->addJS('https://maps.googleapis.com/maps/api/js?key=' . $apikey);
        $this->addJS(FrontendLocationModel::getPathToMapStyles(false), true);

        parent::execute();

        $this->loadTemplate();
        $this->loadData();
<commit_msg>Set the language of the map on the location overview action<commit_after><?php

namespace Frontend\Modules\Location\Actions;

use Frontend\Core\Engine\Base\Block as FrontendBaseBlock;
use Frontend\Core\Language\Language;
use Frontend\Core\Language\Locale;
use Frontend\Modules\Location\Engine\Model as FrontendLocationModel;

/**
 * This is the index-action, it has an overview of locations.
 */
class Index extends FrontendBaseBlock
{
    /**
     * @var array
     */
    protected $items = [];

    /**
     * @var array
     */
    protected $settings = [];

    public function execute(): void
    {
        // define Google Maps API key
        $apikey = $this->get('fork.settings')->get('Core', 'google_maps_key');

        // check Google Maps API key, otherwise show error
        if ($apikey == null) {
            trigger_error('Please provide a Google Maps API key.');
        }

        $frontendLanguage = Locale::frontendLanguage();
        $googleLanguage = $frontendLanguage . '_' . strtoupper($frontendLanguage);
        $this->addJS('https://maps.googleapis.com/maps/api/js?key=' . $apikey . '&language=' . $googleLanguage);
        $this->addJS(FrontendLocationModel::getPathToMapStyles(false), true);

        parent::execute();

        $this->loadTemplate();
        $this->loadData();

{'fraction_non_alphanumeric': 0.137086377309841, 'fraction_numerical': 0.0, 'mean_word_length': 2.816393442622951, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 15, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '126980', 'n_tokens_mistral': 670, 'n_tokens_neox': 658, 'n_words': 161}