mirror of
https://github.com/parchlinux/calamares.git
synced 2025-07-01 19:35:36 -04:00
[locale] Move status strings from Page to Config
- the config knows the status and how to describe it, fetch the strings from there.
This commit is contained in:
parent
855b21a7db
commit
ef08ff6ac0
5 changed files with 43 additions and 34 deletions
|
@ -22,6 +22,7 @@
|
|||
|
||||
#include "SetTimezoneJob.h"
|
||||
|
||||
#include "locale/Label.h"
|
||||
#include "utils/Logger.h"
|
||||
#include "utils/Variant.h"
|
||||
|
||||
|
@ -245,6 +246,33 @@ Config::setLCLocaleExplicitly( const QString& locale )
|
|||
m_selectedLocaleConfiguration.explicit_lc = true;
|
||||
}
|
||||
|
||||
std::pair< QString, QString >
|
||||
Config::prettyLocaleStatus() const
|
||||
{
|
||||
using CalamaresUtils::Locale::Label;
|
||||
|
||||
Label lang( m_selectedLocaleConfiguration.language(), Label::LabelFormat::AlwaysWithCountry );
|
||||
Label num( m_selectedLocaleConfiguration.lc_numeric, Label::LabelFormat::AlwaysWithCountry );
|
||||
|
||||
return std::make_pair< QString, QString >(
|
||||
tr( "The system language will be set to %1." ).arg( lang.label() ),
|
||||
tr( "The numbers and dates locale will be set to %1." ).arg( num.label() ) );
|
||||
}
|
||||
|
||||
QString
|
||||
Config::prettyStatus() const
|
||||
{
|
||||
QString br( QStringLiteral("<br/>"));
|
||||
QString status;
|
||||
status += tr( "Set timezone to %1/%2." ).arg( m_currentLocation->region(), m_currentLocation->zone() ) + br;
|
||||
|
||||
auto labels = prettyLocaleStatus();
|
||||
status += labels.first + br;
|
||||
status += labels.second + br;
|
||||
|
||||
return status;
|
||||
}
|
||||
|
||||
|
||||
void
|
||||
Config::setConfigurationMap( const QVariantMap& configurationMap )
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue