Merge pull request #1799 from dpalou/MOBILE-2912
MOBILE-2912 lang: Fix coumpound langs for site pluginsmain
commit
513c7e452b
|
@ -58,6 +58,8 @@ export class CoreLangProvider {
|
||||||
* @param {string} [prefix] A prefix to add to all keys.
|
* @param {string} [prefix] A prefix to add to all keys.
|
||||||
*/
|
*/
|
||||||
addSitePluginsStrings(lang: string, strings: any, prefix?: string): void {
|
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.
|
// Initialize structure if it doesn't exist.
|
||||||
if (!this.sitePluginsStrings[lang]) {
|
if (!this.sitePluginsStrings[lang]) {
|
||||||
this.sitePluginsStrings[lang] = {};
|
this.sitePluginsStrings[lang] = {};
|
||||||
|
@ -305,7 +307,7 @@ export class CoreLangProvider {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
lang = values[2];
|
lang = values[2].replace('_', '-'); // Use the app format instead of Moodle format.
|
||||||
|
|
||||||
if (!this.customStrings[lang]) {
|
if (!this.customStrings[lang]) {
|
||||||
this.customStrings[lang] = {};
|
this.customStrings[lang] = {};
|
||||||
|
@ -361,6 +363,8 @@ export class CoreLangProvider {
|
||||||
* @param {string} value String value.
|
* @param {string} value String value.
|
||||||
*/
|
*/
|
||||||
loadString(langObject: any, lang: string, key: string, value: string): void {
|
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]) {
|
if (this.translate.translations[lang]) {
|
||||||
// The language is loaded.
|
// The language is loaded.
|
||||||
// Store the original value of the string.
|
// Store the original value of the string.
|
||||||
|
|
Loading…
Reference in New Issue