return pix;
}
+/*!
+ \brief Specify default language for the application.
+*/
+QString QtxResourceMgr::defaultLanguage() const
+{
+ return "";
+}
+
/*!
\brief Load translation files according to the specified language.
substMap.insert( 'A', appName() );
QString lang = l;
+ if ( lang.isEmpty() )
+ lang = defaultLanguage();
if ( lang.isEmpty() )
value( langSection(), "language", lang );
void refresh();
protected:
+ virtual QString defaultLanguage() const;
+
virtual void setDirList( const QStringList& );
virtual void setResource( const QString&, const QString&, const QString& );
{
return -1;
}
+
+/*!
+ \brief Specify default language for the application.
+*/
+QString SUIT_ResourceMgr::defaultLanguage() const
+{
+ QStringList arguments;
+ QString language;
+ if ( SUIT_Session::session() ) arguments = SUIT_Session::session()->arguments();
+ // Try language, given in arguments
+ for (int i = 1; i < arguments.count(); i++) {
+ QRegExp rx ("--language=(.+)");
+ if ( rx.indexIn( arguments[i] ) >= 0 && rx.captureCount() > 0 ) {
+ language = rx.cap(1);
+ }
+ }
+ return language;
+}
virtual QString userFileName( const QString&, const bool = true ) const;
virtual QString findAppropriateUserFile( const QString& ) const;
virtual long userFileId( const QString& ) const;
+ virtual QString defaultLanguage() const;
private:
QString myVersion;