added locale configuration to support foreign 'Sonderzeichen' (closes #107)

This commit is contained in:
Steffen Vogel 2011-08-03 14:53:01 +02:00
parent bd60e88b48
commit 7040bd0d06
3 changed files with 11 additions and 2 deletions

View file

@ -86,6 +86,12 @@ $config['lib']['doctrine'] = VZ_DIR . '/lib/vendor/Doctrine';
*/
//$config['timezone'] = 'Europe/Berlin';
/**
* @var string Locale used for regular expressions
* @link http://php.net/manual/de/function.setlocale.php
*/
$config['locale'] = array('de_DE', 'en_US', 'C');
/**
* @var array of colors for plot series
*/

View file

@ -46,6 +46,9 @@ Util\Configuration::load(VZ_DIR . '/etc/volkszaehler.conf');
$tz = (Util\Configuration::read('timezone')) ? Util\Configuration::read('timezone') : @date_default_timezone_get();
date_default_timezone_set($tz);
// set locale
setlocale(LC_ALL, Util\Configuration::read('locale'));
// define include dirs for vendor libs
define('DOCTRINE_DIR', Util\Configuration::read('lib.doctrine') ? Util\Configuration::read('lib.doctrine') : 'Doctrine');
define('JPGRAPH_DIR', Util\Configuration::read('lib.jpgraph') ? Util\Configuration::read('lib.jpgraph') : 'JpGraph');

View file

@ -29,7 +29,7 @@
{
"name" : "title",
"type" : "string",
"pattern" : "\/^[a-z0-9_ -]*$\/i",
"pattern" : "\/^[\\w\\.\\-\\,()\\]\\[!&*+\\/:@]+$\/u",
"max" : 255,
"translation" : {
"de" : "Titel",
@ -103,7 +103,7 @@
{
"name" : "address:city",
"type" : "string",
"pattern" : "\/^[a-z.- ]*$\/i",
"pattern" : "\/^[\\w\\.\\-\\,() ]+$\/u",
"translation" : {
"de" : "Stadt",
"en" : "City"