@@ -85,7 +85,7 @@ export default class OtaClient {
85
85
private manifestHolder ?: Promise < Manifest > ;
86
86
private disableManifestCache = false ;
87
87
88
- private stringsCache : { [ file : string ] : Promise < any > } = { } ;
88
+ private stringsCache : { [ file : string ] : { [ language : string ] : Promise < any > } } = { } ;
89
89
private disableStringsCache = false ;
90
90
91
91
private disableJsonDeepMerge = false ;
@@ -273,13 +273,16 @@ export default class OtaClient {
273
273
let strings = { } ;
274
274
for ( const filePath of files ) {
275
275
let content ;
276
- if ( ! ! this . stringsCache [ filePath ] ) {
277
- content = await this . stringsCache [ filePath ] ;
276
+ if ( ! ! ( this . stringsCache [ filePath ] || { } ) [ language ] ) {
277
+ content = await this . stringsCache [ filePath ] [ language ] ;
278
278
} else {
279
279
if ( ! this . disableStringsCache ) {
280
- this . stringsCache [ filePath ] = this . getFileTranslations ( filePath , language ) ;
280
+ this . stringsCache [ filePath ] = {
281
+ ...this . stringsCache [ filePath ] ,
282
+ [ language ] : this . getFileTranslations ( filePath , language ) ,
283
+ } ;
281
284
}
282
- content = await this . stringsCache [ filePath ] ;
285
+ content = await this . stringsCache [ filePath ] [ language ] ;
283
286
}
284
287
if ( this . disableJsonDeepMerge ) {
285
288
strings = { ...strings , ...content } ;
0 commit comments