Skip to content

Commit 7889d7e

Browse files
committed
added dismiss button in preloading toaster + variabilized un bunch of i18n labels
1 parent deae93b commit 7889d7e

File tree

4 files changed

+34
-2
lines changed

4 files changed

+34
-2
lines changed

mobile/src/i18n/en/index.ts

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ const en = {
2222
Add_to_my_pinned_events: `Add to my pinned events`,
2323
Visit_website: `Visit website`,
2424
Cancel: `Cancel`,
25+
Dismiss: `Dismiss`,
2526
Schedule: `Schedule`,
2627
Banner_Event: `Banner event`,
2728
Cancel_Back_To_Schedule: `Cancel and back to schedule page`,
@@ -117,6 +118,8 @@ const en = {
117118
User_uid: "User uid",
118119
Profile: "Profile",
119120
Logout: "Logout",
121+
Preloading_event_assets_for_offline_usage: `Preloading event assets for offline usage`,
122+
This_can_slow_down_the_app_a_little_bit_during_pre_loading: `This can slow down the app a little bit during pre-loading`,
120123
Anonymous_private_user_id: "Anonymous (private) user token",
121124
Public_user_id: "Public user token",
122125
How_and_where_can_I_contact_the_team: "How and where can I contact the team ?",

mobile/src/i18n/i18n-types.ts

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -98,6 +98,10 @@ type RootTranslation = {
9898
* C​a​n​c​e​l
9999
*/
100100
Cancel: string
101+
/**
102+
* D​i​s​m​i​s​s
103+
*/
104+
Dismiss: string
101105
/**
102106
* S​c​h​e​d​u​l​e
103107
*/
@@ -482,6 +486,14 @@ type RootTranslation = {
482486
* L​o​g​o​u​t
483487
*/
484488
Logout: string
489+
/**
490+
* P​r​e​l​o​a​d​i​n​g​ ​e​v​e​n​t​ ​a​s​s​e​t​s​ ​f​o​r​ ​o​f​f​l​i​n​e​ ​u​s​a​g​e
491+
*/
492+
Preloading_event_assets_for_offline_usage: string
493+
/**
494+
* T​h​i​s​ ​c​a​n​ ​s​l​o​w​ ​d​o​w​n​ ​t​h​e​ ​a​p​p​ ​a​ ​l​i​t​t​l​e​ ​b​i​t​ ​d​u​r​i​n​g​ ​p​r​e​-​l​o​a​d​i​n​g
495+
*/
496+
This_can_slow_down_the_app_a_little_bit_during_pre_loading: string
485497
/**
486498
* A​n​o​n​y​m​o​u​s​ ​(​p​r​i​v​a​t​e​)​ ​u​s​e​r​ ​t​o​k​e​n
487499
*/
@@ -634,6 +646,10 @@ export type TranslationFunctions = {
634646
* Cancel
635647
*/
636648
Cancel: () => LocalizedString
649+
/**
650+
* Dismiss
651+
*/
652+
Dismiss: () => LocalizedString
637653
/**
638654
* Schedule
639655
*/
@@ -1014,6 +1030,14 @@ export type TranslationFunctions = {
10141030
* Logout
10151031
*/
10161032
Logout: () => LocalizedString
1033+
/**
1034+
* Preloading event assets for offline usage
1035+
*/
1036+
Preloading_event_assets_for_offline_usage: () => LocalizedString
1037+
/**
1038+
* This can slow down the app a little bit during pre-loading
1039+
*/
1040+
This_can_slow_down_the_app_a_little_bit_during_pre_loading: () => LocalizedString
10171041
/**
10181042
* Anonymous (private) user token
10191043
*/

mobile/src/state/useConferenceDescriptor.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@ import {checkCache, preloadPicture} from "@/services/Cachings";
1919
import {Temporal} from "temporal-polyfill";
2020
import {CompletablePromiseQueue} from "@/models/utils";
2121
import {prepareSchedules} from "@/state/useSchedule";
22+
import {typesafeI18n} from "@/i18n/i18n-vue";
2223

2324
function getConferenceDescriptorDoc(eventId: EventId|undefined) {
2425
if(!eventId || !eventId.value) {
@@ -103,6 +104,7 @@ export function useOfflineEventPreparation(
103104
preparingOfflineScheduleToastIsOpenRef: Ref<boolean>,
104105
) {
105106

107+
const {LL} = typesafeI18n()
106108
return new Promise(resolve => {
107109
const LOGGER = Logger.named("useOfflineEventPreparation");
108110

@@ -127,7 +129,7 @@ export function useOfflineEventPreparation(
127129
const promisesQueue = new CompletablePromiseQueue({ concurrency: 20 })
128130

129131
const progressInterval = setInterval(() => {
130-
preparingOfflineScheduleToastMessageRef.value = `Preloading event assets for offline usage <u>${promisesQueue.completed} / ${promisesQueue.total}</u>...<br/><em>This can slow down the app a little bit during pre-loading...</em>`
132+
preparingOfflineScheduleToastMessageRef.value = `${LL.value.Preloading_event_assets_for_offline_usage()}: <u>${promisesQueue.completed} / ${promisesQueue.total}</u>...<br/><em>${LL.value.This_can_slow_down_the_app_a_little_bit_during_pre_loading()}...</em>`
131133
}, 500)
132134

133135
preparingOfflineScheduleToastIsOpenRef.value = true

mobile/src/views/event/SchedulePage.vue

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,9 +2,12 @@
22
<ion-page>
33
<ion-content :fullscreen="true" v-if="confDescriptor">
44
<current-event-header v-if="!hideHeader" :conf-descriptor="confDescriptor"/>
5-
<ion-toast position="top" style="--max-width: 70%"
5+
<ion-toast position="top" style="--max-width: 70%; --button-color: var(--color)"
66
:message="preparingOfflineScheduleToastMessageRef"
77
:is-open="preparingOfflineScheduleToastIsOpenRef"
8+
:buttons="[{text: 'Dismiss', role: LL.Cancel() }]"
9+
layout="stacked"
10+
@didDismiss="preparingOfflineScheduleToastIsOpenRef = false"
811
></ion-toast>
912
<ion-header class="toolbarHeader">
1013
<ion-toolbar>

0 commit comments

Comments
 (0)