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

Add Load multilingual function #35

Merged
merged 4 commits into from
Sep 22, 2023
Merged

Conversation

fairycn
Copy link
Contributor

@fairycn fairycn commented Sep 22, 2023

Add the function of loading multiple languages

#7
At present, it is necessary to download the required Language file *.qm (published) or the unpublished language file *.ts before the program runs, translate and publish it, rename it to PELanguage.qm and copy it into the language directory before it can be used.

example

  • file directory
    image
  • Use examples
    image

@hasherezade
Copy link
Owner

Hi @fairycn !
Thank you for your contribution.
There are some fixes required before I can merge it.
First of all, the QApplication is initialized twice, which is a mistake, and on Linux, it causes the window to nor render at all.
Second, the mime types, and the CSS code should not be in tagged for translation.
I prepared a patch file that you can apply. You can download it from here:

https://gist.github.com/hasherezade/b8abf31d46328c16669a2a457602fb29

And then apply with the help of git:

git apply patch1.diff

Then let me know and I will merge it.

@hasherezade
Copy link
Owner

@fairycn - I see that you removed QTranslator by mistake.
This line:

QTranslator translator;

before:

	if (translator.load("Language\\PELanguage.qm")) {
		app.installTranslator(&translator); 
	}

This wasn't in the patch file. Please add the translator, and I will check again.

@hasherezade
Copy link
Owner

Looks good now, thank you!

@hasherezade hasherezade merged commit 3f6f23f into hasherezade:main Sep 22, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants