Code Duplication    Length = 10-10 lines in 2 locations

lib/private/L10N/Factory.php 2 locations

@@ 202-211 (lines=10) @@
199
200
		$available = ['en']; //english is always available
201
		$dir = $this->findL10nDir($app);
202
		if (is_dir($dir)) {
203
			$files = scandir($dir);
204
			if ($files !== false) {
205
				foreach ($files as $file) {
206
					if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
207
						$available[] = substr($file, 0, -5);
208
					}
209
				}
210
			}
211
		}
212
213
		// merge with translations from theme
214
		$theme = $this->config->getSystemValue('theme');
@@ 218-227 (lines=10) @@
215
		if (!empty($theme)) {
216
			$themeDir = $this->serverRoot . '/themes/' . $theme . substr($dir, strlen($this->serverRoot));
217
218
			if (is_dir($themeDir)) {
219
				$files = scandir($themeDir);
220
				if ($files !== false) {
221
					foreach ($files as $file) {
222
						if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
223
							$available[] = substr($file, 0, -5);
224
						}
225
					}
226
				}
227
			}
228
		}
229
230
		$this->availableLanguages[$key] = $available;