Code Duplication    Length = 10-10 lines in 2 locations

lib/private/L10N/Factory.php 2 locations

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