Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

Localization of QML files using translation file in VS addin



  • Hi, I have the following problem.

    I am trying to create localization files in Visual Studio add-in. I use VS 2013 with QT5 Visual Studio Add-in 1.2.4. My QT version is 5.4.

    I need to translate content in QML files, but if I understand the process correctly I should specify them in .pro file, so that the lupdate can see them (right now, if I select lupdate from the translation file context menu, nothing happens and when I try to edit it says the file won't be loaded as it is empty). Normally you would do it like this:

    lupdate_only {
        SOURCES = main.qml \
        MainPage.qml
    }
    

    The thing is that in VS you cannot edit the pro file in this way as the project settings are hidden somewhere in the solution settings. There is no pro file. What should I do? I tried to google it but with no luck.

    The absence of the .pro file also leads me to this question... How do you do a multiplatform project then? How do you call qmake when there is no .pro file?

    Also I know you can create .pro file with QT->Create basic .pro File... option in the menu but that does not contain all the settings of the project (I originally created the VS project by importing a .pro file with lot's of settings but have been working with Visual studio since then so the old .pro file si kinda outdated).

    Thanks



  • OK, I've been trying this the whole day. Then I created this post and then, out of sheer desperation, I tried one last thing. I added the filename of the qml file to the LUpdateOptions in QT->QT Project Settings. And guess what? Now it works and I can edit the .ts file. But this was a pure guess as I haven't found any documentation on QT Project Settings dialog in QT VS Add-in. I might mark this thread as Solved but you people may still comment at that thing about the multiplatform deployment if anybody knows anything about that. Thanks.


Log in to reply