Internationalization for two Applications



  • 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



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



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



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



  • 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



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



  • 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



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



  • [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().


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.