From e01dfefbe723d14b61cf8b608b33f5278bd9ccee Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Thu, 11 Apr 2019 16:05:08 +0200 Subject: [PATCH] MOBILE-2982 lang: Fix load lang strings for plugins --- src/providers/lang.ts | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/providers/lang.ts b/src/providers/lang.ts index 266421412..04f8283ee 100644 --- a/src/providers/lang.ts +++ b/src/providers/lang.ts @@ -58,7 +58,7 @@ export class CoreLangProvider { * @param {string} [prefix] A prefix to add to all keys. */ addSitePluginsStrings(lang: string, strings: any, prefix?: string): void { - lang = lang.replace('_', '-'); // Use the app format instead of Moodle format. + lang = lang.replace(/_/g, '-'); // Use the app format instead of Moodle format. // Initialize structure if it doesn't exist. if (!this.sitePluginsStrings[lang]) { @@ -307,7 +307,7 @@ export class CoreLangProvider { return; } - lang = values[2].replace('_', '-'); // Use the app format instead of Moodle format. + lang = values[2].replace(/_/g, '-'); // Use the app format instead of Moodle format. if (!this.customStrings[lang]) { this.customStrings[lang] = {}; @@ -363,7 +363,7 @@ export class CoreLangProvider { * @param {string} value String value. */ loadString(langObject: any, lang: string, key: string, value: string): void { - lang = lang.replace('_', '-'); // Use the app format instead of Moodle format. + lang = lang.replace(/_/g, '-'); // Use the app format instead of Moodle format. if (this.translate.translations[lang]) { // The language is loaded.