Issue with software application that utilizes qt
-
Not sure if this is the best place to look for help for this, but our manufacturing company recently purchased a CNC machine. The machine is Chinese in origin and defaults to the Chinese when opening. The software is basically a bunch of folders and dll files and the main .exe that launches the application. I can see that there are .qm files for multiple languages, but I'm not sure how to get the app to use them. There's also a qt.conf file in the root directory but it doesn't have a translation path set and setting one didn't seem to work. I'm relatively inexperienced with qt so I don't entirely know what the process of applying a .qm to a compiled file is like. This software is also running on Windows 7 32-bit in English. If further info is required I'm more than happy to send it. Thanks!
-
Hi, normally there is a qm file for each language. Have you found the qm file related to your?
In my prohjects I use to embed the qm file in the executable and the right qm file is choosed during program start. In your case i think the developer has embded a function to search the right qm file in the executable path.
This is not a rule, a developer can do as he prefear. -
Hello, thank you for your reply. I have the qm file for english, however there appears to be nothing within the application that allows for the language to be changed. There is an administrator login for this application, however when we received the pc with the PC with the software already installed on it, we weren't given a password any administrator login. There's a slight possibility that the way to change language is locked behind the administrator tab.
-
Hi,
Usually, it should be under some preferences in the application. One other possibility (but less likely I think) is to check whether the application takes a launch parameter with the language to select.
If they used QSettings to store the language, there might be something in the Windows registry. -
So I've been playing around in the registry, and while I can't find QSettings within the project, I found a key in HKEY_CURRENT_USER/Software/Classes called qm_auto_file. I also found HKEY_CURRENT_USER/Software/QtProject. Would either of these be useful in fixing the issue?
Edit: I'm also wondering if the program automatically uses the system language. When we received this pc, the windows language was set to chinese. In order to properly switch it to english we had to meddle with some registry keys and use external methods given windows won't let you change the language unless you have windows 7 ultimate. I'm wondering if despite text showing up as english the pc still has it's locale set to China.
-
You have to ask yo the developer because each developer uses a own procedure in order to select the language. I normally use the current lang. Other developers use a form where the user can select the lang.
Is the os menu in english now? If not try to open the software from a console. Before to run the software please set local lang variable to english. In linux it works. -
You have to ask yo the developer because each developer uses a own procedure in order to select the language. I normally use the current lang. Other developers use a form where the user can select the lang.
Is the os menu in english now? If not try to open the software from a console. Before to run the software please set local lang variable to english. In linux it works.@mrdebug The developers are Chinese and don't have an easy way for our company to access them. The OS had a language pack applied to it so it reads in english and the locale is set to english, but it still reads chinese. I've tried opening the software with language parameters from cmd to no avail.
-
Not sure if this is the best place to look for help for this, but our manufacturing company recently purchased a CNC machine. The machine is Chinese in origin and defaults to the Chinese when opening. The software is basically a bunch of folders and dll files and the main .exe that launches the application. I can see that there are .qm files for multiple languages, but I'm not sure how to get the app to use them. There's also a qt.conf file in the root directory but it doesn't have a translation path set and setting one didn't seem to work. I'm relatively inexperienced with qt so I don't entirely know what the process of applying a .qm to a compiled file is like. This software is also running on Windows 7 32-bit in English. If further info is required I'm more than happy to send it. Thanks!
Hi and welcome :)
@Tristan-S said in Issue with software application that utilizes qt:
our manufacturing company recently purchased a CNC machine
So it was used in China / by a Chinese company before?!
There is no support by the manufacturer?!
No handbook? No manual?! No online portal where to seek help?!I can see that there are .qm files for multiple languages
Might be a little hacky and dirty but as a test you could search for the Chinese language file, backup it and then replace it with the language of your choice, English, German etc...
If the app loads a given language config at startup it might work... obviously not a good solution but at least then you know how it works and can investigate further.Have you tried to use parameters as suggested by @SGaist ? Start app from console and see if there is any
--help
or so.
Small chance that something likeapp.exe -qm path/to/language.qm
works (not sure about-qm
... could be any "switch") -
Hi and welcome :)
@Tristan-S said in Issue with software application that utilizes qt:
our manufacturing company recently purchased a CNC machine
So it was used in China / by a Chinese company before?!
There is no support by the manufacturer?!
No handbook? No manual?! No online portal where to seek help?!I can see that there are .qm files for multiple languages
Might be a little hacky and dirty but as a test you could search for the Chinese language file, backup it and then replace it with the language of your choice, English, German etc...
If the app loads a given language config at startup it might work... obviously not a good solution but at least then you know how it works and can investigate further.Have you tried to use parameters as suggested by @SGaist ? Start app from console and see if there is any
--help
or so.
Small chance that something likeapp.exe -qm path/to/language.qm
works (not sure about-qm
... could be any "switch")Thank you for your reply! Yes, for whatever reason they just dropped of the machine with a fully chinese machine. So far I can't find any details on anything related to the software whatsoever, only that it's made by Sunvega. I thought of changing the .qm file to be the english one, but it seems like the software doesn't use a .qm file for chinese, only for other languages. Deleting all .qm files didn't seem to affect the app at all. I was able to successfully reach the admin panel, however there sadly isn't any language options baked into the ui. I'm gonna try to see if I can figure out if there are any switches.
-
Thank you for your reply! Yes, for whatever reason they just dropped of the machine with a fully chinese machine. So far I can't find any details on anything related to the software whatsoever, only that it's made by Sunvega. I thought of changing the .qm file to be the english one, but it seems like the software doesn't use a .qm file for chinese, only for other languages. Deleting all .qm files didn't seem to affect the app at all. I was able to successfully reach the admin panel, however there sadly isn't any language options baked into the ui. I'm gonna try to see if I can figure out if there are any switches.
@Tristan-S said in Issue with software application that utilizes qt:
only that it's made by Sunvega
A google search on Sunvega OS lead me to:
Bottom of the page:
Oversea Service (Technical Assistance)
Our machine is almost installed and tested well before delivery. Manual and instruction book are sent to you free together with the machine, and we also provide different language version, such as Spanish, Russian and other languages.
-
Unfortunately, Zicar isn't where we ordered the machine from. The link to the machine is https://sagamac.com/product/m4g2-door-4-edge-cutting-sizing-machine/
-
In case this helps at all, this is the file structure. Language and UTF-8 were both created by me and didn't come with the project. Translator.exe only translates XML files and TS files which doesn't change anything in the app itself. The translation folder just has a bunch of .qm files for various languages. The resource folder has a variety of "(cnc name)_en.qm" files which are referenced in the hex code for the main EXE but don't seem to be read at any point. -
Thank you for your reply! Yes, for whatever reason they just dropped of the machine with a fully chinese machine. So far I can't find any details on anything related to the software whatsoever, only that it's made by Sunvega. I thought of changing the .qm file to be the english one, but it seems like the software doesn't use a .qm file for chinese, only for other languages. Deleting all .qm files didn't seem to affect the app at all. I was able to successfully reach the admin panel, however there sadly isn't any language options baked into the ui. I'm gonna try to see if I can figure out if there are any switches.
@Tristan-S said:
Deleting all .qm files didn't seem to affect the app at all.
Hmm, so the code is actually built with strings in Chinese and (presumably) is relying on translation to present English versions. The fact that you have
qt_zh.qm
,qt_zh_TW.qm
andqt_zh_CN.qm
is a little at odds with this though: why would you need a translation file for an app that is most likely natively one of these.Yes, for whatever reason they just dropped of the machine with a fully chinese machine.
This could be part of the problem. Even though you have added an English language pack to Windows the default system locale may still be reported/derived as China.
The QLocale code looks for
LANG
,LC_ALL
, andLANGUAGE
environment variables at different times on Linux. On Windows it seems to look only atLANG
, so you could try something like this from a CMD shell:cd program directory set LANG=en_US .\program
If the
qt.conf
does not specifyTranslations
then thetranslations
folder next to the executable is the default. -
@Tristan-S said:
Deleting all .qm files didn't seem to affect the app at all.
Hmm, so the code is actually built with strings in Chinese and (presumably) is relying on translation to present English versions. The fact that you have
qt_zh.qm
,qt_zh_TW.qm
andqt_zh_CN.qm
is a little at odds with this though: why would you need a translation file for an app that is most likely natively one of these.Yes, for whatever reason they just dropped of the machine with a fully chinese machine.
This could be part of the problem. Even though you have added an English language pack to Windows the default system locale may still be reported/derived as China.
The QLocale code looks for
LANG
,LC_ALL
, andLANGUAGE
environment variables at different times on Linux. On Windows it seems to look only atLANG
, so you could try something like this from a CMD shell:cd program directory set LANG=en_US .\program
If the
qt.conf
does not specifyTranslations
then thetranslations
folder next to the executable is the default.@ChrisW67 said in Issue with software application that utilizes qt:
The fact that you have qt_zh.qm, qt_zh_TW.qm and qt_zh_CN.qm is a little at odds with this though: why would you need a translation file for an app that is most likely natively one of these.
Probably because of variations in dialects/regional spoken language as
zh_CN
is for mainland China (PRC) whilezh_TW
is the file for the Taiwanese version of the program... I don't speak Chinese, so I don't know if there are any major differences.
So these files are needed to put the app back to Chinese if any other language is in use.
Therefore I think at least the devs must know how, lol :) There must be some way.This could be part of the problem. Even though you have added an English language pack to Windows the default system locale may still be reported/derived as China.
@Tristan-S
Reading this from @ChrisW67 , is it possible to run the software on a computer with your desired languague?
Doesn't even have to work properly, but only a start would unveil the language... if Chinese again, it's not using the OS Locale language.And just to make sure... have you tried the obvious?
You said the program is completely in Chinese... have to tried every single menu, option, button, toolbar... whatever... where they could have hidden the language settings?! -
In case this helps at all, this is the file structure. Language and UTF-8 were both created by me and didn't come with the project. Translator.exe only translates XML files and TS files which doesn't change anything in the app itself. The translation folder just has a bunch of .qm files for various languages. The resource folder has a variety of "(cnc name)_en.qm" files which are referenced in the hex code for the main EXE but don't seem to be read at any point.@Tristan-S There is a Settings folder what's the content of that ?
-
@Tristan-S said:
Deleting all .qm files didn't seem to affect the app at all.
Hmm, so the code is actually built with strings in Chinese and (presumably) is relying on translation to present English versions. The fact that you have
qt_zh.qm
,qt_zh_TW.qm
andqt_zh_CN.qm
is a little at odds with this though: why would you need a translation file for an app that is most likely natively one of these.Yes, for whatever reason they just dropped of the machine with a fully chinese machine.
This could be part of the problem. Even though you have added an English language pack to Windows the default system locale may still be reported/derived as China.
The QLocale code looks for
LANG
,LC_ALL
, andLANGUAGE
environment variables at different times on Linux. On Windows it seems to look only atLANG
, so you could try something like this from a CMD shell:cd program directory set LANG=en_US .\program
If the
qt.conf
does not specifyTranslations
then thetranslations
folder next to the executable is the default.@ChrisW67 @Pl45m4
Alright, so to clarify there is neither a qt_zh_CN.qm or a qt_zh.qm, only a qt_zh_TW. I was referring to changing the the name of qt_en.qm to all of those names on the off chance it was looking for one of those by default.So some updates since I last posted. Thanks to the devs using unsalted encryption I was able to figure out the password for the administrator account which showed me a lot more panels, however even with all of the available tabs at my disposal, none of them have language settings. I was also able to get the software to load on windows 10 English, which didn't resolve the issue. I even tried setting the locale in cmd and that didn't work either
@J-Hilk said in Issue with software application that utilizes qt:
There is a Settings folder what's the content of that ?
Settings folder contains a variety of xml files, however none of them mention language and they were in Chinese until I used translator.exe to correct them. You would think the data in the xml file would be what the application reads from to populate it's text boxes, but for whatever reason even changing all chinese to english doesn't change anything in the app.
I ran the exe through a hex editor and found some lines referencing a .qm file, but it's hard to really get an idea of what it means.
At this rate I better start brushing up on my Mandarin.
-
@ChrisW67 @Pl45m4
Alright, so to clarify there is neither a qt_zh_CN.qm or a qt_zh.qm, only a qt_zh_TW. I was referring to changing the the name of qt_en.qm to all of those names on the off chance it was looking for one of those by default.So some updates since I last posted. Thanks to the devs using unsalted encryption I was able to figure out the password for the administrator account which showed me a lot more panels, however even with all of the available tabs at my disposal, none of them have language settings. I was also able to get the software to load on windows 10 English, which didn't resolve the issue. I even tried setting the locale in cmd and that didn't work either
@J-Hilk said in Issue with software application that utilizes qt:
There is a Settings folder what's the content of that ?
Settings folder contains a variety of xml files, however none of them mention language and they were in Chinese until I used translator.exe to correct them. You would think the data in the xml file would be what the application reads from to populate it's text boxes, but for whatever reason even changing all chinese to english doesn't change anything in the app.
I ran the exe through a hex editor and found some lines referencing a .qm file, but it's hard to really get an idea of what it means.
At this rate I better start brushing up on my Mandarin.
The hex dumb mentions an
.ini
file somewhere in Resources.
Have you checked all ini files you can find in the program folder? Maybe some of them contains a string which tells what lang to use...And there is no way to contact the developers (i.e. the Chinese company) and ask for assistance with changing the language?
Btw: The website you have linked above contains a WhatsApp contact :)
Maybe ask the broadly grinning guy in the whatsapp contact profile picture how to change the language 😄
As I doubt that you guys are their first international customer and every other customer uses the software in Chinese language.Edit:
Do all the other translation files actually contain something? Or are these just placeholders? -
The hex dumb mentions an
.ini
file somewhere in Resources.
Have you checked all ini files you can find in the program folder? Maybe some of them contains a string which tells what lang to use...And there is no way to contact the developers (i.e. the Chinese company) and ask for assistance with changing the language?
Btw: The website you have linked above contains a WhatsApp contact :)
Maybe ask the broadly grinning guy in the whatsapp contact profile picture how to change the language 😄
As I doubt that you guys are their first international customer and every other customer uses the software in Chinese language.Edit:
Do all the other translation files actually contain something? Or are these just placeholders?@Pl45m4 said in Issue with software application that utilizes qt:
The hex dumb mentions an .ini file somewhere in Resources.
Have you checked all ini files you can find in the program folder?So for whatever reason, the exe mentions folders that don't seem to exist. There isn't any folder named Sunvega CncHmi2 in Resources and there is only a single ini file in the entire project which is debug.ini and it's contents are simply
simul.enable = 1 simul.address = 0.0.0.0:0
I believe that the correct translation file isn't actually qt_en.qm but rather the .qm files found within resources, as the resources folder has many _en.qm files and examining them seems like they're translations of the ui. I tried linking the path in qt.conf as follows to no avail.
[Paths] Documentation=../../Docs/Qt-5.13.2 Examples=../../Examples/Qt-5.13.2 Prefix=. Translations = Resources
These attempts included variations like ./Resources and ../Resources but neither worked.
@Pl45m4 said in Issue with software application that utilizes qt:
And there is no way to contact the developers (i.e. the Chinese company) and ask for assistance with changing the language?
Because the developer of the app as well as the distributor are located in China, coordinating times becomes incredibly difficult given the time distance, in addition to the language barrier. Even trying to track down anything related to the software is difficult. We did manage to track down the guy on whatsapp, but he kinda just told us that it still works in chinese and he might send us a video on how to fix it at some point. Hopefully that ends up pulling through.
@Pl45m4 said in Issue with software application that utilizes qt:
Do all the other translation files actually contain something? Or are these just placeholders?
All of the language files have things in them ironically with the exception of the english file, however there seems to be another english file in the root directory which actually has things translated (though it seems like it doesn't involve ui elements).
Thank you for all the assistance both you and everyone else have provided. People like you who help others out of the kindness of your hearts are amazing human beings. Hopefully this can get resolved soon!