Changeset 722

Show
Ignore:
Timestamp:
08/25/07 07:43:48 (12 months ago)
Author:
daelstorm
Message:

Museeq: qmake: add translations .ts to museeq.pro; allow DESTDIR TARGET to be set; Don't try to translate if locale is 'en'

Location:
museek+/trunk/sources/museeq
Files:
3 modified

Legend:

Unmodified
Added
Removed
  • museek+/trunk/sources/museeq/INSTALL

    r693 r722  
    2121   path museeq will be installed into. (Same path as make's INSTALL_ROOT) 
    2222   PREFIX defaults to /usr 
     23 * DESTDIR: where the museeq binary is placed (on make and make install) 
     24   DESTDIR defaults to the workdir/ subdirectory 
     25# NOTE: there's a quirk with qmake, in that the binary wants to be moved to 
     26# DESTDIR during the "make". If you don't set DESTDIR, you'll need to do the 
     27# following: qmake; make; qmake; make install 
    2328 
    2429Example Qmake commands: 
    2530 * qmake "CONFIG += QSA BINRELOC TRAYICON" 
    2631 * qmake "CONFIG += QSA BINRELOC" 
    27  * qmake "CONFIG += QSA" "PREFIX+=/usr" 
    28  * qmake "PREFIX=/usr/local" 
     32 * qmake "CONFIG += BINRELOC" PREFIX=/usr 
     33 * qmake PREFIX=/usr/local DESTDIR=/usr/local/bin 
     34 * qmake PREFIX=/home/username/build/usr DESTDIR=/home/username/build/usr/bin 
    2935 * qmake 
    3036 
    3137Make Options: 
    3238 * INSTALL_ROOT: the prefix of the path where museeq will be installed 
    33    INSTALL_ROOT must be set, or it'll be installed in /bin and /share 
     39 
     40# INSTALL_ROOT must be set, or it'll be installed in /bin and /share 
    3441 
    3542# If you want translations, run updatetranslations.py 
    36   1) Example: ./updatetranslations.py $QTDIR fr de 
     43# The updatetranslations script uses lupdate to merge qt_??.ts and museeq_??.ts 
     44# into museeq_??.qm 
     45  1a) Example: ./updatetranslations.py $QTDIR fr de 
     46# Run lupdate to do the same, without the qt_??.ts files 
     47  1b) lupdate museeq.pro 
    3748# Generate Makefile 
    3849  2) qmake  
     
    4253  4) su -c "make install INSTALL_ROOT=/usr" 
    4354  or sudo make install INSTALL_ROOT=/usr 
     55  or make install INSTALL_ROOT=/home/username/build/usr 
  • museek+/trunk/sources/museeq/museeq.cpp

    r720 r722  
    937937        lang = QString(QTextCodec::locale()); 
    938938        langpath = lang.mid(0,5); // to fix \ shorten long locales like from "fr_FR.utf8" to "fr_FR" 
    939         lang2 =  (QString(DATADIR) + QString("/museek/museeq/translations/museeq_") + langpath + QString(".qm") ); 
    940         QFileInfo fi( lang2 ); 
    941         if ( !fi.exists() ) { 
    942                 // if longer locale isn't found, try two-character locale such as "fr" 
    943                 langpath = lang.mid(0,2); 
     939        if (lang.mid(0,2) != "en" and lang.mid(0,5) != "en") 
     940        { 
    944941                lang2 =  (QString(DATADIR) + QString("/museek/museeq/translations/museeq_") + langpath + QString(".qm") ); 
    945942                QFileInfo fi( lang2 ); 
    946                 if ( fi.exists() ) { 
     943                if ( !fi.exists() ) { 
     944                        // if longer locale isn't found, try two-character locale such as "fr" 
     945                        langpath = lang.mid(0,2); 
     946                        lang2 =  (QString(DATADIR) + QString("/museek/museeq/translations/museeq_") + langpath + QString(".qm") ); 
     947                        QFileInfo fi( lang2 ); 
     948                        if ( fi.exists() ) { 
     949                                translation.load( lang2); 
     950                                app.installTranslator( &translation ); 
     951                        } else { 
     952                                std::cout << "Translation doesn't exist at: " << lang2 << std::endl; 
     953                        } 
     954                         
     955                } else { 
    947956                        translation.load( lang2); 
    948957                        app.installTranslator( &translation ); 
    949                 } else { 
    950                         std::cout << "Translation doesn't exist at: " << lang2 << std::endl; 
    951958                } 
    952                  
    953         } else { 
    954                 translation.load( lang2); 
    955                 app.installTranslator( &translation ); 
    956         } 
    957          
     959        } 
    958960         
    959961        new Museeq(&app); 
  • museek+/trunk/sources/museeq/museeq.pro

    r720 r722  
    44CONFIG += qt  
    55TARGET = museeq 
     6 
    67QMAKE_COPY = cp -pf 
    78TEMPLATE = app 
    8 DEPENDPATH += Mucipher 
    9 INCLUDEPATH += Mucipher 
    10 MUSEEQDATA = /share/museek/museeq 
    11 OBJECTS_DIR = workdir 
    12 DESTDIR     = workdir 
    13 translations.path = $${MUSEEQDATA}/translations 
    14 translations.files = workdir/translations/museeq_*.qm 
    15 # museeq.target = museeq 
    16 TARGET.path = /bin 
    17 # museeq.commands = touch $$museeq.target 
    18 TARGET.files = museeq 
    19 # Icons 
    20 ICONS_birdies.path = $${MUSEEQDATA}/icons/birdies 
    21 ICONS_birdies.files = birdies/*.png 
    22 ICONS_default.path = $${MUSEEQDATA}/icons/default 
    23 ICONS_default.files = default/*.png 
    24 ICONS_bluebox.path = $${MUSEEQDATA}/icons/bluebox 
    25 ICONS_bluebox.files = bluebox/*.png 
    26 ICONS_mikelabo_silk.path = $${MUSEEQDATA}/icons/mikelabo-silk 
    27 ICONS_mikelabo_silk.files = mikelabo-silk/*.png 
    28 ICONS_mikelabo_triangles.path = $${MUSEEQDATA}/icons/mikelabo-tri 
    29 ICONS_mikelabo_triangles.files = mikelabo-tri/*.png 
    30 INSTALLS += ICONS_mikelabo_triangles  ICONS_mikelabo_silk ICONS_bluebox ICONS_default ICONS_birdies 
    31 INSTALLS += translations 
    32 INSTALLS += TARGET 
    33 # Comment the next two lines out, if they cause problems 
    34 UNAME = $$system(uname -s) 
    35 message( You appear to be running $$UNAME $$system(uname -r) ) 
    36 # HELP 
    37 message('qmake build options are: "CONFIG+=QSA BINRELOC TRAYICON" PREFIX="/path"') 
    38 message('Read the INSTALL file more more information.') 
    399############################################################################### 
    4010# DEFINES                                                                     # 
     
    4414} 
    4515 
     16isEmpty(DESTDIR) { 
     17        DESTDIR = workdir 
     18} 
    4619BINRELOC { 
    4720        DEFINES += ENABLE_BINRELOC=1 
     
    6639############################################################################### 
    6740 
     41DEPENDPATH += Mucipher 
     42INCLUDEPATH += Mucipher 
     43MUSEEQDATA = /share/museek/museeq 
     44OBJECTS_DIR = workdir 
     45TARGET.path = bin 
     46museeq.path = bin 
     47museeq.files = workdir/museeq 
     48INSTALLS += museeq 
    6849 
     50# Icons 
     51ICONS_birdies.path = $${MUSEEQDATA}/icons/birdies 
     52ICONS_birdies.files = birdies/*.png 
     53ICONS_default.path = $${MUSEEQDATA}/icons/default 
     54ICONS_default.files = default/*.png 
     55ICONS_bluebox.path = $${MUSEEQDATA}/icons/bluebox 
     56ICONS_bluebox.files = bluebox/*.png 
     57ICONS_mikelabo_silk.path = $${MUSEEQDATA}/icons/mikelabo-silk 
     58ICONS_mikelabo_silk.files = mikelabo-silk/*.png 
     59ICONS_mikelabo_triangles.path = $${MUSEEQDATA}/icons/mikelabo-tri 
     60ICONS_mikelabo_triangles.files = mikelabo-tri/*.png 
     61INSTALLS += ICONS_mikelabo_triangles  ICONS_mikelabo_silk ICONS_bluebox ICONS_default ICONS_birdies 
     62 
     63 
     64# Comment the next two lines out, if they cause problems 
     65UNAME = $$system(uname -s) 
     66message( You appear to be running $$UNAME $$system(uname -r) ) 
     67# HELP 
     68message('qmake build options are: "CONFIG+=QSA BINRELOC TRAYICON" PREFIX="/path"') 
     69message('Read the INSTALL file more more information.') 
     70 
     71 
     72TRANSLATIONS = \ 
     73  translations/museeq_fr.ts \ 
     74  translations/museeq_pl.ts \ 
     75  translations/museeq_it.ts \ 
     76  translations/museeq_de.ts \ 
     77  translations/museeq_pt_BR.ts \ 
     78  translations/museeq_es.ts \ 
     79  translations/museeq_ro.ts \ 
     80  translations/museeq_nl.ts 
     81TRANSLATIONS.path = $${MUSEEQDATA}/translations 
     82INSTALLS += TRANSLATIONS 
    6983# Input 
    7084HEADERS += aclineedit.h \