Skip to content

Commit

Permalink
Fix passing translation in ZIP file name
Browse files Browse the repository at this point in the history
  • Loading branch information
priyadi committed Oct 8, 2023
1 parent 41d45c7 commit e4e80f1
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,9 @@
# CHANGELOG

## 1.5.6

* Fix passing translation in ZIP file name.

## 1.5.5

* `FileCollection` and `ReadableFileCollection` now accept a translated name.
Expand Down
4 changes: 3 additions & 1 deletion packages/file-zip/src/DirectoryResourceServer.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,9 @@ public function __construct(
#[AsTemporaryUrlResourceTransformer]
public function transform(DirectoryInterface $files): Directory
{
$name = $files->getName()->trans($this->translator);
$name = $files->getName();
$name->setExtension('zip');
$name = $name->trans($this->translator);
$directory = new Directory($name);

foreach ($files as $file) {
Expand Down

0 comments on commit e4e80f1

Please sign in to comment.