Skip to content

Commit

Permalink
Small adjustment
Browse files Browse the repository at this point in the history
  • Loading branch information
MichaelHoste committed Jul 7, 2023
1 parent 9df64ca commit e281979
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/calls/base.js
Original file line number Diff line number Diff line change
Expand Up @@ -343,7 +343,8 @@ class Base {
const targetXmlUnits = this.forceArray(targetXml.xliff.file.body['trans-unit']) // Ensure consistent array

// 4 Populate the loaded .xlf it with targets from Translation.io
const translatedTargetSegmentsHash = this.buildTranslatedTargetSegmentsHash(response.segments[language])
const translatedTargetSegments = response.segments[language]
const translatedTargetSegmentsHash = this.buildTranslatedTargetSegmentsHash(translatedTargetSegments)

// Iterate over XML units
targetXmlUnits.forEach(targetXmlUnit => {
Expand All @@ -362,6 +363,7 @@ class Base {
})
}

// For O(1) search optimization
buildTranslatedTargetSegmentsHash(segments) {
let translatedTargetSegmentsHash = {}

Expand Down

0 comments on commit e281979

Please sign in to comment.