chore: use en by default (#988)

This commit is contained in:
Adam Shiervani 2025-11-20 16:34:02 +01:00 committed by GitHub
parent 85eb4babdf
commit 0952c6abf2
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
3 changed files with 14 additions and 3 deletions

View File

@ -5,13 +5,22 @@ interface SettingsItemProps {
readonly title: string; readonly title: string;
readonly description: string | React.ReactNode; readonly description: string | React.ReactNode;
readonly badge?: string; readonly badge?: string;
readonly badgeTheme?: keyof typeof badgeTheme;
readonly className?: string; readonly className?: string;
readonly loading?: boolean; readonly loading?: boolean;
readonly children?: React.ReactNode; readonly children?: React.ReactNode;
} }
const badgeTheme = {
info: "bg-blue-500 text-white",
success: "bg-green-500 text-white",
warning: "bg-yellow-500 text-white",
danger: "bg-red-500 text-white",
};
export function SettingsItem(props: SettingsItemProps) { export function SettingsItem(props: SettingsItemProps) {
const { title, description, badge, children, className, loading } = props; const { title, description, badge, badgeTheme: badgeThemeProp = "danger", children, className, loading } = props;
const badgeThemeClass = badgeTheme[badgeThemeProp];
return ( return (
<label <label
@ -25,7 +34,7 @@ export function SettingsItem(props: SettingsItemProps) {
<div className="flex items-center text-base font-semibold text-black dark:text-white"> <div className="flex items-center text-base font-semibold text-black dark:text-white">
{title} {title}
{badge && ( {badge && (
<span className="ml-2 rounded-full bg-red-500 px-2 py-1 text-[10px] font-medium leading-none text-white dark:border dark:border-red-700 dark:bg-red-800 dark:text-red-50"> <span className={cx("ml-2 rounded-full px-2 py-1 text-[10px] font-medium leading-none text-white", badgeThemeClass)}>
{badge} {badge}
</span> </span>
)} )}

View File

@ -84,6 +84,8 @@ export default function SettingsGeneralRoute() {
<div className="space-y-4 pb-2"> <div className="space-y-4 pb-2">
<div className="space-y-4"> <div className="space-y-4">
<SettingsItem <SettingsItem
badge="Beta"
badgeTheme="info"
title={m.user_interface_language_title()} title={m.user_interface_language_title()}
description={m.user_interface_language_description()} description={m.user_interface_language_description()}
> >

View File

@ -33,7 +33,7 @@ export default defineConfig(({ mode, command }) => {
outdir: "./localization/paraglide", outdir: "./localization/paraglide",
outputStructure: 'message-modules', outputStructure: 'message-modules',
cookieName: 'JETKVM_LOCALE', cookieName: 'JETKVM_LOCALE',
strategy: ['cookie', 'preferredLanguage', 'baseLocale'], strategy: ['cookie', 'baseLocale'],
})) }))
return { return {