summaryrefslogtreecommitdiffstats
path: root/lib/l10n.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/l10n.php')
-rw-r--r--lib/l10n.php15
1 files changed, 11 insertions, 4 deletions
diff --git a/lib/l10n.php b/lib/l10n.php
index 26611537175..41c89a7d4b5 100644
--- a/lib/l10n.php
+++ b/lib/l10n.php
@@ -58,9 +58,11 @@ class OC_L10N{
* Localization
*/
private $localizations = array(
+ 'jsdate' => 'dd.mm.yy',
'date' => '%d.%m.%Y',
'datetime' => '%d.%m.%Y %H:%M:%S',
- 'time' => '%H:%M:%S');
+ 'time' => '%H:%M:%S',
+ 'firstday' => 0);
/**
* get an L10N instance
@@ -118,7 +120,7 @@ class OC_L10N{
OC_Helper::issubdirectory($i18ndir.$lang.'.php', OC::$SERVERROOT.'/lib/l10n/') ||
OC_Helper::issubdirectory($i18ndir.$lang.'.php', OC::$SERVERROOT.'/settings')) && file_exists($i18ndir.$lang.'.php')) {
// Include the file, save the data from $CONFIG
- include(strip_tags($i18ndir).strip_tags($lang).'.php');
+ include strip_tags($i18ndir).strip_tags($lang).'.php';
if(isset($TRANSLATIONS) && is_array($TRANSLATIONS)) {
$this->translations = $TRANSLATIONS;
}
@@ -126,7 +128,7 @@ class OC_L10N{
if(file_exists(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php')) {
// Include the file, save the data from $CONFIG
- include(OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php');
+ include OC::$SERVERROOT.'/core/l10n/l10n-'.$lang.'.php';
if(isset($LOCALIZATIONS) && is_array($LOCALIZATIONS)) {
$this->localizations = array_merge($this->localizations, $LOCALIZATIONS);
}
@@ -217,10 +219,15 @@ class OC_L10N{
if($data instanceof DateTime) return $data->format($this->localizations[$type]);
elseif(is_string($data)) $data = strtotime($data);
$locales = array(self::findLanguage());
- if (strlen($locales[0]) == 2) $locales[] = $language.'_'.strtoupper($language);
+ if (strlen($locales[0]) == 2) {
+ $locales[] = $locales[0].'_'.strtoupper($locales[0]);
+ }
setlocale(LC_TIME, $locales);
return strftime($this->localizations[$type], $data);
break;
+ case 'firstday':
+ case 'jsdate':
+ return $this->localizations[$type];
default:
return false;
}