|
|
@ -21,8 +21,8 @@
|
|
|
|
#include "locale/LabelModel.h"
|
|
|
|
#include "locale/LabelModel.h"
|
|
|
|
#include "locale/TranslatableConfiguration.h"
|
|
|
|
#include "locale/TranslatableConfiguration.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "utils/Logger.h"
|
|
|
|
|
|
|
|
#include "CalamaresVersion.h"
|
|
|
|
#include "CalamaresVersion.h"
|
|
|
|
|
|
|
|
#include "utils/Logger.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include <QtTest/QtTest>
|
|
|
|
#include <QtTest/QtTest>
|
|
|
|
|
|
|
|
|
|
|
@ -93,7 +93,8 @@ someLanguages()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
void LocaleTests::testTranslatableLanguages()
|
|
|
|
void
|
|
|
|
|
|
|
|
LocaleTests::testTranslatableLanguages()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QStringList availableLanguages = QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' );
|
|
|
|
QStringList availableLanguages = QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' );
|
|
|
|
cDebug() << "Translation languages:" << availableLanguages;
|
|
|
|
cDebug() << "Translation languages:" << availableLanguages;
|
|
|
@ -104,7 +105,8 @@ someLanguages()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LocaleTests::testTranslatableConfig1()
|
|
|
|
void
|
|
|
|
|
|
|
|
LocaleTests::testTranslatableConfig1()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
CalamaresUtils::Locale::TranslatedString ts1( "Hello" );
|
|
|
|
CalamaresUtils::Locale::TranslatedString ts1( "Hello" );
|
|
|
|
QCOMPARE( ts1.count(), 1 );
|
|
|
|
QCOMPARE( ts1.count(), 1 );
|
|
|
@ -121,13 +123,15 @@ void LocaleTests::testTranslatableConfig1()
|
|
|
|
QCOMPARE( ts2.get( QLocale( "nl" ) ), "description (no language)" );
|
|
|
|
QCOMPARE( ts2.get( QLocale( "nl" ) ), "description (no language)" );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void LocaleTests::testTranslatableConfig2()
|
|
|
|
void
|
|
|
|
|
|
|
|
LocaleTests::testTranslatableConfig2()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
QVariantMap map;
|
|
|
|
QVariantMap map;
|
|
|
|
|
|
|
|
|
|
|
|
for ( const auto& language : someLanguages() )
|
|
|
|
for ( const auto& language : someLanguages() )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
map.insert( QString("description[%1]").arg(language), QString("description (language %1)").arg(language) );
|
|
|
|
map.insert( QString( "description[%1]" ).arg( language ),
|
|
|
|
|
|
|
|
QString( "description (language %1)" ).arg( language ) );
|
|
|
|
if ( language != "nl" )
|
|
|
|
if ( language != "nl" )
|
|
|
|
{
|
|
|
|
{
|
|
|
|
map.insert( QString( "name[%1]" ).arg( language ), QString( "name (language %1)" ).arg( language ) );
|
|
|
|
map.insert( QString( "name[%1]" ).arg( language ), QString( "name (language %1)" ).arg( language ) );
|
|
|
|