Version: (using Devel)
Installed from: Compiled sources
In french we use unbreakable spaces a lot. Unbreakable spaces are like normal spaces characters, excepted that they can't be the last character of a line. They are used to avoid some expressions or punctuation signs to be cut on line wrap.
It looks like Lokalize doesn't handle unbreakable spaces in translated messages. When opening a .po catalog which contains one, it is automatically replaced by a normal space. Lokalize need to keep unbreakable spaces in opened files.
We also need a way to type an unbreakable space in Lokalize. In KBabel this used to be Alt+Space (if I remember correctly). The same in Lokalize would be great.
This is also needed for Norwegian. It would also be nice if unbreakable spaces were highlighted in a different colour, so that they would be easier to see.
Yes, good idea. And it would be even better if unbreakeable space could be inserted automatically when a user hit space. Of course, rules would be language dependant. For example, in French, space should be unbreable before : ; ? ! % » / and after «
> unbreable before : ; ? ! % »
this is candidate for script ran on saving.
Yes, but translators need to see if those unbreakable spaces have been correctly setted, so it would be better if those space could be added manually first.
More over, Pology scripts already do that job.
> More over, Pology scripts already do that job.
The very best would be to integrate Pology into Lokalize :)
The doc is in /trunk/l10n-kde4/scripts/pology/doc/html/
Good luck ! ;)
this is a bug in Qt. I already submitted request.
Do you have the id of this bug in the Qt Bug Tracker ?
This sounds like a bug, and I've created task 227284 for our development
team. You can use this ID to track the status of this task online:
meanwhile i made entering unbreakable spaces possible. they also preserved if you don't touch them. the only case where they're lost now is when you use clipboard
Thanks a lot :)
As we could see here :
The bug report has been rejected. Do you have any idea about how to close this issue ?
The solution would be to remove
txt.replace(QChar::Nbsp, QLatin1Char(' '));
from the QTextDocument::toPlainText() method.
But I’m really puzzled why it’s there in the first place. If the object of this method is to ‘dumb down’ down text and remove information, it should for example convert all of U+2000 to U+200A to normal spaces, neuter the quotation marks “”„‟ to ", &c (it doesn’t). But why would anyone want to do this? And why would anyone want to replace hard spaces by normal spaces? I looks like serious misdesign of the original method.
Yeah, that's a nonsense in my opinion, but it's probably because Qt API uses this method internally and needs this behavior. But I agree with you, the method name does not reflect this behavior.
toPlainText() should return plain text, and toAsciiPlainText() should be the right name for the actual toPlainText().
Since it’s not possible to copy non-breaking spaces, a icon for inserting them would be nice …
In reply to Karl :
As Nick Shaforostoff said :
meanwhile i made entering unbreakable spaces possible. they also preserved if
you don't touch them. the only case where they're lost now is when you use
The only problem is now that copy/paste does not keep unbreakable space, so I don't think an icon for inserting them is useful
> The only problem is now that copy/paste does not keep unbreakable
> space, so I don't think an icon for inserting them is useful
Isn’t that exactly why an icon for them *would* be useful? Since you can’t copy them from other strings or KCharselect, the only way of inserting them would be directly in Lokalize. I don’t think my keyboard layout supports inserting them directly (or at least I don’t know how to do it, or how to check it afterwards, as they are lost on copy).
Try Alt+Space, it works on french keyboard
SVN commit 919334 by shaforo:
-move almost all functionality from KAiderView to a new XliffTextEdit.
-implement clipboard handling for text with markup
-as a bonus this made unbreakable spaces preserved in clipboard operations.
M +1 -0 CMakeLists.txt
M +13 -10 catalog/catalog.cpp
M +2 -1 catalog/catalog.h
M +3 -2 catalog/catalogstorage.h
M +23 -1 catalog/catalogstring.cpp
M +17 -6 catalog/catalogstring.h
M +4 -3 catalog/cmd.cpp
M +3 -2 catalog/gettext/gettextstorage.h
M +8 -8 catalog/pos.cpp
M +7 -6 catalog/pos.h
M +29 -23 catalog/xliff/xliffstorage.cpp
M +3 -2 catalog/xliff/xliffstorage.h
M +108 -113 kaider.cpp
M +8 -8 kaider.h
M +51 -51 kaider_findreplace.cpp
M +88 -920 kaiderview.cpp
M +39 -67 kaiderview.h
M +1 -1 lokalizemainwindow.cpp
M +11 -0 main.cpp
M +3 -3 mergemode/mergecatalog.cpp
M +1 -1 mergemode/mergecatalog.h
M +1 -1 mergemode/mergeview.cpp
AM xlifftextedit.cpp kaiderview.cpp#918911 [License: GPL (v2+) (+Qt exception)]
AM xlifftextedit.h kaiderview.h#918911 [License: GPL (v2+) (+Qt exception)]
WebSVN link: http://websvn.kde.org/?view=rev&revision=919334
Great! Thank you so much! KBabel is now definetly dead ;-)