mirror of
https://github.com/QuantumNous/new-api.git
synced 2026-09-10 22:20:25 +00:00
fix(i18n): standardize locale formatting for Intl APIs
This commit is contained in:
@@ -51,6 +51,7 @@ import {
|
||||
formatQuotaWithCurrency,
|
||||
getCurrencyLabel,
|
||||
} from '@/lib/currency'
|
||||
import { toIntlLocale } from '@/i18n/languages'
|
||||
import { formatTimestampToDate } from '@/lib/format'
|
||||
import { truncateText } from '@/lib/utils'
|
||||
|
||||
@@ -310,7 +311,7 @@ function BalanceCell({ channel }: { channel: Channel }) {
|
||||
const withSuffix = (value: string) =>
|
||||
tokenSuffix && value !== '-' ? `${value}${tokenSuffix}` : value
|
||||
|
||||
const locale = i18n.resolvedLanguage || i18n.language
|
||||
const locale = toIntlLocale(i18n.resolvedLanguage || i18n.language)
|
||||
const balanceFormatOptions = {
|
||||
digitsLarge: 2,
|
||||
digitsSmall: 4,
|
||||
@@ -519,7 +520,7 @@ export function useChannelsColumns(
|
||||
const { t, i18n } = useTranslation()
|
||||
const { sensitiveVisible } = useChannels()
|
||||
const enableSelection = options.enableSelection ?? true
|
||||
const locale = i18n.resolvedLanguage || i18n.language
|
||||
const locale = toIntlLocale(i18n.resolvedLanguage || i18n.language)
|
||||
// The column definitions only depend on the translation function, the active
|
||||
// locale, and sensitive-data visibility. Memoizing keeps the array (and every
|
||||
// cell renderer reference) stable across unrelated re-renders, so react-table
|
||||
|
||||
Reference in New Issue
Block a user