From a4349077dfadeb0b4fba888adc2027a23e57685f Mon Sep 17 00:00:00 2001 From: Dani Palou Date: Fri, 8 Mar 2019 10:13:01 +0100 Subject: [PATCH] MOBILE-2912 lang: Fix coumpound langs for site plugins --- src/providers/lang.ts | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/providers/lang.ts b/src/providers/lang.ts index 621a89a19..266421412 100644 --- a/src/providers/lang.ts +++ b/src/providers/lang.ts @@ -58,6 +58,8 @@ 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. + // Initialize structure if it doesn't exist. if (!this.sitePluginsStrings[lang]) { this.sitePluginsStrings[lang] = {}; @@ -305,7 +307,7 @@ export class CoreLangProvider { return; } - lang = values[2]; + lang = values[2].replace('_', '-'); // Use the app format instead of Moodle format. if (!this.customStrings[lang]) { this.customStrings[lang] = {}; @@ -361,6 +363,8 @@ 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. + if (this.translate.translations[lang]) { // The language is loaded. // Store the original value of the string.