[Q] [Package restructure query] QOwnNotes_*.qm files in their own subdirectory?
Currently, there are 88 files in QOwnNotes-23.11.2.zip's root directory. Of these, 65 are QOwnNotes_*.qm files.
Is it possible to place these files into their own subdirectory? If so, can future QOwnNotes-*.zip files be updated to reflect this structure? It would clean up the layout and make it easier to locate files such as QOwnNotesPortable.bat.
Thanks and regards,
alexanderino
It would be possible. But it would take several releases and lots of bug reports to get out all the issues that would cause on all the different ways to install QOwnNotes, so I'm not very keen to get to that. 😆
Thank you. Let me know if I can help in testing, should you decide to take this on 😃
You can test if the translations are still working if you put them into a folder languages. This folder should already be included (just checked).
Then it should be just some creating of the folder and updating https://github.com/pbek/QOwnNotes/blob/6f562243c8fed966c321eb23b3d90768ec190b33/build-systems/github/windows/build-zip.ps1#L23.
Hm, but it would also mean for all current users that after the next update they'd have the language files twice... 🤔 😬
You can test if the translations are still working if you put them into a folder
languages. This folder should already be included (just checked).
I don't have that folder, and my copy of the 23.11.2 archive does not either. Anyway, I created it and moved the QM files into it. The portable BAT froze for a few seconds, after which QOwnNotes started up properly. 66 languages are listed, so I changed to another language and restarted manually. This was successful.
Switching back to English:
So, it appears this works!
Hm, but it would also mean for all current users that after the next update they'd have the language files twice... 🤔 😬
That is always a concern. Perhaps it could be included in the release notes?
Thank you for testing and confirming...
That is always a concern. Perhaps it could be included in the release notes?
I don't think that more than 2% of people are reading them and 1% of them would really want to act on them. I usually try to do everything automatically, but I don't really want to start deleting files, because of portable-mode...
66 languages are listed
they are always listed, this list is hardcoded. the question is if the actual language is shown in the user interface. english is the default language and has no translation files
can you please try at least two languages that are not english?
Sure. Here's German:
Ukrainian:
Greek:
By the way, I've searched my drive and found that other QT-based programs store their translations in subdirectories such as i18n, language, languages, translation and translations.
Thank you... Storing them somewhere else is not the big issue. Transitioning to that is.
Just an update on this matter: over the last few months, I've tried out other interface languages with the lanugage files residing in the languages sub-directory. These are portable installs on three different machines running Win10 and Win11. It worked flawlessly without issues at all times.
Thank you. 😉
Hm, but it would also mean for all current users that after the next update they'd have the language files twice... 🤔 😬
How about adding into build-zip.ps1 a DEL /Q-type command to remove any QOwnNotes_*.qm files in the root directory?
Edit: I tested a portable version with duplicate language files, both in the root directory and languages. Tested around 6 languages, couldn't notice any problems.
I have a little bit of fear trying to remove files on the user end, because I don't know what the user has put there... 😅
I can understand 😀 Hopefully no one has saved anything — let alone anything important — with a QM extension in the program's root directory!
If you want, you can create a pull request, and I'll think about it.
I have very little experience with Git and pull requests 😬 However, I've had a look at the process. Once I perform a bit of testing with the modified batch file and it's successful, I'll push through to creating the PR.
Thank you. Also keep in mind that the update script will be deployed with a usual update too. So it is only active after a 2nd update. If the update script breaks, it's game over. Everyone needs to do a manual download and setup everything new! So whatever you do in the update script, it must not break the update process or the script itself!
The command needs to work from Windows XP to Windows 11!
Yes, I will perform due diligence to ensure it works as expected 😀 What do you think of this approach?:
- unzip the update over the existing location
- create a
languagesdirectory - move all .qm files into
languages
During a normal update, any custom .qm files with the same name(s) as those in the update package will be overwritten anyway. So this should be safe from a user's perspective.
Edit: now that I've given it a bit more thought, the older QM files will overwrite the newer ones, because the new QM files will already be inside a languages directory inside the update, yes? So the above approach won't work, but this would:
- store the new QM files at the top level inside the archive
- unzip the update over the existing location, overwriting the existing QM files with the same names
- create a
languagesdirectory - move all .qm files into
languages
Thoughts?
Source code
- App needs to be able to read language files also from
languagesfolder (inside the zip file)
Build process
- Language files need to be placed in
languagesfolder
Update script
- Remove language files (and just them) in app directory if they exist
- Keep in mind that the script will run at every update process!