for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
/*
* This file is part of the Passbook package.
*
* (c) Eymen Gunay <[email protected]>
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Passbook\Pass;
/**
* Localization
class Localization implements LocalizationInterface
{
* Language of the localization
protected string $language;
* Localized images
* @var ImageInterface[]
protected array $images = [];
* Localized texts (token=>value)
* @var string[]
protected array $strings = [];
public function __construct($language)
$this->setLanguage($language);
}
* {@inheritdoc}
public function setLanguage($language): void
$this->language = $language;
public function getLanguage()
return $this->language;
public function addString($token, $value)
$this->strings[$token] = $value;
return $this;
public function addStrings(array $strings)
$this->strings = array_merge($this->strings, $strings);
public function getStrings()
return $this->strings;
public function getStringsFileOutput()
$output = '';
foreach ($this->strings as $token => $value) {
$output .= '"' . addslashes($token) . '" = "' . addslashes($value) . '";' . PHP_EOL;
return $output;
public function addImage(Image $image)
$this->images[] = $image;
public function getImages()
return $this->images;