[libcalamares] Rename files Label -> Translation

main
Adriaan de Groot 4 years ago
parent bf9f1c95bc
commit bc9d8fb13a

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

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

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

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

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

@ -9,7 +9,7 @@
* *
*/ */
#include "LabelModel.h" #include "TranslationsModel.h"
#include "Lookup.h" #include "Lookup.h"
@ -121,7 +121,8 @@ TranslationsModel::find( const QString& countryCode ) const
} }
auto c_l = countryData( countryCode ); 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 ) if ( r >= 0 )
{ {
return r; return r;
@ -132,7 +133,8 @@ TranslationsModel::find( const QString& countryCode ) const
TranslationsModel* TranslationsModel*
availableTranslations() availableTranslations()
{ {
static TranslationsModel* model = new TranslationsModel( QStringLiteral( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' ) ); static TranslationsModel* model
= new TranslationsModel( QStringLiteral( CALAMARES_TRANSLATION_LANGUAGES ).split( ';' ) );
return model; return model;
} }

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

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

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

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

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

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

Loading…
Cancel
Save