File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -46,13 +46,13 @@ export default (dir: string) => {
4646 this . info ( '[l10n] Building translation chunks for components' )
4747 // This will split translations in a map like "using file(s)" => {locale, translations}
4848 for ( const locale in allTranslations ) {
49- const currentTranslations = allTranslations [ locale ]
49+ const currentTranslations = allTranslations [ locale ] !
5050 for ( const [ usage , msgIds ] of Object . entries ( context ) ) {
5151 if ( ! ( usage in translations ) ) {
5252 translations [ usage ] = [ ]
5353 }
5454 // split the translations by usage in components
55- translations [ usage ] . push ( {
55+ translations [ usage ] ! . push ( {
5656 l : locale ,
5757 // We simply filter those translations whos msg IDs are used by current context
5858 // eslint-disable-next-line @typescript-eslint/no-unused-vars
@@ -93,7 +93,7 @@ export default (dir: string) => {
9393 const match = id . match ( / \0 l 1 0 n w r a p p e r \? s o u r c e = ( .+ ) / )
9494 if ( match ) {
9595 // In case this is the wrapper module we provide a module that imports only the required translations and exports t and n functions
96- const source = decodeURIComponent ( match [ 1 ] )
96+ const source = decodeURIComponent ( match [ 1 ] ! )
9797 // filter function to check the paths (files that use this translation) includes the current source
9898 const filterByPath = ( paths : string ) => paths . split ( ':' ) . some ( ( path ) => source . endsWith ( path ) )
9999 // All translations that need to be imported for the current source
Original file line number Diff line number Diff line change @@ -45,7 +45,7 @@ async function parseFile(fileName: string) {
4545 const po = await readFile ( fileName )
4646
4747 // compress translations
48- const json = Object . fromEntries ( Object . entries ( poParser . parse ( po ) . translations [ '' ] )
48+ const json = Object . fromEntries ( Object . entries ( poParser . parse ( po ) . translations [ '' ] ! )
4949 // Remove the meta data entry
5050 . filter ( ( [ key ] ) => key !== '' )
5151 // Remove not translated string to save space
You can’t perform that action at this time.
0 commit comments