Skip to content

Commit d511cbc

Browse files
committed
WIP: Fixed new import progress text changes from develop
- Only added English translation
1 parent e01dee1 commit d511cbc

File tree

3 files changed

+11
-9
lines changed

3 files changed

+11
-9
lines changed

src/components/profiles-modals/ImportProfileModal.vue

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -254,12 +254,11 @@ async function onImportTargetSelected() {
254254
255255
async function importProfile(targetProfileName: string, mods: ExportMod[], zipPath: string) {
256256
activeStep.value = 'PROFILE_IS_BEING_IMPORTED';
257-
importPhaseDescription.value = 'Downloading mods: 0%';
258-
const progressCallback = (progress: number|string, modName: string, status: number) => {
259-
console.log(progress);
260-
return typeof progress === "number"
261-
? importPhaseDescription.value = t('translations.pages.profileSelection.importProfileModal.states.importInProgress.title.downloadingMods', {progress: Math.floor(progress), totalSize: FileUtils.humanReadableSize(profileTotalDownloadSize.value)})
262-
: importPhaseDescription.value = t(`translations.pages.profileSelection.importProfileModal.states.importInProgress.title.${progress}`, {progress: status, totalSize: FileUtils.humanReadableSize(profileTotalDownloadSize.value)})
257+
importPhaseDescription.value = t('translations.pages.profileSelection.importProfileModal.states.importInProgress.title.downloadingMods');
258+
const progressCallback = (state: number|string, modName: string, progress: number) => {
259+
return typeof state === "number"
260+
? importPhaseDescription.value = t('translations.pages.profileSelection.importProfileModal.states.importInProgress.title.downloadingModsWithGoal', {progress: Math.floor((state / profileTotalDownloadSize.value) * 100), totalSize: FileUtils.humanReadableSize(profileTotalDownloadSize.value), modName: modName })
261+
: importPhaseDescription.value = t(`translations.pages.profileSelection.importProfileModal.states.importInProgress.title.${state}`, {progress: progress, totalSize: FileUtils.humanReadableSize(profileTotalDownloadSize.value), modName: modName })
263262
};
264263
const isUpdate = importUpdateSelection.value === 'UPDATE';
265264
@@ -268,8 +267,8 @@ async function importProfile(targetProfileName: string, mods: ExportMod[], zipPa
268267
profileTotalDownloadSize.value = await DownloadUtils.getTotalDownloadSizeInBytes(combos, store.state.download.ignoreCache);
269268
270269
await store.dispatch('download/downloadToCache', {combos, progressCallback});
271-
await ProfileUtils.populateImportedProfile(combos, mods, targetProfileName, isUpdate, zipPath, (progress) => {
272-
importPhaseDescription.value = progress;
270+
await ProfileUtils.populateImportedProfile(combos, mods, targetProfileName, isUpdate, zipPath, (status, modName, progress) => {
271+
importPhaseDescription.value = t(`translations.pages.profileSelection.importProfileModal.states.importInProgress.title.${status}`, { progress: progress, modName: modName });
273272
});
274273
} catch (e) {
275274
await store.dispatch('profiles/ensureProfileExists');

src/i18n/base/pages/ProfileSelectionMessageFormat.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -132,6 +132,7 @@ export type ProfileSelectionMessageFormat = {
132132
importInProgress: {
133133
title: {
134134
downloadingMods: string;
135+
downloadingModsWithGoal: string;
135136
cleaningUp: string;
136137
applyChanges: string,
137138
copyingModsToProfile: string;

src/i18n/en/pages/ProfileSelectionTranslation.ts

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,10 +137,12 @@ export const ProfileSelectionTranslation: ProfileSelectionMessageFormat = {
137137
importInProgress: {
138138
title: {
139139
downloadingMods: 'Downloading mods: {progress}%',
140+
downloadingModsWithGoal: `Downloading mods: {progress}% of {totalSize}`,
140141
cleaningUp: 'Cleaning up',
141142
applyChanges: 'Applying changes to updated profile',
142143
copyingModsToProfile: 'Copying mods to profile: {progress}%',
143-
copyingConfigsToProfile: 'Copying configs to profile: {progress}%',
144+
copyingConfigsToProfile: 'Copying configs to profile: {progress}%'
145+
144146
},
145147
content: {
146148
waitMessage: 'This may take a while, as files are being downloaded, extracted, and copied.',

0 commit comments

Comments
 (0)