Code Duplication    Length = 10-10 lines in 2 locations

lib/private/L10N/Factory.php 2 locations

@@ 265-274 (lines=10) @@
262
263
		$available = ['en']; //english is always available
264
		$dir = $this->findL10nDir($app);
265
		if (is_dir($dir)) {
266
			$files = scandir($dir);
267
			if ($files !== false) {
268
				foreach ($files as $file) {
269
					if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
270
						$available[] = substr($file, 0, -5);
271
					}
272
				}
273
			}
274
		}
275
276
		// merge with translations from theme
277
		$theme = $this->config->getSystemValue('theme');
@@ 281-290 (lines=10) @@
278
		if (!empty($theme)) {
279
			$themeDir = $this->serverRoot . '/themes/' . $theme . substr($dir, strlen($this->serverRoot));
280
281
			if (is_dir($themeDir)) {
282
				$files = scandir($themeDir);
283
				if ($files !== false) {
284
					foreach ($files as $file) {
285
						if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
286
							$available[] = substr($file, 0, -5);
287
						}
288
					}
289
				}
290
			}
291
		}
292
293
		$this->availableLanguages[$key] = $available;