|
|
@@ -45,7 +45,8 @@ const FirstRoute = ({
|
|
|
loading: boolean;
|
|
|
handleCouponClick: any;
|
|
|
}) => {
|
|
|
- const { t } = useTranslation();
|
|
|
+ const { t, getCurrentLanguageConfig } = useTranslation(); // 使用翻译钩子
|
|
|
+ const isEn = getCurrentLanguageConfig()?.code === 'en';
|
|
|
|
|
|
return (
|
|
|
<View className="flex-1">
|
|
|
@@ -87,9 +88,9 @@ const FirstRoute = ({
|
|
|
onCouponClick={handleCouponClick}
|
|
|
// key={coupon.redeem_code}
|
|
|
key={`${coupon.id}-${index}`}
|
|
|
- title={coupon.coupon.name}
|
|
|
+ title={isEn? coupon.coupon.name_en:coupon.coupon.name}
|
|
|
price={coupon.coupon.amount}
|
|
|
- detail={coupon.coupon.description}
|
|
|
+ detail={isEn?coupon.coupon.description_en:coupon.coupon.description}
|
|
|
date={formatCouponDate(coupon.expire_date)}
|
|
|
setOpacity={false}
|
|
|
redeem_code={coupon.id}
|
|
|
@@ -106,8 +107,8 @@ const FirstRoute = ({
|
|
|
};
|
|
|
|
|
|
const SecondRoute = ({ coupons }: { coupons: any }) => {
|
|
|
- const { t } = useTranslation();
|
|
|
-
|
|
|
+ const { t, getCurrentLanguageConfig } = useTranslation(); // 使用翻译钩子
|
|
|
+ const isEn = getCurrentLanguageConfig()?.code === 'en';
|
|
|
return (
|
|
|
<ScrollView style={{ flex: 1, backgroundColor: 'white', marginTop: 14 }}>
|
|
|
<View className="flex-1 flex-col">
|
|
|
@@ -121,9 +122,9 @@ const SecondRoute = ({ coupons }: { coupons: any }) => {
|
|
|
.map((coupon: any, index: any) => (
|
|
|
<IndividualCouponComponent
|
|
|
key={`${coupon.id}-${index}`}
|
|
|
- title={coupon.coupon.name}
|
|
|
+ title={isEn? coupon.coupon.name_en:coupon.coupon.name}
|
|
|
price={coupon.coupon.amount}
|
|
|
- detail={coupon.coupon.description}
|
|
|
+ detail={isEn?coupon.coupon.description_en:coupon.coupon.description}
|
|
|
date={formatCouponDate(coupon.expire_date)}
|
|
|
setOpacity={true}
|
|
|
noCircle={true}
|