sort languages

This commit is contained in:
wj-xiao
2024-10-10 10:24:00 +08:00
parent 342ed33fe7
commit 726cd915cc
4 changed files with 8 additions and 4 deletions

View File

@@ -1,4 +1,4 @@
export const languages = [
const languages = [
{ key: 'da', name: 'Danish' },
{ key: 'de', name: 'Deutsch' },
{ key: 'en', name: 'English' },
@@ -14,3 +14,7 @@ export const languages = [
{ key: 'ja', name: '日本語' },
{ key: 'cz', name: 'Česky' }
];
languages.sort((a, b) => a.name.localeCompare(b.name, 'en', { sensitivity: 'base' }));
export default languages;

View File

@@ -1,4 +1,4 @@
const cs = {
const cz = {
translation: {
language: 'Jazyk',
changePassword: 'Změnit heslo',

View File

@@ -3,7 +3,7 @@ import clsx from 'clsx';
import { LanguagesIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { languages } from '@/i18n/languages.ts';
import languages from '@/i18n/languages.ts';
import { setLanguage } from '@/lib/localstorage.ts';
export const Language = () => {

View File

@@ -3,7 +3,7 @@ import clsx from 'clsx';
import { LanguagesIcon } from 'lucide-react';
import { useTranslation } from 'react-i18next';
import { languages } from '@/i18n/languages.ts';
import languages from '@/i18n/languages.ts';
import { setLanguage } from '@/lib/localstorage.ts';
export const Language = () => {