Skip to content

Commit

Permalink
fix(translation): Removed usage of deprecated global jQuery
Browse files Browse the repository at this point in the history
Signed-off-by: Ferdinand Thiessen <rpm@fthiessen.de>
  • Loading branch information
susnux committed Jan 12, 2023
1 parent 184d445 commit 8107698
Showing 1 changed file with 2 additions and 5 deletions.
7 changes: 2 additions & 5 deletions lib/translation.ts
Original file line number Diff line number Diff line change
Expand Up @@ -143,11 +143,7 @@ export function translatePlural(
export function loadTranslations(appName: string, callback: (...args: []) => unknown) {
// already available ?
if (hasAppTranslations(appName) || getLocale() === 'en') {
const deferred = $.Deferred()
const promise = deferred.promise()
promise.then(callback)
deferred.resolve()
return promise
return Promise.resolve().then(callback)
}

const url = generateFilePath(appName, 'l10n', getLocale() + '.json')
Expand Down Expand Up @@ -177,6 +173,7 @@ export function loadTranslations(appName: string, callback: (...args: []) => unk
if (result.translations) {
register(appName, result.translations)
}
return result
})
.then(callback)
}
Expand Down

0 comments on commit 8107698

Please sign in to comment.