Code Duplication    Length = 10-10 lines in 2 locations

lib/private/L10N/Factory.php 2 locations

@@ 285-294 (lines=10) @@
282
283
		$available = ['en']; //english is always available
284
		$dir = $this->findL10nDir($app);
285
		if (is_dir($dir)) {
286
			$files = scandir($dir);
287
			if ($files !== false) {
288
				foreach ($files as $file) {
289
					if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
290
						$available[] = substr($file, 0, -5);
291
					}
292
				}
293
			}
294
		}
295
296
		// merge with translations from theme
297
		$theme = $this->config->getSystemValue('theme');
@@ 301-310 (lines=10) @@
298
		if (!empty($theme)) {
299
			$themeDir = $this->serverRoot . '/themes/' . $theme . substr($dir, strlen($this->serverRoot));
300
301
			if (is_dir($themeDir)) {
302
				$files = scandir($themeDir);
303
				if ($files !== false) {
304
					foreach ($files as $file) {
305
						if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
306
							$available[] = substr($file, 0, -5);
307
						}
308
					}
309
				}
310
			}
311
		}
312
313
		$this->availableLanguages[$key] = $available;