Code Duplication    Length = 10-10 lines in 2 locations

lib/private/L10N/Factory.php 2 locations

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