[libcalamares] Rename files Label -> Translation

This commit is contained in:
Adriaan de Groot 2021-07-26 11:38:15 +02:00
parent bf9f1c95bc
commit bc9d8fb13a
12 changed files with 22 additions and 20 deletions

View File

@ -40,12 +40,12 @@ set( libSources
# Locale-data service
locale/Global.cpp
locale/Label.cpp
locale/LabelModel.cpp
locale/Lookup.cpp
locale/TimeZone.cpp
locale/TranslatableConfiguration.cpp
locale/TranslatableString.cpp
locale/Translation.cpp
locale/TranslationsModel.cpp
# Modules
modulesystem/Config.cpp

View File

@ -9,9 +9,9 @@
*/
#include "locale/Global.h"
#include "locale/LabelModel.h"
#include "locale/TimeZone.h"
#include "locale/TranslatableConfiguration.h"
#include "locale/TranslationsModel.h"
#include "CalamaresVersion.h"
#include "GlobalStorage.h"

View File

@ -10,7 +10,7 @@
#include "TranslatableConfiguration.h"
#include "LabelModel.h"
#include "TranslationsModel.h"
#include "utils/Logger.h"
#include "utils/Variant.h"
@ -69,6 +69,7 @@ TranslatedString::get() const
QString
TranslatedString::get( const QLocale& locale ) const
{
// TODO: keep track of special cases like sr@latin and ca@valencia
QString localeName = locale.name();
// Special case, sr@latin doesn't have the @latin reflected in the name
if ( locale.language() == QLocale::Language::Serbian && locale.script() == QLocale::Script::LatinScript )

View File

@ -9,7 +9,7 @@
*
*/
#include "Label.h"
#include "Translation.h"
#include <memory>

View File

@ -9,8 +9,8 @@
*
*/
#ifndef LOCALE_LABEL_H
#define LOCALE_LABEL_H
#ifndef LOCALE_TRANSLATION_H
#define LOCALE_TRANSLATION_H
#include <QLocale>
#include <QObject>
@ -56,8 +56,8 @@ public:
* in the label (human-readable form) or only if needed for disambiguation.
*/
Translation( const QString& localeName,
LabelFormat format = LabelFormat::IfNeededWithCountry,
QObject* parent = nullptr );
LabelFormat format = LabelFormat::IfNeededWithCountry,
QObject* parent = nullptr );
/** @brief Define a sorting order.

View File

@ -9,7 +9,7 @@
*
*/
#include "LabelModel.h"
#include "TranslationsModel.h"
#include "Lookup.h"
@ -121,7 +121,8 @@ TranslationsModel::find( const QString& countryCode ) const
}
auto c_l = countryData( countryCode );
int r = find( [&]( const Translation& l ) { return ( l.language() == c_l.second ) && ( l.country() == c_l.first ); } );
int r = find(
[&]( const Translation& l ) { return ( l.language() == c_l.second ) && ( l.country() == c_l.first ); } );
if ( r >= 0 )
{
return r;
@ -132,7 +133,8 @@ TranslationsModel::find( const QString& countryCode ) const
TranslationsModel*
availableTranslations()
{
static TranslationsModel* model = new TranslationsModel( QStringLiteral( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' ) );
static TranslationsModel* model
= new TranslationsModel( QStringLiteral( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' ) );
return model;
}

View File

@ -9,11 +9,11 @@
*
*/
#ifndef LOCALE_LABELMODEL_H
#define LOCALE_LABELMODEL_H
#ifndef LOCALE_TRANSLATIONSMODEL_H
#define LOCALE_TRANSLATIONSMODEL_H
#include "DllMacro.h"
#include "Label.h"
#include "Translation.h"
#include <QAbstractListModel>
#include <QVector>

View File

@ -15,7 +15,7 @@
#include "JobQueue.h"
#include "Settings.h"
#include "locale/Global.h"
#include "locale/Label.h"
#include "locale/Translation.h"
#include "modulesystem/ModuleManager.h"
#include "network/Manager.h"
#include "utils/Logger.h"

View File

@ -10,7 +10,7 @@
#ifndef WELCOME_CONFIG_H
#define WELCOME_CONFIG_H
#include "locale/LabelModel.h"
#include "locale/TranslationsModel.h"
#include "modulesystem/RequirementsModel.h"
#include <QObject>

View File

@ -20,7 +20,6 @@
#include "Settings.h"
#include "ViewManager.h"
#include "locale/LabelModel.h"
#include "modulesystem/ModuleManager.h"
#include "modulesystem/RequirementsModel.h"
#include "utils/CalamaresUtilsGui.h"

View File

@ -11,7 +11,7 @@
#ifndef WELCOMEPAGE_H
#define WELCOMEPAGE_H
#include "locale/LabelModel.h"
#include "locale/TranslationsModel.h"
#include <QStyledItemDelegate>
#include <QWidget>

View File

@ -12,7 +12,7 @@
#include "checker/GeneralRequirements.h"
#include "locale/LabelModel.h"
#include "locale/TranslationsModel.h"
#include "utils/Dirs.h"
#include "utils/Logger.h"
#include "utils/Variant.h"