detect and load standard Qt translations
git-svn-id: https://lmms.svn.sf.net/svnroot/lmms/trunk/lmms@142 0778d3d1-df1d-0410-868b-ea421aaaa00d
This commit is contained in:
@@ -1,3 +1,9 @@
|
||||
2006-06-03 Javier Serrano Polo <jasp00/at/terra/dot/es>
|
||||
|
||||
* acinclude.m4:
|
||||
* src/core/main.cpp:
|
||||
detect and load standard Qt translations
|
||||
|
||||
2006-05-29 Javier Serrano Polo <jasp00/dot/terra/dot/es>
|
||||
|
||||
* src/core/arp_and_chords_tab_widget.cpp:
|
||||
|
||||
@@ -65,12 +65,13 @@ QString file_to_render;
|
||||
int splash_alignment_flags = Qt::AlignTop | Qt::AlignLeft;
|
||||
#endif
|
||||
|
||||
inline void loadTranslation( const QString & _tname )
|
||||
inline void loadTranslation( const QString & _tname,
|
||||
const QString & _dir = configManager::inst()->localeDir() )
|
||||
{
|
||||
QTranslator * t = new QTranslator( 0 );
|
||||
QString name = _tname + ".qm";
|
||||
|
||||
t->load( name, configManager::inst()->localeDir() );
|
||||
t->load( name, _dir );
|
||||
|
||||
qApp->installTranslator( t );
|
||||
}
|
||||
@@ -173,7 +174,12 @@ int main( int argc, char * * argv )
|
||||
QString( QTextCodec::locale() ).section( '_', 0, 0 );
|
||||
#endif
|
||||
// load translation for Qt-widgets/-dialogs
|
||||
#ifdef QT_TRANSLATIONS_DIR
|
||||
loadTranslation( QString( "qt_" ) + pos,
|
||||
QString( QT_TRANSLATIONS_DIR ) );
|
||||
#else
|
||||
loadTranslation( QString( "qt_" ) + pos );
|
||||
#endif
|
||||
// load actual translation for LMMS
|
||||
loadTranslation( pos );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user