Upload via GUI (396 Dateien)
This commit is contained in:
@@ -108,6 +108,13 @@ function i18n_dictionary(string $code, bool $reload = false): array
|
||||
$packFile = i18n_languages()[$code]['strings'] ?? '';
|
||||
if ($packFile !== '') $files[] = $packFile;
|
||||
foreach ($files as $file) i18n_load_strings_file($file, $dict);
|
||||
// Genauere (längere) Muster zuerst: Sonst würde ein allgemeines wie „Ticket #{}“ ein spezielleres wie „Ticket #{} wurde nicht gefunden.“ überdecken
|
||||
if (count($dict['patterns']) > 1) {
|
||||
$order = array_keys($dict['patterns']);
|
||||
usort($order, fn($x, $y) => strlen((string) ($dict['pkeys'][$y] ?? '')) <=> strlen((string) ($dict['pkeys'][$x] ?? '')));
|
||||
$dict['patterns'] = array_map(fn($i) => $dict['patterns'][$i], $order);
|
||||
$dict['pkeys'] = array_map(fn($i) => $dict['pkeys'][$i] ?? '', $order);
|
||||
}
|
||||
return $cache[$code] = $dict;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user