{
  "$type": "site.standard.document",
  "bskyPostRef": {
    "cid": "bafyreicohcp54msdrmdqiwvg6llpxrngucdbou6l57wcxhdfedskngmbfm",
    "uri": "at://did:plc:6hbglz6d23ddtbkjolxkk6tk/app.bsky.feed.post/3mhfmendmds22"
  },
  "path": "/2026/03/08/season-of-kde-2026-fixing-the-glossary-in-lokalize-midterm/",
  "publishedAt": "2026-03-08T00:00:00.000Z",
  "site": "https://blogs.kde.org",
  "tags": [
    "Jaimukund Bhan",
    "Lokalize",
    "Autosaving the Glossary File",
    "Removing the Restore function",
    "Showing the first visible entry in Editor",
    "Finley Watson"
  ],
  "textContent": "Greetings to the KDE community!\n\nMy name is Jaimukund Bhan and I have been working on Lokalize, the l10n tool used to translate KDE software, for Season of KDE 2026. Specifically, I have been fixing the Glossary - which is a collection of frequently used words linked to keyboard shortcuts for quick access while translating.\n\nThe following are the changes I have made during the first half of SoK, while learning a lot about developing with the Qt Framework and on KDE software.\n\n### Creating & Saving the Glossary file\n\nFirst and foremost, the Glossary file had to exist! At the time, I found out that the file would not load or allow entries to the glossary, because it wasn’t opened inside the function. Crisis was averted when the code for opening the files was added, but now came the saving functionality. After a long, long (but fruitful) discussion with my mentor, I finalized the file saving logic to trap the user into setting a valid glossary file path for their project. This meant the user had to ensure that they had permission for the directory in which they meant to save the glossary file and should specify an existing file path. In case the user had entered something invalid, this change would return the dialog box back, pre-filled with a default valid path. I got comfortable with a few Qt features and learned a lot about the user’s workflow through this task.\n\n### Autosaving the Glossary File\n\nNow that the glossary file could be saved, a feature request was made for autosaving the glossary file. At the time, the only way to save the glossary file was by the keyboard shortcut (Ctrl+S) or when the glossary tab was closed and the user was prompted to save/discard their changes. To autosave the glossary file, I had to identify when and how the file needed to be saved. This time, I found a relic hiding in the codebase (AuxTextEdit, the KTextEdit I had to override), which was exactly what I needed to catch when the user stopped editing the Definition section of a term in the Glossary tab. Now the file would be saved whenever the user added/deleted terms or stopped editing. I also unearthed another feature which was not working correctly, although this will be covered in the next part.\n\n### Removing the Restore function\n\nLess code is good code. This change was just removing a feature not a lot of users had a need for, and clearing that up would make it much easier to maintain the codebase. The Glossary tab had a button to restore the glossary file from disk, which was meant as a way to reset all the unsaved changes made to the glossary file. But with all the new features made for autosaving, it did not make sense to keep it anymore.\n\n### Showing the first visible entry in Editor\n\nTwo bugs I found were how the Glossary editor would not clear the editor when all the terms were deleted from the file and that the Subject field would be pre-selected with a term from the combo box, when no actual term was selected if the app started on the Glossary tab. I added the clause to clear the editor whenever all the terms were deleted, and selected the first entry whenever the app started on the Glossary tab.\n\n### Acknowledgements\n\nA huge thank you to my mentor, Finley Watson, for being super patient with all the discussions and changes I made, and to the KDE Community for being so welcoming! I’d recently switched to using Linux with Plasma and the biggest reason for applying was to learn how to effectively contribute to KDE software. I’ve truly enjoyed this journey so far, and I hope to keep contributing to the KDE community long after this project is complete.",
  "title": "Season of KDE 2026 - Fixing the Glossary in Lokalize (Midterm)"
}