diff --git a/Messages.sh b/Messages.sh --- a/Messages.sh +++ b/Messages.sh @@ -1,6 +1,11 @@ #! /bin/sh -for fname in `find -iname \*.dgml`; do +### qtapp, libs & plugins catalog into marble_qt.pot + +# collect strings from DGML files +# TODO: only added to KDE app catalog +# TODO: used with QObject::tr(...) currently, does that work at all? +for fname in `find data/maps -iname \*.dgml`; do for field in name description heading text ; do grep -inH "<$field>.*<\/$field>" $fname \ | sed 's/\"/\\\"/g' \ @@ -13,6 +18,9 @@ done done +# collect strings from legend.html file +# TODO: only added to KDE app catalog currently +# TODO: used with MarbleLegendBrowser::tr(...) at least currently, does that work at all? cat data/legend.html \ | tr -d '\n' \ | sed -e 's/.*\(.*\)<\/body>/\1/' \ @@ -27,15 +35,24 @@ | sed -e 's/^\(.*\)$/\/\/i18n: file .\/data\/legend.html\ni18n(\"\1\");/' \ >> rc.cpp +# collect strings from stars file +# TODO: just tr(xxx) might not work, there needs to be a QObject involved or QCoreApplication::translate cut -d ';' -f 1 data/stars/names.csv | sed -e 's/^/tr(\"/' -e 's/$/\");/' >> rc_qt.cpp # Eliminate empty i18n calls. egrep -B1 'i18nc?\(".*[^ ].*"\)' rc.cpp > rc.cpp.1 mv rc.cpp.1 rc.cpp -$EXTRACTRC `find . -name '*.ui' \ - -o -name '*.rc' -a ! -name marble.rc \ - -o -name '*.kcfg'` >> rc.cpp -$XGETTEXT src/apps/marble-kde/kdemain.cpp src/apps/marble-kde/marble_part.cpp rc.cpp -o $podir/marble.pot -$XGETTEXT_QT src/apps/marble-qt/QtMainWindow.cpp src/apps/marble-qt/qtmain.cpp src/apps/marble-ui/ControlView.cpp `find src/plugins -name '*.cpp' | grep -v '/test/'` `find src/lib -name '*.cpp'` src/lib/marble/global.h src/lib/marble/MarbleGlobal.h rc_qt.cpp -o $podir/marble_qt.pot -rm -f rc_qt.cpp \ No newline at end of file +$EXTRACT_TR_STRINGS src/apps/marble-qt/QtMainWindow.cpp src/apps/marble-qt/qtmain.cpp \ + src/apps/marble-ui/ControlView.cpp \ + `find src/plugins -name '*.cpp' -o -name '*.ui' | grep -v '/test/'` \ + `find src/lib -name '*.cpp' -o -name '*.ui'` \ + src/lib/marble/global.h src/lib/marble/MarbleGlobal.h rc_qt.cpp \ + -o $podir/marble_qt.pot + +# kde app catalog +$EXTRACTRC `find src/apps/marble-kde -name '*.rc' -o -name '*.kcfg'` >> rc.cpp +$XGETTEXT `find src/apps/marble-kde -name \*.cpp` rc.cpp -o $podir/marble.pot + +# cleanup custom intermediate file +rm -f rc_qt.cpp diff --git a/src/apps/marble-kde/KdeMainWindow.cpp b/src/apps/marble-kde/KdeMainWindow.cpp --- a/src/apps/marble-kde/KdeMainWindow.cpp +++ b/src/apps/marble-kde/KdeMainWindow.cpp @@ -21,6 +21,7 @@ #include // KDE +#include #include #include #include @@ -93,7 +94,7 @@ { GeoSceneDocument *mapTheme = marbleWidget()->mapTheme(); if ( mapTheme ) { - setWindowTitle(tr("Marble Virtual Globe") + " - " + mapTheme->head()->name()); + setWindowTitle(i18n("Marble Virtual Globe") + " - " + mapTheme->head()->name()); } } diff --git a/src/apps/marble-kde/marble_part.cpp b/src/apps/marble-kde/marble_part.cpp --- a/src/apps/marble-kde/marble_part.cpp +++ b/src/apps/marble-kde/marble_part.cpp @@ -931,17 +931,17 @@ connect( m_controlView->marbleWidget(), SIGNAL(themeChanged(QString)), this, SLOT(updateMapEditButtonVisibility(QString)) ); - m_recordMovieAction = new QAction( tr( "&Record Movie" ), this ); + m_recordMovieAction = new QAction( i18n( "&Record Movie" ), this ); actionCollection()->addAction( "record_movie" , m_recordMovieAction ); - m_recordMovieAction->setStatusTip( tr( "Records a movie of the globe" ) ); + m_recordMovieAction->setStatusTip( i18n( "Records a movie of the globe" ) ); actionCollection()->setDefaultShortcut( m_recordMovieAction, Qt::CTRL + Qt::SHIFT + Qt::Key_R ); m_recordMovieAction->setIcon( QIcon( ":/icons/animator.png" ) ); connect( m_recordMovieAction, SIGNAL(triggered()), this, SLOT(showMovieCaptureDialog()) ); - m_stopRecordingAction = new QAction( tr( "&Stop recording" ), this ); + m_stopRecordingAction = new QAction( i18n( "&Stop recording" ), this ); actionCollection()->addAction( "stop_recording" , m_stopRecordingAction ); - m_stopRecordingAction->setStatusTip( tr( "Stop recording a movie of the globe" ) ); + m_stopRecordingAction->setStatusTip( i18n( "Stop recording a movie of the globe" ) ); actionCollection()->setDefaultShortcut( m_recordMovieAction, Qt::CTRL + Qt::SHIFT + Qt::Key_S ); m_stopRecordingAction->setEnabled( false ); connect( m_stopRecordingAction, SIGNAL(triggered()),