🐛 fix:: Update localization files and improve display logic for inventory handling
This commit is contained in:
parent
2316609c82
commit
83d821a2dc
@ -63,5 +63,5 @@
|
||||
"system": "System",
|
||||
"toggle": "Toggle theme"
|
||||
},
|
||||
"unlimited": "unlimited"
|
||||
"unlimited": "Unlimited"
|
||||
}
|
||||
|
||||
@ -30,7 +30,6 @@
|
||||
"discountPercent": "Discount Percentage",
|
||||
"Hour": "Hour",
|
||||
"inventory": "Subscription Limit",
|
||||
"inventoryDescription": "Set to -1 for unlimited inventory",
|
||||
"unlimitedInventory": "Unlimited (enter -1)",
|
||||
"language": "Language",
|
||||
"languageDescription": "Leave empty for default without language restriction",
|
||||
|
||||
@ -30,7 +30,6 @@
|
||||
"discountPercent": "折扣百分比",
|
||||
"Hour": "小时",
|
||||
"inventory": "订阅库存",
|
||||
"inventoryDescription": "设置为 -1 表示不限制库存",
|
||||
"unlimitedInventory": "无限制(输入 -1)",
|
||||
"language": "语言",
|
||||
"languageDescription": "留空为默认无语言限制",
|
||||
|
||||
@ -28,7 +28,7 @@ export function Display<T extends number | undefined | null>({
|
||||
if (
|
||||
["traffic", "trafficSpeed", "number"].includes(type) &&
|
||||
unlimited &&
|
||||
!value
|
||||
(value === 0 || value === null || value === undefined)
|
||||
) {
|
||||
return t("unlimited");
|
||||
}
|
||||
@ -42,7 +42,7 @@ export function Display<T extends number | undefined | null>({
|
||||
}
|
||||
|
||||
if (type === "number") {
|
||||
return value ? value.toString() : "0";
|
||||
return value !== null && value !== undefined ? value.toString() : "0";
|
||||
}
|
||||
|
||||
return "0";
|
||||
|
||||
@ -454,9 +454,6 @@ export default function SubscribeForm<T extends Record<string, any>>({
|
||||
value={field.value}
|
||||
/>
|
||||
</FormControl>
|
||||
<FormDescription>
|
||||
{t("form.inventoryDescription")}
|
||||
</FormDescription>
|
||||
<FormMessage />
|
||||
</FormItem>
|
||||
)}
|
||||
|
||||
@ -78,7 +78,7 @@ const DurationSelector: React.FC<DurationSelectorProps> = ({
|
||||
</span>
|
||||
{discountPercentage > 0 ? (
|
||||
<Badge className="h-6 text-sm" variant="destructive">
|
||||
-{discountPercentage}% {t("discount", "Discount")}
|
||||
-{discountPercentage.toFixed(2)}% {t("discount", "Discount")}
|
||||
</Badge>
|
||||
) : (
|
||||
<span className="h-6 text-muted-foreground text-sm">--</span>
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user