| Summary: | Smart substitutions (quotes, dashes) | ||
|---|---|---|---|
| Product: | [Applications] lokalize | Reporter: | Emir SARI <emir_sari> |
| Component: | editor | Assignee: | Finley Watson <fin-w> |
| Status: | REPORTED --- | ||
| Severity: | wishlist | CC: | aacid, sdepiets, shafff, tanishkrsh6061 |
| Priority: | NOR | ||
| Version First Reported In: | unspecified | ||
| Target Milestone: | --- | ||
| Platform: | Other | ||
| OS: | Other | ||
| Latest Commit: | Version Fixed/Implemented In: | ||
| Sentry Crash Report: | |||
|
Description
Emir SARI
2025-10-04 11:38:14 UTC
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. Hi @finely_watson @emir_sari, I've spent some time looking into the ktextaddons integration we discussed. I still agree it's the cleaner long term path, but since it involves adding new dependencies and modifying the build system, it is going to take significant time to get right. With the Season of KDE selection coming up in 10 days, I want to prioritize my preparation for Task 2 (Glossary) to ensure I'm fully ready if selected. I'm going to pause this 'Smart Quotes' task for now. I'll keep my working manual prototype (from my previous comment) as a fallback, but I plan to circle back to the proper ktextaddons implementation later when i have more bandwidth. Thanks for the guidance! |