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

Add highlight for '\v' escape sequence #637

Closed
kabachuha opened this issue Jun 20, 2020 · 4 comments
Closed

Add highlight for '\v' escape sequence #637

kabachuha opened this issue Jun 20, 2020 · 4 comments

Comments

@kabachuha
Copy link

Hello, poedit team!

When I was trying to combine two .po files I stumbled upon an error stating "'\v' escape sequence is not allowed". However, after I checked the file in poedit I didn't found any such characters, but it was present when I opened it in a text editor. You can get the '\v' character if you press shift and enter simultaneously on Windows.
'\v' escape sequence is rendered indistinguishable from the line translation, while '\n', '\t' and such are marked red.

My poedit version is 2.3.1, Windows.
I've attached an example .po file which shows the issue (remove .txt from the extension to open in poedit).
poeditbugreport.po.txt

@vslavik
Copy link
Owner

vslavik commented Jun 20, 2020

I'm not going to add syntax highlighting for anything as bizarre as vertical tabs.

If you feel like this invisible character should be filtered out, or otherwise better handled, I will happily welcome a PR to that effect. But there are many more invisible characters that may be accidentally entered, and that would be reasonable to QA check..

Personally I think it makes more sense to prevent vertical tab from being entered, i.e. filter it out in input. I don't know how common it is that people press Shift+Enter, though. I certainly learned about it only now…

More importantly, I did not get any such error after pressing Shift+Enter. So please do provide proper reproduction instructions including versions of everything, not just Poedit, and detailed steps. I mean for accidentally entering such things, not for seeing the gettext error in a doctored artificial PO file.

TIA!

@kabachuha
Copy link
Author

About the error.

I have two files updateto.po and updatefrom.po. 'updatefrom' doesn't have the '\v' character, but I inserted '\v' in the destination using shift+enter. When I open 'updateto.po' in poedit then push 'Catalogue/Update from POT file...' and select 'updatefrom.po', the following error pops up.
screenshot
updateto.po.txt
updatefrom.po.txt

How I enterred the character?

Suppose, I have the string:
"Line1\n
Line2"
I type the first line in the translation, then I press enter to start the new line while holding shift because the second starts with a capitalized letter (I had not been aware of that combination at the time). The translated line looks like:
"Line1
Line2"
Nothing suspicious except from the lacking '\n' what is quite easy to miss when translating fast enough.

And then I tried to make a po update which I've described above. I used just poedit 2.3.1 and Notepad++ 7.8.6 to find the character in files.

@vslavik
Copy link
Owner

vslavik commented Jun 20, 2020

Please read this document (which GitHub asked you to do when you created this issue), follow the instructions therein and provide the missing detailed information I asked for, including such basics as your Windows version, keyboard settings etc.

It seems that you didn't even read my reply where I told you that what you describe simply does not happen here.

@vslavik
Copy link
Owner

vslavik commented Apr 26, 2022

Closing in favor of #712.

@vslavik vslavik closed this as completed Apr 26, 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