Skip to content

Commit

Permalink
Updated to work if context is set in POEditor
Browse files Browse the repository at this point in the history
  • Loading branch information
Henrik B Hansen committed May 14, 2020
1 parent 9b69e0a commit 4ebec51
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/Translation.php
Original file line number Diff line number Diff line change
Expand Up @@ -119,8 +119,8 @@ public function download(): Collection
], 'POST');

$content = collect($this->query($response['result']['url']))
->map(function ($entry) {
return trim($entry);
->mapWithKeys(function ($entry, $key) {
return is_array($entry) ? [trim(array_key_first($entry)) => array_pop($entry)] : [$key => trim($entry)];
})
->sortKeys()
->toJson(JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE);
Expand Down

0 comments on commit 4ebec51

Please sign in to comment.