|
|
@ -18,6 +18,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
#include "LabelModel.h"
|
|
|
|
#include "LabelModel.h"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#include "Lookup.h"
|
|
|
|
|
|
|
|
|
|
|
|
#include "CalamaresVersion.h" // For the list of translations
|
|
|
|
#include "CalamaresVersion.h" // For the list of translations
|
|
|
|
|
|
|
|
|
|
|
|
namespace CalamaresUtils::Locale
|
|
|
|
namespace CalamaresUtils::Locale
|
|
|
@ -106,6 +108,19 @@ LabelModel::find( const QLocale& locale ) const
|
|
|
|
} );
|
|
|
|
} );
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
int
|
|
|
|
|
|
|
|
LabelModel::find( const QString& countryCode ) const
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
if ( countryCode.length() != 2 )
|
|
|
|
|
|
|
|
return -1;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
auto c_l = countryData( countryCode );
|
|
|
|
|
|
|
|
int r = find( [&]( const Label& l ){ return ( l.language() == c_l.second ) && ( l.country() == c_l.first ); } );
|
|
|
|
|
|
|
|
if ( r >= 0 )
|
|
|
|
|
|
|
|
return r;
|
|
|
|
|
|
|
|
return find( [&]( const Label& l ){ return l.language() == c_l.second; } );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
LabelModel* const availableTranslations()
|
|
|
|
LabelModel* const availableTranslations()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
static LabelModel model( QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';') );
|
|
|
|
static LabelModel model( QString( CALAMARES_TRANSLATION_LANGUAGES ).split( ';') );
|
|
|
|