diff options
author | Joas Schilling <nickvergessen@gmx.de> | 2014-11-24 12:08:19 +0100 |
---|---|---|
committer | Joas Schilling <nickvergessen@gmx.de> | 2014-12-09 16:10:24 +0100 |
commit | d69ea30097035a892ec867f8ad5bae0bc433aeea (patch) | |
tree | 258fe6e35c8b3e9120b578b7d46d0a69cc42feb0 /lib/private/l10n.php | |
parent | bfcd5a3802030ca97836aca1e658aec434162922 (diff) | |
download | nextcloud-server-d69ea30097035a892ec867f8ad5bae0bc433aeea.tar.gz nextcloud-server-d69ea30097035a892ec867f8ad5bae0bc433aeea.zip |
Add a DateTimeFormatter class which allows overwriting the language and timezone
Fix #12227
Diffstat (limited to 'lib/private/l10n.php')
-rw-r--r-- | lib/private/l10n.php | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/lib/private/l10n.php b/lib/private/l10n.php index bc4e53e975c..3c759a9e3a2 100644 --- a/lib/private/l10n.php +++ b/lib/private/l10n.php @@ -311,7 +311,13 @@ class OC_L10N implements \OCP\IL10N { } else { $value->setTimestamp($data); } - $locale = self::findLanguage(); + + // Use the language of the instance, before falling back to the current user's language + $locale = $this->lang; + if ($locale === null) { + $locale = self::findLanguage(); + } + $options = array_merge(array('width' => 'long'), $options); $width = $options['width']; switch($type) { |