src/extensions/ControllerExtension.php
public function onBeforeInit()
    {
        $disallowed_controllers = [
            DevelopmentAdmin::class,
            DevBuildController::class,
            DatabaseAdmin::class
        ];

        // Don't run this during dev/build or dev/tasks
        if (!in_array(get_class($this->owner), $disallowed_controllers)) {
            // Set global local based on Site Config
            $config = SiteConfig::current_site_config();
            i18n::set_locale($config->SiteLocale);

            // Now find and set the desired currency symbol
            $number_format = new NumberFormatter($config->SiteLocale, NumberFormatter::CURRENCY);
            $symbol = $number_format->getSymbol(NumberFormatter::CURRENCY_SYMBOL);
            DBCurrency::config()->currency_symbol = $symbol;
        }
    }
public function onBeforeInit()
    {
        $disallowed_controllers = [
            DevelopmentAdmin::class,
            DevBuildController::class,
            DatabaseAdmin::class
        ];

        // Don't run this during dev/build or dev/tasks
        if (!in_array(get_class($this->owner), $disallowed_controllers)) {
            // Set global local based on Site Config
            $config = SiteConfig::current_site_config();
            i18n::set_locale($config->SiteLocale);

            // Now find and set the desired currency symbol
            $number_format = new NumberFormatter($config->SiteLocale, NumberFormatter::CURRENCY);
            $symbol = $number_format->getSymbol(NumberFormatter::CURRENCY_SYMBOL);
            DBCurrency::config()->currency_symbol = $symbol;
        }
    }
public function onBeforeInit ( ) { $ disallowed_controllers = [ DevelopmentAdmin :: class , DevBuildController :: class , DatabaseAdmin :: class ] ; // Don't run this during dev/build or dev/tasks if ( ! in_array ( get_class ( $ this -> owner ) , $ disallowed_controllers ) ) { // Set global local based on Site Config $ config = SiteConfig :: current_site_config ( ) ; i18n :: set_locale ( $ config -> SiteLocale ) ; // Now find and set the desired currency symbol $ number_format = new NumberFormatter ( $ config -> SiteLocale , NumberFormatter :: CURRENCY ) ; $ symbol = $ number_format -> getSymbol ( NumberFormatter :: CURRENCY_SYMBOL ) ; DBCurrency :: config ( ) -> currency_symbol = $ symbol ; } }
Customise the default silverstripe locale config
Customise the default silverstripe locale config