Skip to content

Commit

Permalink
Merge branch 'master' into import-nand-lal
Browse files Browse the repository at this point in the history
  • Loading branch information
Harjot1Singh committed Jun 21, 2019
2 parents 100ff41 + fbc26dd commit 9967c85
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions lib/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -123,13 +123,13 @@ const main = async () => {
} ) )

// Generate translation sources for translations
const newTranslationSources = sources.map( ( _, sourceIndex ) =>
const newTranslationSources = sources.map( ( sourceName, sourceIndex ) =>
translation.map( ( name, index ) => ( {
id: ( translation.length * sourceIndex ) + newTranslationSourceId + index,
name_gurmukhi: name,
name_english: name,
name_gurmukhi: `${sourceName}-${name}`,
name_english: `${sourceName}-${name}`,
source_id: newSourceId + sourceIndex,
language_id: -1,
language_id: -( index + 1 ),
} ) ) )
.reduce( ( AllSources, translationSources ) => AllSources.concat( translationSources ), [] )

Expand All @@ -140,7 +140,7 @@ const main = async () => {
translation_source_id: (
newTranslationSourceId
+ index
+ sources.findIndex( sourceName => sourceName === data[ source ] )
+ ( translation.length * sources.findIndex( sourceName => sourceName === data[ source ] ) )
),
translation: data[ name ] || '',
additional_information: '{}',
Expand Down

0 comments on commit 9967c85

Please sign in to comment.