Code Duplication    Length = 10-10 lines in 2 locations

lib/private/L10N/Factory.php 2 locations

@@ 183-192 (lines=10) @@
180
181
		$available = ['en']; //english is always available
182
		$dir = $this->findL10nDir($app);
183
		if (is_dir($dir)) {
184
			$files = scandir($dir);
185
			if ($files !== false) {
186
				foreach ($files as $file) {
187
					if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
188
						$available[] = substr($file, 0, -5);
189
					}
190
				}
191
			}
192
		}
193
194
		// merge with translations from theme
195
		$theme = $this->config->getSystemValue('theme');
@@ 199-208 (lines=10) @@
196
		if (!empty($theme)) {
197
			$themeDir = $this->serverRoot . '/themes/' . $theme . substr($dir, strlen($this->serverRoot));
198
199
			if (is_dir($themeDir)) {
200
				$files = scandir($themeDir);
201
				if ($files !== false) {
202
					foreach ($files as $file) {
203
						if (substr($file, -5) === '.json' && substr($file, 0, 4) !== 'l10n') {
204
							$available[] = substr($file, 0, -5);
205
						}
206
					}
207
				}
208
			}
209
		}
210
211
		$this->availableLanguages[$key] = $available;