WeblateOrg / weblate

Web based localization tool with tight version control integration.
https://weblate.org/
GNU General Public License v3.0
4.48k stars 993 forks source link

better error message for strange Unicode characters #9282

Closed Johann150 closed 1 year ago

Johann150 commented 1 year ago

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 commented 1 year ago

This should be already fixed by https://github.com/translate/translate/commit/e3e647fc99fb97db63d2c2c70b8b8f9d4c2bbe57, please upgrade.

github-actions[bot] commented 1 year ago

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