Code Duplication    Length = 9-9 lines in 2 locations

lib/private/l10n.php 2 locations

@@ 473-481 (lines=9) @@
470
		}
471
		$available=array('en');//english is always available
472
		$dir = self::findI18nDir($app);
473
		if(is_dir($dir)) {
474
			$files=scandir($dir);
475
			foreach($files as $file) {
476
				if(substr($file, -5, 5) === '.json' && substr($file, 0, 4) !== 'l10n') {
477
					$i = substr($file, 0, -5);
478
					$available[] = $i;
479
				}
480
			}
481
		}
482
483
		$config = \OC::$server->getConfig();
484
		// merge with translations from theme
@@ 488-496 (lines=9) @@
485
		$theme = $config->getSystemValue('theme');
486
		if(!empty($theme)) {
487
			$themeDir = \OC::$SERVERROOT . '/themes/' . $theme . substr($dir, strlen(\OC::$SERVERROOT));
488
			if(is_dir($themeDir)) {
489
				$files=scandir($dir);
490
				foreach($files as $file) {
491
					if(substr($file, -5, 5) === '.json' && substr($file, 0, 4) !== 'l10n') {
492
						$i = substr($file, 0, -5);
493
						$available[] = $i;
494
					}
495
				}
496
			}
497
		}
498
499
		self::$availableLanguages[$app] = $available;