MOBILE-4630 pluginfile: Add lang to file download request
parent
337c69d60f
commit
fd9577cfbf
|
@ -97,6 +97,7 @@ export class CoreFilepoolProvider {
|
||||||
new RegExp('(\\?|&)forcedownload=[0-1]'),
|
new RegExp('(\\?|&)forcedownload=[0-1]'),
|
||||||
new RegExp('(\\?|&)preview=[A-Za-z0-9]+'),
|
new RegExp('(\\?|&)preview=[A-Za-z0-9]+'),
|
||||||
new RegExp('(\\?|&)offline=[0-1]', 'g'),
|
new RegExp('(\\?|&)offline=[0-1]', 'g'),
|
||||||
|
new RegExp(/(\\?|&)lang=[A-Za-z\-_]+/, 'g'),
|
||||||
];
|
];
|
||||||
|
|
||||||
// To handle file downloads using the queue.
|
// To handle file downloads using the queue.
|
||||||
|
|
|
@ -249,6 +249,19 @@ export class CoreLangProvider {
|
||||||
return format ? this.formatLanguage(this.currentLanguage, format) : this.currentLanguage;
|
return format ? this.formatLanguage(this.currentLanguage, format) : this.currentLanguage;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Get current language sync.
|
||||||
|
*
|
||||||
|
* @returns Current language or undefined.
|
||||||
|
*/
|
||||||
|
getCurrentLanguageSync(format?: CoreLangFormat): string | undefined {
|
||||||
|
if (this.currentLanguage === undefined) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
return format ? this.formatLanguage(this.currentLanguage, format) : this.currentLanguage;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Update a language code to the given format.
|
* Update a language code to the given format.
|
||||||
*
|
*
|
||||||
|
|
|
@ -211,7 +211,8 @@ export class CoreUrlUtilsProvider {
|
||||||
url = this.addParamsToUrl(url, { token });
|
url = this.addParamsToUrl(url, { token });
|
||||||
}
|
}
|
||||||
|
|
||||||
return this.addParamsToUrl(url, { offline: '1' }); // Always send offline=1 (it's for external repositories).
|
// Always send offline=1 (it's for external repositories).
|
||||||
|
return this.addParamsToUrl(url, { offline: '1', lang: CoreLang.getCurrentLanguageSync(CoreLangFormat.LMS) });
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue