Leon преди 1 година
родител
ревизия
02715fd739
променени са 5 файла, в които са добавени 107 реда и са изтрити 89 реда
  1. 2 2
      ios/hola.xcodeproj/project.pbxproj
  2. 0 0
      ios/main.jsbundle
  3. 26 17
      src/context/locales/en.js
  4. 49 40
      src/context/locales/zh.js
  5. 30 30
      src/features/trackTimeDuration/components/CheckAccess.tsx

+ 2 - 2
ios/hola.xcodeproj/project.pbxproj

@@ -572,7 +572,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 21;
+				CURRENT_PROJECT_VERSION = 10;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				ENABLE_BITCODE = NO;
 				INFOPLIST_FILE = hola/Info.plist;
@@ -605,7 +605,7 @@
 				CODE_SIGN_ENTITLEMENTS = hola/hola.entitlements;
 				CODE_SIGN_IDENTITY = "Apple Development";
 				CODE_SIGN_STYLE = Automatic;
-				CURRENT_PROJECT_VERSION = 21;
+				CURRENT_PROJECT_VERSION = 10;
 				DEVELOPMENT_TEAM = GPMXAZ9G5N;
 				INFOPLIST_FILE = hola/Info.plist;
 				LD_RUNPATH_SEARCH_PATHS = (

Файловите разлики са ограничени, защото са твърде много
+ 0 - 0
ios/main.jsbundle


+ 26 - 17
src/context/locales/en.js

@@ -152,17 +152,19 @@ export default {
 
         check_access: {
             non_access: {
-                title: 'Well Done',
-                desc: 'You\'re on a {{day}}-day streak.\n{{day_left}} more {{day_unit}} until unlocking \'Fasting with sleep.\'',
-                btn: 'Got it!'
+                title: 'Streak Updated',
+                desc: 'You\'re on a {{day}}-day faststreak.',//'You\'re on a {{day}}-day streak.\n{{day_left}} more {{day_unit}} until unlocking \'Fasting with sleep.\'',
+                btn: 'Keep it going'
             },
             gain_access:{
-                title:'Premium Access Unlocked',
-                desc:'You\'ve unlocked \'Fasting with Sleep\' since you\'re on a {{day}}-day streak.\nAre you ready to up the game?',
+                title:'Premium Feature Unlocked',
+                desc:'You\'ve earned access to \'Fasting with Sleep\' {{reason}} Are you ready to upgrade?',
+                // desc:'You\'ve unlocked \'Fasting with Sleep\' since you\'re on a {{day}}-day streak.\nAre you ready to up the game?',
                 upgrade:'Upgrade to Fasting with Sleep',
                 upgrade_desc:'Offer Expiring in {{time}}',
                 stay_btn:'Stay with Fasting Only',
-                more:'Learn more'
+                reason:'since you\'re on a {{day}}-day faststreak.',
+                // more:'Learn more'
             },
             upgrade_pro:{
                 title:'Congrats on Your PRO Status!',
@@ -176,22 +178,29 @@ export default {
                 cancel:'Keep old schedule'
             },
             stay_qualified:{
-                title:'Well Done',
-                desc:'You\'re on a {{fast_streak_day}}-day fasting streak and a {{sleep_streak_day}}-day sleep streak.\nKeep \'em going to stay in the game.',
-                btn:'Got it!',
+                title:'Streaks Updated',
+                desc:'You\'re on a {{fast_streak_day}}-day faststreak \nand on a {{sleep_streak_day}}-day sleepstreak.',
+                // desc:'You\'re on a {{fast_streak_day}}-day fasting streak and a {{sleep_streak_day}}-day sleep streak.\nKeep \'em going to stay in the game.',
+                btn:'Keep them going',
             },
             lose_access:{
                 title:'Premium Access Lost',
-                desc:'You\'ve lost premium access to the \'Fasting with Sleep\' feature\n{{type}}. To regain access, become a PRO or achieve a new {{require_days}}-day fasting streak.',
-                confirm:'Become a PRO member',
-                cancel:'Achieve New Fasting Streak'
+                desc:'You\'ve lost access to \'Fasting with Sleep\' {{reason}} To regain access, achieve a new {{require_days}}-day faststreak.',
+                btn:'Got it'
+                // confirm:'Become a PRO member',
+                // cancel:'Achieve New Fasting Streak'
             },
             lost_reason:{
-                fast_streak_lost:'since you lost your fasting streak on {{date}}',
-                sleep_streak_lost:'since you lost your sleep streak on {{date}}',
-                fast_sleep_streaks_lost:'since you lost both of your fasting and sleep streaks on {{date}}',
-                sleep_streak_not_growing:'since you didn\'t grow your sleep streak',
-                not_satisfied_after_delete:'since you no longer have a fasting streak that satisfy the base requirement',
+                fast_streak_lost:'since you lost your faststreak.',
+                sleep_streak_lost:'since you lost your sleepstreak.',
+                fast_sleep_streaks_lost:'since you lost your fast and sleepstreaks.',
+                sleep_streak_not_growing:'since you didn\'t grow your sleepstreak.',
+                not_satisfied_after_delete:'since your faststreak fell below {{day}}.',
+                // fast_streak_lost:'since you lost your fasting streak on {{date}}',
+                // sleep_streak_lost:'since you lost your sleep streak on {{date}}',
+                // fast_sleep_streaks_lost:'since you lost both of your fasting and sleep streaks on {{date}}',
+                // sleep_streak_not_growing:'since you didn\'t grow your sleep streak',
+                // not_satisfied_after_delete:'since you no longer have a fasting streak that satisfy the base requirement',
             }
             
         },

+ 49 - 40
src/context/locales/zh.js

@@ -155,46 +155,55 @@ export default {
 
         check_access: {
             non_access: {
-                title: 'Well Done',
-                desc: 'You\'re on a {{day}}-day streak.\n{{day_left}} more days until unlocking \'Fasting with sleep.\'',
-                btn: 'Got it!'
-            },
-            gain_access: {
-                title: 'Premium Access Unlocked',
-                desc: 'You\'ve unlocked \'Fasting with Sleep\' since you\'re on a {{day}}-day streak.\nAre you ready to up the game?',
-                upgrade: 'Upgrade to Fasting with Sleep',
-                upgrade_desc: 'Offer Expiring in {{time}}',
-                stay_btn: 'Stay with Fasting Only',
-                more: 'Learn more'
-            },
-            upgrade_pro: {
-                title: 'Congrats on Your PRO Status!',
-                desc: 'To preserve this status, continue your fasting streak in {{time}} and begin your sleep streak. Remember to keep both of them going.',
-                btn: 'I got this!'
-            },
-            sleep_schedule: {
-                title: 'Sleep Schedule',
-                desc: 'Your previous sleep schedule was {{start_time}} - {{end_time}}.\nDo you want to set a new schedule?',
-                confirm: 'Set a new schedule',
-                cancel: 'Keep old schedule'
-            },
-            stay_qualified: {
-                title: 'Well Done',
-                desc: 'You\'re on a {{fast_streak_day}}-day fasting streak and a {{sleep_streak_day}}-day sleep streak.\nKeep \'em going to stay in the game.',
-                btn: 'Got it!',
-            },
-            lose_access: {
-                title: 'Premium Access Lost',
-                desc: 'You\'ve lost premium access to the \'Fasting with Sleep\' feature\n{{type}}. To regain access, become a PRO or achieve a new {{require_days}}-day fasting streak.',
-                confirm: 'Become a PRO member',
-                cancel: 'Achieve New Fasting Streak'
-            },
-            lost_reason: {
-                fast_streak_lost: 'since you lost your fasting streak on {{date}}',
-                sleep_streak_lost: 'since you lost your sleep streak on {{date}}',
-                fast_sleep_streaks_lost: 'since you lost both of your fasting and sleep streaks on {{date}}',
-                sleep_streak_not_growing: 'since you didn\'t grow your sleep streak',
-                not_satisfied_after_delete: 'since you no longer have a fasting streak that satisfy the base requirement',
+                title: '连续纪录更新',
+                desc: '您已连续{{day}}天完成断食记录。',//'You\'re on a {{day}}-day streak.\n{{day_left}} more {{day_unit}} until unlocking \'Fasting with sleep.\'',
+                btn: '继续保持'
+            },
+            gain_access:{
+                title:'高级功能已解锁',
+                desc:'{{reason}}您可解锁“断食与睡眠”功能。\n现在要升级体验吗?',
+                // desc:'You\'ve unlocked \'Fasting with Sleep\' since you\'re on a {{day}}-day streak.\nAre you ready to up the game?',
+                upgrade:'升级到"断食与睡眠"',
+                upgrade_desc:'即将到期 {{time}}',
+                stay_btn:'保持仅断食',
+                reason:'因您已连续{{day}}天完成断食记录,',
+                // more:'Learn more'
+            },
+            upgrade_pro:{
+                title:'Congrats on Your PRO Status!',
+                desc:'To preserve this status, continue your fasting streak in {{time}} and begin your sleep streak. Remember to keep both of them going.',
+                btn:'I got this!'
+            },
+            sleep_schedule:{
+                title:'睡眠日程',
+                desc:'您此前的睡眠日程为 {{start_time}} - {{end_time}}。\n是否要设置新日程?',
+                confirm:'设置新日程',
+                cancel:'保持老日程'
+            },
+            stay_qualified:{
+                title:'连续纪录已更新',
+                desc:'您已连续{{fast_streak_day}}天完成断食记录、\n连续{{sleep_streak_day}}天完成睡眠记录。',
+                // desc:'You\'re on a {{fast_streak_day}}-day fasting streak and a {{sleep_streak_day}}-day sleep streak.\nKeep \'em going to stay in the game.',
+                btn:'继续保持',
+            },
+            lose_access:{
+                title:'高级权限已失效',
+                desc:'{{reason}} 您失去了"断食与睡眠"的体验资格。下次完成断食记录后满足连续纪录达{{require_days}}天, 即可重获资格。',
+                btn:'我知道了'
+                // confirm:'Become a PRO member',
+                // cancel:'Achieve New Fasting Streak'
+            },
+            lost_reason:{
+                fast_streak_lost:'因断食连续天数已中断,',
+                sleep_streak_lost:'因睡眠连续天数已中断,',
+                fast_sleep_streaks_lost:'因断食和睡眠连续天数均已中断,',
+                sleep_streak_not_growing:'因睡眠连续天数未增长,',
+                not_satisfied_after_delete:'因断食连续天数现已低于{{day}},',
+                // fast_streak_lost:'since you lost your fasting streak on {{date}}',
+                // sleep_streak_lost:'since you lost your sleep streak on {{date}}',
+                // fast_sleep_streaks_lost:'since you lost both of your fasting and sleep streaks on {{date}}',
+                // sleep_streak_not_growing:'since you didn\'t grow your sleep streak',
+                // not_satisfied_after_delete:'since you no longer have a fasting streak that satisfy the base requirement',
             }
         },
         notification: {

+ 30 - 30
src/features/trackTimeDuration/components/CheckAccess.tsx

@@ -148,21 +148,21 @@ export default function CheckAccess(props: { record: any, count: number }) {
                 setAlertContent(t('feature.check_access.non_access.desc',
                     {
                         day: streak_fast_current,
-                        day_left: streak_fast_min_required - streak_fast_current,
-                        day_unit: streak_fast_min_required - streak_fast_current == 1 ? 'day' : 'days'
+                        // day_left: streak_fast_min_required - streak_fast_current,
+                        // day_unit: streak_fast_min_required - streak_fast_current == 1 ? 'day' : 'days'
                     }))
                 setShowCancel(false)
                 setConfirmText(t('feature.check_access.non_access.btn'))
             }
             else if (preStatus == 'NOT_QUALIFIED' && currentStatus == 'PROVISIONAL_QUALIFIED') {
                 const { streak_fast_current } = acccessData.current.qualification.condition
-
+                const reason = t('feature.check_access.gain_access.reason',{day: streak_fast_current})
                 Taro.setStorage({ key: 'showedDisqualifiedAlert', data: false })
                 var expire = acccessData.current.qualification.fast_expire
                 setShowFastAlert(true)
                 setKeepContent(false)
                 setAlertTitle(t('feature.check_access.gain_access.title'))
-                setAlertContent(t('feature.check_access.gain_access.desc', { day: streak_fast_current }))
+                setAlertContent(t('feature.check_access.gain_access.desc', { reason: reason }))
                 setShowCancel(true)
                 setCancelText(t('feature.check_access.gain_access.stay_btn'))
                 setConfirmText(t('feature.check_access.gain_access.upgrade'))
@@ -174,7 +174,7 @@ export default function CheckAccess(props: { record: any, count: number }) {
                         cancel()
                         return
                     }
-                    setSubConfirmText(`Offer Expiring in ${TimeFormatter.countdown(expire)}`)
+                    setSubConfirmText(t('feature.check_access.gain_access.upgrade_desc', { time: TimeFormatter.countdown(expire) }))
                     // setConfirmText(`Upgrade to Fasting with Sleep\n(Offer Expiring in ${TimeFormatter.countdown(expire)})`)
                 }, 1000)
             }
@@ -182,10 +182,11 @@ export default function CheckAccess(props: { record: any, count: number }) {
                 const { streak_fast_current, streak_sleep_current } = acccessData.current.qualification.condition
                 if (global.ring.current_record.scenario == 'FAST') {
                     var expire = acccessData.current.qualification.fast_expire
+                    const reason = t('feature.check_access.gain_access.reason',{day: streak_fast_current})
                     setShowFastAlert(true)
                     setKeepContent(false)
                     setAlertTitle(t('feature.check_access.gain_access.title'))
-                    setAlertContent(t('feature.check_access.gain_access.desc', { day: streak_fast_current }))
+                    setAlertContent(t('feature.check_access.gain_access.desc', { reason: reason }))
                     setShowCancel(true)
                     setCancelText(t('feature.check_access.gain_access.stay_btn'))
                     setConfirmText(t('feature.check_access.gain_access.upgrade'))
@@ -196,7 +197,7 @@ export default function CheckAccess(props: { record: any, count: number }) {
                             cancel()
                             return
                         }
-                        setSubConfirmText(`Offer Expiring in ${TimeFormatter.countdown(expire)}`)
+                        setSubConfirmText(t('feature.check_access.gain_access.upgrade_desc', { time: TimeFormatter.countdown(expire) }))
                         // setConfirmText(`Upgrade to Fasting with Sleep\n(Offer Expiring in ${TimeFormatter.countdown(expire)})`)
                     }, 1000)
                     return;
@@ -223,22 +224,22 @@ export default function CheckAccess(props: { record: any, count: number }) {
     }, [])
 
     function upgradeSuccess() {
-        var expire = access.current.qualification.fast_expire
-        setShowFastAlert(true)
-        setKeepContent(false)
-        setAlertTitle(t('feature.check_access.upgrade_pro.title'))
-        setAlertContent(t('feature.check_access.upgrade_pro.desc', { time: TimeFormatter.countdown(expire) }))
-        setShowCancel(false)
-        setConfirmText(t('feature.check_access.upgrade_pro.btn'))
-        setSubConfirmText('')
-        timer = setInterval(() => {
-
-            if (new Date().getTime() > expire) {
-                cancel()
-                return
-            }
-            setAlertContent(t('feature.check_access.upgrade_pro.desc', { time: TimeFormatter.countdown(expire) }))
-        }, 1000)
+    //     var expire = access.current.qualification.fast_expire
+    //     setShowFastAlert(true)
+    //     setKeepContent(false)
+    //     setAlertTitle(t('feature.check_access.upgrade_pro.title'))
+    //     setAlertContent(t('feature.check_access.upgrade_pro.desc', { time: TimeFormatter.countdown(expire) }))
+    //     setShowCancel(false)
+    //     setConfirmText(t('feature.check_access.upgrade_pro.btn'))
+    //     setSubConfirmText('')
+    //     timer = setInterval(() => {
+
+    //         if (new Date().getTime() > expire) {
+    //             cancel()
+    //             return
+    //         }
+    //         setAlertContent(t('feature.check_access.upgrade_pro.desc', { time: TimeFormatter.countdown(expire) }))
+    //     }, 1000)
     }
 
     async function loseGain(access) {
@@ -261,20 +262,19 @@ export default function CheckAccess(props: { record: any, count: number }) {
 
         switch (trigger_event) {
             case 'FAST_STREAK_LOST':
-                desc = t('feature.check_access.lost_reason.fast_streak_lost', { date: date });
+                desc = t('feature.check_access.lost_reason.fast_streak_lost');
                 break;
             case 'SLEEP_STREAK_LOST':
-                desc = t('feature.check_access.lost_reason.sleep_streak_lost', { date: date });
+                desc = t('feature.check_access.lost_reason.sleep_streak_lost');
                 break;
             case 'FAST_SLEEP_STREAKS_LOST':
-                desc = t('feature.check_access.lost_reason.fast_sleep_streaks_lost', { date: date });
+                desc = t('feature.check_access.lost_reason.fast_sleep_streaks_lost');
                 break;
             case 'SLEEP_STREAK_NOT_GROWING':
-                debugger
                 desc = t('feature.check_access.lost_reason.sleep_streak_not_growing');
                 break;
             case 'NOT_SATISFIED_AFTER_DELETE':
-                desc = t('feature.check_access.lost_reason.not_satisfied_after_delete');
+                desc = t('feature.check_access.lost_reason.not_satisfied_after_delete',{day:condition.streak_fast_min_required});
                 break;
             case 'NA':
             default:
@@ -287,9 +287,9 @@ export default function CheckAccess(props: { record: any, count: number }) {
         setShowFastAlert(true)
         setKeepContent(false)
         setAlertTitle(t('feature.check_access.lose_access.title'))
-        setAlertContent(t('feature.check_access.lose_access.desc', { type: desc, require_days: condition.streak_fast_min_required }))
+        setAlertContent(t('feature.check_access.lose_access.desc', { reason: desc, require_days: condition.streak_fast_min_required }))
         setShowCancel(false)
-        setConfirmText(t('feature.check_access.lose_access.cancel'))
+        setConfirmText(t('feature.check_access.lose_access.btn'))
         // setConfirmText('Become a PRO member')
         setSubConfirmText('')
         Taro.setStorage({ key: 'showedDisqualifiedAlert', data: true })

Някои файлове не бяха показани, защото твърде много файлове са промени