diff --git a/src/core/directives/external-content.ts b/src/core/directives/external-content.ts index 4663b44d7..c6a464c81 100644 --- a/src/core/directives/external-content.ts +++ b/src/core/directives/external-content.ts @@ -35,6 +35,7 @@ import { CoreSite } from '@classes/site'; import { CoreEventObserver, CoreEvents } from '@singletons/events'; import { CoreConstants } from '../constants'; import { CoreNetwork } from '@services/network'; +import { Translate } from '@singletons'; /** * Directive to handle external content. @@ -217,7 +218,7 @@ export class CoreExternalContentDirective implements AfterViewInit, OnChanges, O if (!site.canDownloadFiles() && isSiteFile) { this.element.parentElement?.removeChild(this.element); // Remove element since it'll be broken. - throw new CoreError('Site doesn\'t allow downloading files.'); + throw new CoreError(Translate.instant('core.cannotdownloadfiles')); } const finalUrl = await this.getUrlToUse(targetAttr, url, site); diff --git a/src/core/services/filepool.ts b/src/core/services/filepool.ts index 73c7dd48d..3c503deaf 100644 --- a/src/core/services/filepool.ts +++ b/src/core/services/filepool.ts @@ -374,7 +374,7 @@ export class CoreFilepoolProvider { const site = await CoreSites.getSite(siteId); if (!site.canDownloadFiles()) { - throw new CoreError('Site doesn\'t allow downloading files.'); + throw new CoreError(Translate.instant('core.cannotdownloadfiles')); } if (!alreadyFixed) { @@ -745,7 +745,7 @@ export class CoreFilepoolProvider { this.filePromises[siteId][downloadId] = CoreSites.getSite(siteId).then(async (site) => { if (!site.canDownloadFiles()) { - throw new CoreError('Site doesn\'t allow downloading files.'); + throw new CoreError(Translate.instant('core.cannotdownloadfiles')); } const entry = await CoreWS.downloadFile(fileUrl, path, addExtension, onProgress);