-rw-r--r-- | libopie2/opiecore/opluginloader.cpp | 20 |
1 files changed, 13 insertions, 7 deletions
diff --git a/libopie2/opiecore/opluginloader.cpp b/libopie2/opiecore/opluginloader.cpp index b8b6b79..ec19fa0 100644 --- a/libopie2/opiecore/opluginloader.cpp +++ b/libopie2/opiecore/opluginloader.cpp | |||
@@ -433,17 +433,17 @@ QUnknownInterface* OGenericPluginLoader::load( const OPluginItem& item, const QU | |||
433 | return 0l; | 433 | return 0l; |
434 | } | 434 | } |
435 | 435 | ||
436 | /** | 436 | /** |
437 | * try to load the plugin and just in case initialize the pointer to a pointer again | 437 | * try to load the plugin and just in case initialize the pointer to a pointer again |
438 | */ | 438 | */ |
439 | QUnknownInterface* iface=0; | 439 | QUnknownInterface* iface=0; |
440 | if ( lib->queryInterface( uuid, &iface ) == QS_OK ) { | 440 | if ( lib->queryInterface( uuid, &iface ) == QS_OK ) { |
441 | installTranslators(pa.left( pa.find("."))); | 441 | installTranslators( item.name() ); |
442 | m_library.insert( iface, lib ); | 442 | m_library.insert( iface, lib ); |
443 | }else | 443 | }else |
444 | iface = 0; | 444 | iface = 0; |
445 | 445 | ||
446 | setSafeMode(); | 446 | setSafeMode(); |
447 | 447 | ||
448 | return iface; | 448 | return iface; |
449 | } | 449 | } |
@@ -598,26 +598,32 @@ OPluginItem::List OGenericPluginLoader::plugins( const QString& _dir, bool sorte | |||
598 | /** | 598 | /** |
599 | * @internal generate a list of languages from $LANG | 599 | * @internal generate a list of languages from $LANG |
600 | */ | 600 | */ |
601 | QStringList OGenericPluginLoader::languageList() { | 601 | QStringList OGenericPluginLoader::languageList() { |
602 | if ( m_languages.isEmpty() ) { | 602 | if ( m_languages.isEmpty() ) { |
603 | /* | 603 | /* |
604 | * be_BY.CP1251 We will add, be_BY.CP1251,be_BY,be | 604 | * be_BY.CP1251 We will add, be_BY.CP1251,be_BY,be |
605 | * to our list of languages. | 605 | * to our list of languages. |
606 | * Also for de_DE@euro we will add de_DE@eurp, de_DE, de | ||
607 | * to our list of languages | ||
606 | */ | 608 | */ |
607 | QString str = ::getenv( "LANG" ); | 609 | QString str = ::getenv( "LANG" ); |
608 | m_languages += str; | 610 | m_languages += str; |
609 | int pos = str.find( '.' ); | 611 | int pos = str.find( '@' ); |
610 | 612 | if( pos > 0 ) | |
613 | m_languages += str.left( pos ); | ||
614 | |||
615 | |||
616 | pos = str.find( '.' ); | ||
611 | if ( pos > 0 ) | 617 | if ( pos > 0 ) |
612 | m_languages += str.left( pos ); | 618 | m_languages += str.left( pos ); |
613 | 619 | ||
614 | int n_pos = str.find( '_' ); | 620 | int n_pos = str.find( '_' ); |
615 | if ( pos > 0 && n_pos >= pos ) | 621 | if ( n_pos > 0 ) |
616 | m_languages += str.left( n_pos ); | 622 | m_languages += str.left( n_pos ); |
617 | 623 | ||
618 | } | 624 | } |
619 | return m_languages; | 625 | return m_languages; |
620 | } | 626 | } |
621 | 627 | ||
622 | /** | 628 | /** |
623 | * @internal | 629 | * @internal |
@@ -627,23 +633,23 @@ void OGenericPluginLoader::installTranslators(const QString& type) { | |||
627 | QStringList lst = languageList(); | 633 | QStringList lst = languageList(); |
628 | 634 | ||
629 | /* | 635 | /* |
630 | * for each language and maybe later for each language dir... | 636 | * for each language and maybe later for each language dir... |
631 | * try to load a Translator | 637 | * try to load a Translator |
632 | */ | 638 | */ |
633 | for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { | 639 | for ( QStringList::Iterator it = lst.begin(); it != lst.end(); ++it ) { |
634 | QTranslator* trans = new QTranslator( qApp ); | 640 | QTranslator* trans = new QTranslator( qApp ); |
635 | QString tfn = QPEApplication::qpeDir()+"/i18n/" + *it + "/" + type + ".qm" ; | 641 | QString tfn = QPEApplication::qpeDir()+"/i18n/" + *it + "/lib" + type + ".qm" ; |
636 | 642 | ||
637 | /* | 643 | /* |
638 | * If loaded then install else clean up and don't leak | 644 | * If loaded then install else clean up and don't leak |
639 | */ | 645 | */ |
640 | if ( trans->load( tfn ) ) | 646 | if ( trans->load( tfn ) ) |
641 | qApp->installTranslator( trans ); | 647 | qApp->installTranslator( trans ); |
642 | else | 648 | else |
643 | delete trans; | 649 | delete trans; |
644 | } | 650 | } |
645 | } | 651 | } |
646 | 652 | ||
647 | /** | 653 | /** |
648 | * \brief Simple c'tor. | 654 | * \brief Simple c'tor. |
649 | * | 655 | * |