nextcloud/apps/settings/src/utils/sorting.ts
Christopher Ng 7c976a9605 fix(settings): Natural order groups
Signed-off-by: Christopher Ng <chrng8@gmail.com>
2025-03-28 14:12:52 -07:00

14 lines
325 B
TypeScript

/**
* SPDX-FileCopyrightText: 2025 Nextcloud GmbH and Nextcloud contributors
* SPDX-License-Identifier: AGPL-3.0-or-later
*/
import { getCanonicalLocale, getLanguage } from '@nextcloud/l10n'
export const naturalCollator = Intl.Collator(
[getLanguage(), getCanonicalLocale()],
{
numeric: true,
usage: 'sort',
},
)