Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Internationalization for two Applications
Forum Updated to NodeBB v4.3 + New Features

Internationalization for two Applications

Scheduled Pinned Locked Moved General and Desktop
9 Posts 3 Posters 3.8k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    messi
    wrote on last edited by
    #1

    Hi

    I have a question about Internationalization.

    I have the following problem:

    We are developing to applications for two different plattforms.
    Both apps are more or less the same.
    One App is for a screen 800x600, the other app is for a screen 320x240.
    he shown informations are similar or equal.

    The current procedure for internationalization would be to generate and translate the file for each app.

    Is there a way in Qt to have a kind of language resource file which are used in both apps so that the translater only has to translate one file.

    Thanks for the help.

    Best regards

    J

    1 Reply Last reply
    0
    • A Offline
      A Offline
      andre
      wrote on last edited by
      #2

      Should be possible, yes. You can add multiple files to your translation unit. Start with referencing the "lupdate documentation":http://doc.qt.nokia.com/4.7/linguist-manager.html#lupdate.

      1 Reply Last reply
      0
      • M Offline
        M Offline
        messi
        wrote on last edited by
        #3

        No this not what I meant.
        I would like to have one language resource file which are used by two different applications.

        1 Reply Last reply
        0
        • A Offline
          A Offline
          andre
          wrote on last edited by
          #4

          The first step to accomplish that, would be to create a language resource that contains the strings for both applications. Hence, you start with making lupdate take into account these two application's sources. That's why I pointed you in that direction.

          1 Reply Last reply
          0
          • M Offline
            M Offline
            messi
            wrote on last edited by
            #5

            Ah okay,
            I had something similar in mind. E.g creating a translation.h file which contains const qstring which are used in both applications.

            The big disadvantage here is that we do not have an order by classes. All string are mixed up.

            So the conclusion here is that there is no easy way that two apps use one resource file.

            Thanks.

            Cheers
            J

            1 Reply Last reply
            0
            • A Offline
              A Offline
              andre
              wrote on last edited by
              #6

              If you use the lupdate method, you do get the ordering. Just try it and see how it works.

              1 Reply Last reply
              0
              • M Offline
                M Offline
                messi
                wrote on last edited by
                #7

                Okay if I understand it correctly.
                I have two projects, one for the 800x600 and the other one for 320x240

                Now I run lupdate over both project this will generate one big ts-file.

                So now the ts-file has all classes of both project in it. Correct?

                Are those classes are ordered by project or are they mixed?

                Cheers
                J

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  andre
                  wrote on last edited by
                  #8

                  That is how it should work, AFAIK, yes. They will be ordered by file, but I don't know if they will be ordered by project. If you want that, why not make separate translation units instead?

                  However: just try and see.

                  1 Reply Last reply
                  0
                  • G Offline
                    G Offline
                    giesbert
                    wrote on last edited by
                    #9

                    [quote author="messi" date="1295349182"]Ah okay,
                    I had something similar in mind. E.g creating a translation.h file which contains const qstring which are used in both applications.

                    The big disadvantage here is that we do not have an order by classes. All string are mixed up.

                    So the conclusion here is that there is no easy way that two apps use one resource file.

                    Thanks.

                    Cheers
                    J[/quote]

                    Hi you can have a file, but noit with static strings. What I already saw (and what does not work) is having global variables (or local ones with static) that are initialized like this:

                    @
                    static const QString szText = QObject::tr("Bla");
                    @

                    In this case it was a module local constant. But the tr Marco is executed, before your translation file is loaded, as global variables are initialized, before executing code for main().

                    Nokia Certified Qt Specialist.
                    Programming Is Like Sex: One mistake and you have to support it for the rest of your life. (Michael Sinz)

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved