Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fatal: strlen() expects parameter 1 to be string MoGenerator.php #265

Closed
Alexkurd opened this issue Dec 20, 2020 · 1 comment
Closed

Fatal: strlen() expects parameter 1 to be string MoGenerator.php #265

Alexkurd opened this issue Dec 20, 2020 · 1 comment

Comments

@Alexkurd
Copy link

Uncaught TypeError: strlen() expects parameter 1 to be string, int given in \lib\vendors\gettext\gettext\src\Generator\MoGenerator.php:70
Stack trace:
#0 \lib\vendors\gettext\gettext\src\Generator\MoGenerator.php(70): strlen(123456)
#1 \lib\vendors\gettext\gettext\src\Generator\Generator.php(12): Gettext\Generator\MoGenerator->generateString(Object(Gettext\Translations))

test.po file

msgid ""
msgstr ""
"Content-Transfer-Encoding: 8bit\n"

msgid "123456"
msgstr "12345"

$filename = "test.po";
$poLoader = new Gettext\Loader\PoLoader();
$data = $poLoader->loadFile($filename);

$moGenerator = new Gettext\Generator\MoGenerator();
$filename = str_ireplace('.po', '.mo', $filename);
$moGenerator->generateFile($data, $filename);

@oscarotero
Copy link
Member

I just released a the new version 5.5.4 including a fix for this bug.
Thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants