summaryrefslogtreecommitdiffstats
path: root/lib/private/legacy/util.php
diff options
context:
space:
mode:
Diffstat (limited to 'lib/private/legacy/util.php')
-rw-r--r--lib/private/legacy/util.php15
1 files changed, 14 insertions, 1 deletions
diff --git a/lib/private/legacy/util.php b/lib/private/legacy/util.php
index 3ce11746672..b9a7706eaf7 100644
--- a/lib/private/legacy/util.php
+++ b/lib/private/legacy/util.php
@@ -379,7 +379,20 @@ class OC_Util {
*/
public static function copySkeleton($userId, \OCP\Files\Folder $userDirectory) {
- $skeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');
+ $plainSkeletonDirectory = \OC::$server->getConfig()->getSystemValue('skeletondirectory', \OC::$SERVERROOT . '/core/skeleton');
+ $userLang = \OC::$server->getL10NFactory()->findLanguage();
+ $skeletonDirectory = str_replace('{lang}', $userLang, $plainSkeletonDirectory);
+
+ if (!file_exists($skeletonDirectory)) {
+ $dialectStart = strpos($userLang, '_');
+ if ($dialectStart !== false) {
+ $skeletonDirectory = str_replace('{lang}', substr($userLang, 0, $dialectStart), $plainSkeletonDirectory);
+ }
+ if ($dialectStart === false || !file_exists($skeletonDirectory)) {
+ $skeletonDirectory = str_replace('{lang}', 'en', $plainSkeletonDirectory);
+ }
+ }
+
$instanceId = \OC::$server->getConfig()->getSystemValue('instanceid', '');
if ($instanceId === null) {