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

Handling of defective .po files #282

Closed
jonasraoni opened this issue Jul 6, 2022 · 4 comments
Closed

Handling of defective .po files #282

jonasraoni opened this issue Jul 6, 2022 · 4 comments

Comments

@jonasraoni
Copy link
Contributor

If I try to load a .po file with the following content:

msgid "message.id"
msgstr "this line is ok"
this line is missing the initial quote"

It works, but the defective line is ignored. It would be great if the package could log a warning or fail with an exception (this could be probably configurable with a "strict mode", disabled by default to keep the compatibility).

I'll take a look in the code, perhaps I can contribute with another PR if you think the idea is ok.

jonasraoni referenced this issue in pkp/ops Jul 6, 2022
Currently translated at 100.0% (92 of 92 strings)

Translation: Open Preprint Systems/locale
Translate-URL: http://translate.pkp.sfu.ca/projects/ops/locale/en_US/
@oscarotero
Copy link
Member

Yeah, it makes sense to me. PR is appreciated, thanks!

@jonasraoni
Copy link
Contributor Author

jonasraoni commented Jul 6, 2022

Great, I'll take a look at the code and .po format, which is short and try to come up with something generic.
My objective is to also be able to use the package to validate/identify broken files, as I've flagged more types of invalid content in my review.

@jonasraoni
Copy link
Contributor Author

FYI, I've checked the .po format and I think it's too superficial, it's missing a lot of small details 🤔
I'll address the things that I saw and come up with a proposal.

jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 10, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 10, 2022
@jonasraoni
Copy link
Contributor Author

jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 20, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 20, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 22, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 22, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 23, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 23, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 23, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 23, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 23, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 23, 2022
…mplete plurals, missing key headers, duplicated/malformed headers)
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 23, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 23, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 24, 2022
… file, added method getWarnings() and introduced new function (loadStringExtended) to avoid breaking the Gettext\Loader\Loader contract
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 24, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 24, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 24, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 26, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 26, 2022
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 27, 2022
…orLine (switch if the error message should show the byte/line where the error happened) to the StrictPoLoader
jonasraoni added a commit to jonasraoni/Gettext that referenced this issue Jul 27, 2022
oscarotero added a commit that referenced this issue Jul 27, 2022
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