diff --git a/lib/import.js b/lib/import.js index f9249a996..876b5a80e 100644 --- a/lib/import.js +++ b/lib/import.js @@ -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 ), [] ) @@ -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: '{}',