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

better error message for strange Unicode characters #9282

Closed
Johann150 opened this issue May 20, 2023 · 2 comments
Closed

better error message for strange Unicode characters #9282

Johann150 opened this issue May 20, 2023 · 2 comments
Labels
bug Something is broken.
Milestone

Comments

@Johann150
Copy link

Describe the problem

My project "inherited" a Korean translation after a fork. The previous developers used another tool. When I tried importing the project into Weblate, there was an issue with the Korean translation file. My workaround was to exclude the Korean translation through the settings -> files -> language filter.

Today I figured out by chance that the file contained U+0008 (backspace) characters because file(1) said the file was "UTF-8 Unicode text, with overstriking". After removing these characters, Weblate could handle the file fine.

Describe the solution you'd like

The error message I got was very vague and unspecific:

Could not parse 1 matched file. locales/ko-KR.yml: 'ReaderError' object has no attribute 'message'.

Instead of this I would have liked a more specific error message. Ideally something like

Could not parse 1 matched file. locales/ko-KR.yml: Line 42 contains Unicode characters that Weblate cannot handle.

Describe alternatives you've considered

No response

Screenshots

No response

Additional context

The Korean translation file in question can be found here:

with overstriking (broken): https://akkoma.dev/FoundKeyGang/FoundKey/src/commit/87e1e658f2975fa07c1db7730b898047abaf4b63/locales/ko-KR.yml
without overstriking (fixed): https://akkoma.dev/FoundKeyGang/FoundKey/src/commit/7a94e9f2d5804b6331272cc5d9db2ff12d8fde05/locales/ko-KR.yml

@nijel nijel added the bug Something is broken. label May 25, 2023
@nijel nijel added this to the 4.15.1 milestone May 25, 2023
@nijel
Copy link
Member

nijel commented May 25, 2023

This should be already fixed by translate/translate@e3e647f, please upgrade.

@nijel nijel closed this as completed May 25, 2023
@github-actions
Copy link

Thank you for your report; the issue you have reported has just been fixed.

  • In case you see a problem with the fix, please comment on this issue.
  • In case you see a similar problem, please open a separate issue.
  • If you are happy with the outcome, don’t hesitate to support Weblate by making a donation.

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

No branches or pull requests

2 participants