Merge pull request #546 from asdfuser/master

Add option to set a locale
This commit is contained in:
Daniel Rudolf 2020-06-14 19:03:08 +02:00 committed by GitHub
commit 60f27dfe85
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -7,6 +7,7 @@ base_url: ~ # Pico will try to guess its base URL, if th
rewrite_url: ~ # A boolean (true or false) indicating whether URL rewriting is forced
debug: ~ # Set this to true to enable Pico's debug mode
timezone: ~ # Your PHP installation might require you to manually specify a timezone
locale: ~ # Your PHP installation might require you to manually specify a locale to use
##
# Theme

View File

@ -936,6 +936,7 @@ class Pico
'rewrite_url' => null,
'debug' => null,
'timezone' => null,
'locale' => null,
'theme' => 'default',
'theme_config' => null,
'theme_meta' => null,
@ -974,6 +975,10 @@ class Pico
}
date_default_timezone_set($this->config['timezone']);
if ($this->config['locale'] !== null) {
setlocale(LC_ALL, $this->config['locale']);
}
if (!$this->config['plugins_url']) {
$this->config['plugins_url'] = $this->getUrlFromPath($this->getPluginsDir());
} else {