src/Entity/LocalisedString.php
public function setTranslation(string $locale, string $value)
    {
        if (strlen($value) === 0) {
            unset($this->translations[$locale]);
        } else {
            $this->translations[$locale] = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
        }
        return $this;
    }
public function setTranslation(string $locale, string $value)
    {
        if (strlen($value) === 0) {
            unset($this->translations[$locale]);
        } else {
            $this->translations[$locale] = mb_convert_encoding($value, 'UTF-8', 'UTF-8');
        }
        return $this;
    }
public function setTranslation ( string $ locale , string $ value ) { if ( strlen ( $ value ) === 0 ) { unset ( $ this -> translations [ $ locale ] ) ; } else { $ this -> translations [ $ locale ] = mb_convert_encoding ( $ value , 'UTF-8' , 'UTF-8' ) ; } return $ this ; }
Sets a translation of the localised string.
@param string $locale
@param string $value
@return $this
Sets a translation of the localised string .