MOBILE-3947 lang: Remove usage of Ionic 1 strings types (mm and mma)

main
Pau Ferrer Ocaña 2023-11-17 13:54:42 +01:00
parent ce36245d83
commit b7322d696d
2 changed files with 5 additions and 10 deletions

View File

@ -268,7 +268,7 @@ export class AddonModWorkshopAssessmentPage implements OnInit, OnDestroy, CanLea
this.evaluateByProfile = await CoreUser.getProfile(this.assessment.gradinggradeoverby, this.courseId, true); this.evaluateByProfile = await CoreUser.getProfile(this.assessment.gradinggradeoverby, this.courseId, true);
} }
} catch (error) { } catch (error) {
CoreDomUtils.showErrorModalDefault(error, 'mm.course.errorgetmodule', true); CoreDomUtils.showErrorModalDefault(error, 'core.course.errorgetmodule', true);
} finally { } finally {
this.loaded = true; this.loaded = true;
} }

View File

@ -381,7 +381,7 @@ export class CoreLangProvider {
* @param strings Custom strings to load (tool_mobile_customlangstrings). * @param strings Custom strings to load (tool_mobile_customlangstrings).
*/ */
loadCustomStrings(strings: string): void { loadCustomStrings(strings: string): void {
if (strings == this.customStringsRaw) { if (strings === this.customStringsRaw) {
// Strings haven't changed, stop. // Strings haven't changed, stop.
return; return;
} }
@ -404,9 +404,9 @@ export class CoreLangProvider {
return; return;
} }
const lang = values[2].replace(/_/g, '-'); // Use the app format instead of Moodle format. const lang = this.formatLanguage(values[2], CoreLangFormat.App); // Use the app format instead of Moodle format.
if (lang == this.currentLanguage) { if (lang === this.currentLanguage) {
currentLangChanged = true; currentLangChanged = true;
} }
@ -414,12 +414,7 @@ export class CoreLangProvider {
this.customStrings[lang] = {}; this.customStrings[lang] = {};
} }
// Convert old keys format to new one. this.loadString(this.customStrings, lang, values[0], values[1]);
const key = values[0].replace(/^mm\.core/, 'core').replace(/^mm\./, 'core.').replace(/^mma\./, 'addon.')
.replace(/^core\.sidemenu/, 'core.mainmenu').replace(/^addon\.grades/, 'core.grades')
.replace(/^addon\.participants/, 'core.user');
this.loadString(this.customStrings, lang, key, values[1]);
}); });
this.customStringsRaw = strings; this.customStringsRaw = strings;