Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Q] [Package restructure query] QOwnNotes_*.qm files in their own subdirectory? #2905

Open
alexanderino opened this issue Nov 19, 2023 · 20 comments
Labels
Importance: Low Info: Might introduce regressions Type: Breaking change Fix or feature that will cause existing functionality to change Type: Feature adds functionality

Comments

@alexanderino
Copy link

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

@pbek
Copy link
Owner

pbek commented Nov 19, 2023

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. 😆

@alexanderino
Copy link
Author

Thank you. Let me know if I can help in testing, should you decide to take this on 😃

@pbek
Copy link
Owner

pbek commented Nov 19, 2023

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).

@pbek
Copy link
Owner

pbek commented Nov 19, 2023

Then it should be just some creating of the folder and updating

copy languages\*.qm ..\release
.

@pbek
Copy link
Owner

pbek commented Nov 19, 2023

Hm, but it would also mean for all current users that after the next update they'd have the language files twice... 🤔 😬

@alexanderino
Copy link
Author

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.
image

Switching back to English:
image

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?

@pbek
Copy link
Owner

pbek commented Nov 21, 2023

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...

@pbek
Copy link
Owner

pbek commented Nov 21, 2023

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?

@alexanderino
Copy link
Author

alexanderino commented Nov 21, 2023

Sure. Here's German:
image

Ukrainian:
image

Greek:
image

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.

@pbek
Copy link
Owner

pbek commented Nov 21, 2023

Thank you...
Storing them somewhere else is not the big issue. Transitioning to that is.

@pbek pbek added Type: Feature adds functionality Type: Breaking change Fix or feature that will cause existing functionality to change Info: Might introduce regressions Importance: Low and removed Type: Support labels Nov 29, 2023
@alexanderino
Copy link
Author

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.

@pbek
Copy link
Owner

pbek commented Apr 30, 2024

Thank you. 😉

@alexanderino
Copy link
Author

alexanderino commented May 20, 2024

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.

@pbek
Copy link
Owner

pbek commented May 20, 2024

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... 😅

@alexanderino
Copy link
Author

I can understand 😀 Hopefully no one has saved anything — let alone anything important — with a QM extension in the program's root directory!

@pbek
Copy link
Owner

pbek commented May 20, 2024

If you want, you can create a pull request, and I'll think about it.

@alexanderino
Copy link
Author

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.

@pbek
Copy link
Owner

pbek commented May 20, 2024

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!

@alexanderino
Copy link
Author

alexanderino commented May 20, 2024

Yes, I will perform due diligence to ensure it works as expected 😀 What do you think of this approach?:

  1. unzip the update over the existing location
  2. create a languages directory
  3. 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:

  1. store the new QM files at the top level inside the archive
  2. unzip the update over the existing location, overwriting the existing QM files with the same names
  3. create a languages directory
  4. move all .qm files into languages

Thoughts?

@pbek
Copy link
Owner

pbek commented May 20, 2024

Source code

  • App needs to be able to read language files also from languages folder (inside the zip file)

Build process

  • Language files need to be placed in languages folder

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!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Importance: Low Info: Might introduce regressions Type: Breaking change Fix or feature that will cause existing functionality to change Type: Feature adds functionality
Projects
None yet
Development

No branches or pull requests

2 participants