File tree Expand file tree Collapse file tree 1 file changed +3
-3
lines changed
Expand file tree Collapse file tree 1 file changed +3
-3
lines changed Original file line number Diff line number Diff line change @@ -63,7 +63,7 @@ export class MoodleTranslateLoader implements TranslateLoader {
6363 * @returns Promise resolved with the translations object or empty object if not found.
6464 */
6565 protected async loadLanguage ( lang : string ) : Promise < TranslationObject > {
66- // Return the imported translations for the requested language
66+ // Return the imported translations for the requested language.
6767 let translation = await this . fetchLanguageFile ( lang ) ;
6868
6969 this . translations [ lang ] = translation ;
@@ -103,7 +103,7 @@ export class MoodleTranslateLoader implements TranslateLoader {
103103 } catch ( error ) {
104104 this . logger . error ( 'Error fetching language file' , lang , error ) ;
105105
106- return { } ;
106+ throw error ;
107107 }
108108 }
109109
@@ -115,7 +115,7 @@ export class MoodleTranslateLoader implements TranslateLoader {
115115 * @returns Parent language code or undefined if not found.
116116 */
117117 getParentLanguage ( lang : string ) : string | undefined {
118- const parentLang = this . translations [ lang ] [ MoodleTranslateLoader . PARENT_LANG_KEY ] as string | undefined ;
118+ const parentLang = this . translations [ lang ] ?. [ MoodleTranslateLoader . PARENT_LANG_KEY ] as string | undefined ;
119119 if ( parentLang && parentLang !== MoodleTranslateLoader . PARENT_LANG_KEY && parentLang !== lang ) {
120120 return parentLang ;
121121 }
You can’t perform that action at this time.
0 commit comments