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

Address invalid localization files #8081

Open
jonasraoni opened this issue Jul 6, 2022 · 7 comments
Open

Address invalid localization files #8081

jonasraoni opened this issue Jul 6, 2022 · 7 comments
Assignees

Comments

@jonasraoni
Copy link
Contributor

Describe the bug
Some of our localization files might have an invalid syntax, they might work, due to lax parsers, but also cause unexpected issues with other softwares:

Solution

  • Ensure the .po files are valid at build time.
  • For stable-3_3_0 the lax behavior should be kept at runtime to avoid breaking plugins.
  • Fix the localization files

What application are you using?
OJS/main

@jonasraoni jonasraoni self-assigned this Jul 6, 2022
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/
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
jonasraoni added a commit to jonasraoni/pkp-lib that referenced this issue Jul 11, 2022
@jonasraoni
Copy link
Contributor Author

jonasraoni commented Jul 11, 2022

@asmecher I've created a PR for the pkp-lib/main here:

I've added a generic validator for the locale files, and most of the fixes are to satisfy the requirements and warnings of the msgfmt validator.

I've tried to isolate the commits, except the 4f379aa... There I used the gettext package to setup the plurals, and it also formatted and removed duplicated entries (inside the same file).

If everything sounds fine, I'll update the other branches.

p.s.: I'm able to reduce the line-break noise by doing a small change to the gettext package.

@jonasraoni
Copy link
Contributor Author

For the stable-3_3_0, I can pass my modified validator through the locale files, and fix the breaking issues.

I also think it's ok to add the validate-locale.sh in a non-breaking way (e.g. emit errors without failing the build)

@asmecher
Copy link
Member

Please hold off on this until we've reached a decision about translation workflows on this discussion: #8038

@jonasraoni
Copy link
Contributor Author

Ok! So I'll just commit fixes for the broken keys (e.g. missing quotes, bad escaping, ...).

@asmecher
Copy link
Member

Yes please -- I've recently merged translations from Weblate so now is a good time.

@jonasraoni
Copy link
Contributor Author

Just to confirm, I've updated the broken files.

@jonasraoni
Copy link
Contributor Author

jonasraoni commented Jul 28, 2022

@asmecher I've reviewed and moved the fixes related to duplicated keys here #8119

Also, I fixed the syntax errors on stable-3_3_0.

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

3 participants