|
1 | 1 | import {showError} from './errors'
|
2 | 2 | import {showFirstScreen, loadLastScreen, showLoadingScreen, showOopsScreen} from './screens'
|
3 |
| -import { default as PostUpdater } from './postUpdate' |
| 3 | +import {default as PostUpdater} from './postUpdate' |
4 | 4 |
|
5 | 5 | (($) => {
|
6 | 6 | let doneActions = (requestFailed, $heading, downloadingInitialExtensionsText, savingResultsText, $errorPopup, activationFailedText, $popup, loadAnimation) => {
|
@@ -84,17 +84,19 @@ import { default as PostUpdater } from './postUpdate'
|
84 | 84 | }
|
85 | 85 |
|
86 | 86 | function doAction (i, finishCb) {
|
87 |
| - let action = actions[ i ] |
| 87 | + let action = actions[i] |
88 | 88 | const testPattern = new RegExp('^updatePosts$')
|
89 | 89 | if (action.action && testPattern.test(action.action)) {
|
90 | 90 | const postUpdater = new PostUpdater(window.vcvElementsGlobalsUrl, window.vcvVendorUrl, window.vcvUpdaterUrl)
|
91 |
| - const postUpdateText = 'Update posts {i} in {cnt}: {name}' |
| 91 | + const localizations = window.VCV_I18N && window.VCV_I18N() |
| 92 | + const postUpdateText = localizations ? localizations.postUpdateText : 'Update posts {i} in {cnt}: {name}' |
92 | 93 | const doUpdatePostAction = async (posts, postsIndex, finishCb) => {
|
93 |
| - const postData = posts[ postsIndex ] |
| 94 | + const postData = posts[postsIndex] |
94 | 95 | $heading.text(postUpdateText.replace('{i}', postsIndex + 1).replace('{cnt}', posts.length).replace('{name}', postData.name || 'No name'))
|
95 | 96 | try {
|
96 | 97 | await postUpdater.update(postData)
|
97 |
| - } catch (e) {} |
| 98 | + } catch (e) { |
| 99 | + } |
98 | 100 | if (postsIndex + 1 < posts.length) {
|
99 | 101 | return doUpdatePostAction(posts, postsIndex + 1, finishCb)
|
100 | 102 | } else {
|
@@ -169,5 +171,5 @@ import { default as PostUpdater } from './postUpdate'
|
169 | 171 | }
|
170 | 172 | }
|
171 | 173 |
|
172 |
| - module.exports = { doneActions: doneActions, processActions: processActions } |
| 174 | + module.exports = {doneActions: doneActions, processActions: processActions} |
173 | 175 | })(window.jQuery)
|
0 commit comments