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

MoLoader get error if msgid_plural string with msgstr[1] #246

Closed
RicherYang opened this issue Feb 9, 2020 · 1 comment
Closed

MoLoader get error if msgid_plural string with msgstr[1] #246

RicherYang opened this issue Feb 9, 2020 · 1 comment

Comments

@RicherYang
Copy link

The .po file is like

msgid "%s has been added to your cart."
msgid_plural "%s have been added to your cart."
msgstr[0] "%s has been added to your cart."
msgstr[1] "%s have been added to your cart."

when i try to load that .mo file with MoLoader get the php error
TypeError: Argument 1 passed to Gettext\Translation::translatePlural() must be of the type string, array given, called in composer\vendor\gettext\gettext\src\Loader\MoLoader.php on line 100 in composer\vendor\gettext\gettext\src\Translation.php on line 148

Both the .mo build with the library or Poedit get the same erro.

use Gettext 5.2.1 with php 7.3.13

@oscarotero
Copy link
Member

Yes, It's an error indeed.
New version 5.2.2 released with this patch. Thank you!

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