This would save me so much trouble while translating. It would be great to have automatic quotes and dashes substitutions, instead of always having plain dashes and quotes. I believe ktextaddons have this already implemented. It would be even better if KXMLGUI had this built-in like macOS, but Lokalize having it would suffice for now. For instance: - "%1" should auto-substitute to “%1” (or locale-specific other qutoes) - It's should auto-substitute to It’s - I am not sure how ktextaddons does this but for instance, having -- to en dash, and --- to em dash would be splendid. HIG suggests using these fancy characters, and having this built-into Lokalize would help a lot for sanitising the strings with these characters.
I have successfully reproduced this behavior. I checked the source and saw that XliffTextEdit inherits from KTextEdit, which doesn't seem to support smart substitutions . I would like to attempt implementing this feature (likely by intercepting keyPressEvent or using a textChanged signal to swap the characters). Is it okay if I assign this to myself?
Or you can just implement ktextaddons’ smart substitution behaviour, just like KMail does. Then we can decide whether it’s a good idea to have it enabled by default. Even more, implementing this in kxmlgui as a standard feature would allow most applications have this behaviour for free.
(In reply to Emir SARI from comment #2) > Or you can just implement ktextaddons’ smart substitution behaviour, just > like KMail does. Then we can decide whether it’s a good idea to have it > enabled by default. > > Even more, implementing this in kxmlgui as a standard feature would allow > most applications have this behaviour for free. Thanks for the suggestion! I actually just finished a local prototype by intercepting keyPressEvent in TranslationUnitTextEdit, and it works well for both smart quotes and em-dashes. However, I agree that reusing ktextaddons (like KMail) is the cleaner long term solution. I will investigate how difficult it would be to integrate ktextaddons into Lokalize. For now, I can clean up my local implementation as a fallback in case adding a new dependency is too much for this task.