Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
setLanguageName example
else
{
// Template required.
$filename
= 'drupal.pot';
}
$item
=
$reader
->
readItem
(
)
;
if
(
!
empty
(
$item
)
)
{
$uri
=
$this
->fileSystem->
tempnam
(
'temporary://', 'po_'
)
;
$header
=
$reader
->
getHeader
(
)
;
$header
->
setProjectName
(
$this
->
config
(
'system.site'
)
->
get
(
'name'
)
)
;
$header
->
setLanguageName
(
$language_name
)
;
$writer
=
new
PoStreamWriter
(
)
;
$writer
->
setURI
(
$uri
)
;
$writer
->
setHeader
(
$header
)
;
$writer
->
open
(
)
;
$writer
->
writeItem
(
$item
)
;
$writer
->
writeItems
(
$reader
)
;
$writer
->
close
(
)
;
$response
=
new
BinaryFileResponse
(
$uri
)
;