Code
Explorer
You are a developer and looking for Shopware projects?
Apply Now!
isPlural example
if
(
isset
(
$plural
)
&&
$p
=
$header
->
parsePluralForms
(
$plural
)
)
{
[
$nplurals
,
$formula
]
=
$p
;
\Drupal::
service
(
'locale.plural.formula'
)
->
setPluralFormula
(
$langcode
,
$nplurals
,
$formula
)
;
}
}
}
/** * {@inheritdoc} */
public
function
writeItem
(
PoItem
$item
)
{
if
(
$item
->
isPlural
(
)
)
{
$item
->
setSource
(
implode
(
PoItem::DELIMITER,
$item
->
getSource
(
)
)
)
;
$item
->
setTranslation
(
implode
(
PoItem::DELIMITER,
$item
->
getTranslation
(
)
)
)
;
}
$this
->
importString
(
$item
)
;
}
/** * {@inheritdoc} */
public
function
writeItems
(
PoReaderInterface
$reader
,
$count
= -1
)
{
$forever
=
$count
== -1;