ttag-org / ttag

:orange_book: simple approach for javascript localization
https://ttag.js.org/
MIT License
345 stars 43 forks source link

Wrong definition of header in .po file #154

Closed mkosir closed 5 years ago

mkosir commented 5 years ago

When generating new .po file for example en language, Plural-Forms in header is defined with JavaScript comparison operators like this: "Plural-Forms: nplurals = 2; plural = (n !== 1);\n" but it should be like this: "Plural-Forms: nplurals=2; plural=n != 1;\n"

AlexMost commented 5 years ago

Hi @mkosir ! It works in a way that it was defined in https://github.com/ttag-org/plural-forms/blob/master/src/catalog.js#L435. The problem is with extra spaces or with !== ? Seems like we must not use !== because it works only in javascript.

mkosir commented 5 years ago

Yes, I changed it manually from !== to != . Also you can try to open it with Poedit, which will give you warnings in first case. Keep up the good work, I'm still a fan of this library, I get a filling that most of the libraries this days are trying to reinvent the wheel with "json based translation files" which you cant generate from code.

AlexMost commented 5 years ago

Thanks for the good words! Will try to fix it soon.

AlexMost commented 5 years ago

you can try fix in 1.7.4.