summaryrefslogtreecommitdiffstats
path: root/lib/private/l10n.php
diff options
context:
space:
mode:
authorJoas Schilling <nickvergessen@gmx.de>2014-11-24 12:08:19 +0100
committerJoas Schilling <nickvergessen@gmx.de>2014-12-09 16:10:24 +0100
commitd69ea30097035a892ec867f8ad5bae0bc433aeea (patch)
tree258fe6e35c8b3e9120b578b7d46d0a69cc42feb0 /lib/private/l10n.php
parentbfcd5a3802030ca97836aca1e658aec434162922 (diff)
downloadnextcloud-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.php8
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) {