Skip to content

Commit

Permalink
Merge pull request #764 from ga-devfront/fix/translator
Browse files Browse the repository at this point in the history
fix: translator to match to xlf format files
  • Loading branch information
ga-devfront authored Jul 9, 2024
2 parents 5ea2b2e + b95c5d4 commit f4802d3
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions classes/UpgradeTools/Translator.php
Original file line number Diff line number Diff line change
Expand Up @@ -44,8 +44,10 @@ private function loadTranslations()
private function loadXlfFile($filePath)
{
$xml = new SimpleXMLElement(file_get_contents($filePath));
foreach ($xml->file->body->{'trans-unit'} as $unit) {
$this->translations[(string) $unit->source] = (string) $unit->target;
foreach ($xml->file as $file) {
foreach ($file->body->{'trans-unit'} as $unit) {
$this->translations[(string) $unit->source] = (string) $unit->target;
}
}
}

Expand Down

0 comments on commit f4802d3

Please sign in to comment.