Compare commits

..

6 Commits

Author SHA1 Message Date
a6558c7b1d add initchooser 2023-12-27 19:01:27 +01:00
Adriaan de Groot
115f00f5cd [libcalamares] Rename tr() functions to avoid confusing lupdate 2023-12-25 14:24:06 +01:00
Adriaan de Groot
e73f5fb9fe [libcalamaresui] update percentage indicator on language change
Otherwise starting in one language will never change the
formatting of percentages when the language changes
later (example: Turkish writes %30, while Dutch writes 30%).

FIXES #2258
2023-12-25 00:06:00 +01:00
Adriaan de Groot
cd0a381a35 CI: make the openSUSE docker (Qt5) container more comfortable 2023-12-24 23:37:36 +01:00
Adriaan de Groot
709296940c i18n: suppress duplicated languages
The list of translations from Transifex contains "en", and we
add it explicitly a second time -- instead of fixing those and
needing to ensure that the source language is returned, or optionally
adding "en" if it isn't in the list already, just de-duplicate.

FIXES #2257
2023-12-24 23:01:37 +01:00
Adriaan de Groot
00821945c5 Changes: post-release housekeeping 2023-12-15 15:59:58 +01:00
15 changed files with 313 additions and 164 deletions

View File

@@ -8,6 +8,18 @@ changelog -- this log starts with version 3.3.0. See CHANGES-3.2 for
the history of the 3.2 series (2018-05 - 2022-08).
# 3.3.1 (unreleased)
This release contains contributions from (alphabetically by first name):
- Nobody yet!
## Core ##
- No changes of note.
## Modules ##
- No changes of note.
# 3.3.0 (2023-12-12)
This release contains contributions from (alphabetically by first name):

View File

@@ -47,8 +47,8 @@
cmake_minimum_required(VERSION 3.16 FATAL_ERROR)
set(CALAMARES_VERSION 3.3.0)
set(CALAMARES_RELEASE_MODE ON) # Set to ON during a release
set(CALAMARES_VERSION 3.3.1)
set(CALAMARES_RELEASE_MODE OFF) # Set to ON during a release
if(CMAKE_SCRIPT_MODE_FILE)
include(${CMAKE_CURRENT_LIST_DIR}/CMakeModules/ExtendedVersion.cmake)
@@ -513,6 +513,7 @@ if(NOT CALAMARES_RELEASE_MODE)
list(APPEND CALAMARES_TRANSLATION_LANGUAGES ${_tx_incomplete})
endif()
list(SORT CALAMARES_TRANSLATION_LANGUAGES)
list(REMOVE_DUPLICATES CALAMARES_TRANSLATION_LANGUAGES)
add_subdirectory(lang) # i18n tools

View File

@@ -43,4 +43,8 @@ zypper --non-interactive in \
# Not actual dependencies, but good to have
zypper --non-interactive in python311-PyYAML python311-jsonschema
# vi to edit things inside the docker
zypper --non-interactive in vim
# noto so that running Calamares in the docker is readable
zypper --non-interactive in noto-sans-fonts
true

View File

@@ -378,7 +378,7 @@ LocaleTests::testTZLookup()
QVERIFY( zones.find( "America", "New_York" ) );
QCOMPARE( zones.find( "America", "New_York" )->zone(), QStringLiteral( "New_York" ) );
QCOMPARE( zones.find( "America", "New_York" )->tr(), QStringLiteral( "New York" ) );
QCOMPARE( zones.find( "America", "New_York" )->translated(), QStringLiteral( "New York" ) );
QVERIFY( !zones.find( "Europe", "New_York" ) );
QVERIFY( !zones.find( "America", "New York" ) );

View File

@@ -76,7 +76,7 @@ TimeZoneData::TimeZoneData( const QString& region,
}
QString
TimeZoneData::tr() const
TimeZoneData::translated() const
{
// NOTE: context name must match what's used in zone-extractor.py
return QObject::tr( m_human, "tz_names" );
@@ -86,11 +86,11 @@ class RegionData : public TranslatableString
{
public:
using TranslatableString::TranslatableString;
QString tr() const override;
QString translated() const override;
};
QString
RegionData::tr() const
RegionData::translated() const
{
// NOTE: context name must match what's used in zone-extractor.py
return QObject::tr( m_human, "tz_regions" );
@@ -276,7 +276,7 @@ RegionsModel::data( const QModelIndex& index, int role ) const
const auto& region = m_private->m_regions[ index.row() ];
if ( role == NameRole )
{
return region->tr();
return region->translated();
}
if ( role == KeyRole )
{
@@ -292,13 +292,13 @@ RegionsModel::roleNames() const
}
QString
RegionsModel::tr( const QString& region ) const
RegionsModel::translated( const QString& region ) const
{
for ( const auto* p : m_private->m_regions )
{
if ( p->key() == region )
{
return p->tr();
return p->translated();
}
}
return region;
@@ -330,7 +330,7 @@ ZonesModel::data( const QModelIndex& index, int role ) const
switch ( role )
{
case NameRole:
return zone->tr();
return zone->translated();
case KeyRole:
return zone->key();
case RegionRole:

View File

@@ -48,7 +48,7 @@ class TimeZoneData : public QObject, TranslatableString
Q_PROPERTY( QString region READ region CONSTANT )
Q_PROPERTY( QString zone READ zone CONSTANT )
Q_PROPERTY( QString name READ tr CONSTANT )
Q_PROPERTY( QString name READ translated CONSTANT )
Q_PROPERTY( QString countryCode READ country CONSTANT )
public:
@@ -60,7 +60,7 @@ public:
TimeZoneData( const TimeZoneData& ) = delete;
TimeZoneData( TimeZoneData&& ) = delete;
QString tr() const override;
QString translated() const override;
QString region() const { return m_region; }
QString zone() const { return key(); }
@@ -106,7 +106,7 @@ public Q_SLOTS:
* Returns @p region unchanged if there is no such region
* or no translation for the region's name.
*/
QString tr( const QString& region ) const;
QString translated( const QString& region ) const;
private:
Private* m_private;

View File

@@ -41,7 +41,7 @@ public:
virtual ~TranslatableString();
/// @brief Give the localized human-readable form
virtual QString tr() const = 0;
virtual QString translated() const = 0;
QString key() const { return m_key; }
bool operator==( const TranslatableString& other ) const { return m_key == other.m_key; }

View File

@@ -73,7 +73,9 @@ ExecutionViewStep::ExecutionViewStep( QObject* parent )
{
m_widget->setObjectName( "slideshow" );
m_progressBar->setObjectName( "exec-progress" );
m_progressBar->setFormat( tr( "%p%", "Progress percentage indicator: %p is where the number 0..100 is placed" ) );
CALAMARES_RETRANSLATE(
m_progressBar->setFormat( tr( "%p%", "Progress percentage indicator: %p is where the number 0..100 is placed" ) );
);
m_label->setObjectName( "exec-message" );
QVBoxLayout* layout = new QVBoxLayout( m_widget );

View File

@@ -390,7 +390,7 @@ Config::currentTimezoneName() const
{
if ( m_currentLocation )
{
return m_regionModel->tr( m_currentLocation->region() ) + '/' + m_currentLocation->tr();
return m_regionModel->translated( m_currentLocation->region() ) + '/' + m_currentLocation->translated();
}
return QString();
}

View File

@@ -144,7 +144,7 @@ TimeZoneWidget::paintEvent( QPaintEvent* )
#else
auto textwidth = [ & ]( const QString& s ) { return fontMetrics.width( s ); };
#endif
const int textWidth = textwidth( m_currentLocation ? m_currentLocation->tr() : QString() );
const int textWidth = textwidth( m_currentLocation ? m_currentLocation->translated() : QString() );
const int textHeight = fontMetrics.height();
QRect rect = QRect( point.x() - textWidth / 2 - 5, point.y() - textHeight - 8, textWidth + 10, textHeight - 2 );
@@ -170,7 +170,7 @@ TimeZoneWidget::paintEvent( QPaintEvent* )
painter.setBrush( QColor( 40, 40, 40 ) );
painter.drawRoundedRect( rect, 3, 3 );
painter.setPen( Qt::white );
painter.drawText( rect.x() + 5, rect.bottom() - 4, m_currentLocation ? m_currentLocation->tr() : QString() );
painter.drawText( rect.x() + 5, rect.bottom() - 4, m_currentLocation ? m_currentLocation->translated() : QString() );
#endif
}

View File

@@ -0,0 +1,2 @@
SPDX-FileCopyrightText: 2020 demmm <anke62@gmail.com>
SPDX-License-Identifier: GPL-3.0-or-later

View File

@@ -42,7 +42,7 @@ Item {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("LibreOffice is a powerful and free office suite, used by millions of people around the world. It includes several applications that make it the most versatile Free and Open Source office suite on the market.<br/>
text: qsTr("OpenRC base system.<br/>
Default option.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
@@ -50,76 +50,14 @@ Item {
wrapMode: Text.WordWrap
}
Switch {
id: element2
x: 500
y: 110
width: 187
height: 14
text: qsTr("LibreOffice")
checked: true
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element2.checked ? "#3498db" : "#B9B9B9"
border.color: element2.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element2.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element2.down ? "#cccccc" : "#ffffff"
border.color: element2.checked ? (element1.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "libreoffice"
}
}
}
Image {
id: image2
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/libreoffice.jpg"
}
}
Rectangle {
width: 700
height: 150
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("If you don't want to install an office suite, just select No Office Suite. You can always add one (or more) later on your installed system as the need arrives.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element1
x: 500
y: 110
width: 187
height: 14
text: qsTr("No Office Suite")
checked: false
text: qsTr("OpenRC")
checked: true
hoverEnabled: true
ButtonGroup.group: switchGroup
@@ -143,18 +81,80 @@ Item {
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "no_office_suite"
config.packageChoice = "elogind-openrc"
}
}
}
Image {
id: image
id: image1
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/no-selection.png"
source: "images/artix.png"
}
}
Rectangle {
width: 700
height: 150
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("Dinit base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element2
x: 500
y: 110
width: 187
height: 14
text: qsTr("Dinit")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element2.checked ? "#3498db" : "#B9B9B9"
border.color: element2.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element2.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element2.down ? "#cccccc" : "#ffffff"
border.color: element2.checked ? (element2.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "elogind-dinit"
}
}
}
Image {
id: image2
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/artix.png"
}
}
@@ -169,7 +169,7 @@ Item {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("Create a minimal Desktop install, remove all extra applications and decide later on what you would like to add to your system. Examples of what won't be on such an install, there will be no Office Suite, no media players, no image viewer or print support. It will be just a desktop, file browser, package manager, text editor and simple web-browser.")
text: qsTr("Runit base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
@@ -182,7 +182,7 @@ Item {
y: 110
width: 187
height: 14
text: qsTr("Minimal Install")
text: qsTr("Runit")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
@@ -207,7 +207,7 @@ Item {
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "minimal_install"
config.packageChoice = "elogind-runit"
}
}
}
@@ -218,7 +218,70 @@ Item {
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/plasma.png"
source: "images/artix.png"
}
}
Rectangle {
width: 700
height: 150
color: "#ffffff"
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("S6 base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element4
x: 500
y: 110
width: 187
height: 14
text: qsTr("S6")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element4.checked ? "#3498db" : "#B9B9B9"
border.color: element4.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element4.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element4.down ? "#cccccc" : "#ffffff"
border.color: element4.checked ? (element4.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "elogind-s6"
}
}
}
Image {
id: image4
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/artix.png"
}
}
@@ -230,7 +293,7 @@ Item {
Text {
height: 25
anchors.centerIn: parent
text: qsTr("Please select an option for your install, or use the default: LibreOffice included.")
text: qsTr("Please select an option for your install, or use the default: OpenRC.")
font.pointSize: 10
wrapMode: Text.WordWrap
}

View File

@@ -4,5 +4,6 @@
<file>images/libreoffice.jpg</file>
<file>images/no-selection.png</file>
<file>images/plasma.png</file>
<file>images/artix.png</file>
</qresource>
</RCC>

View File

@@ -42,7 +42,7 @@ Item {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("LibreOffice is a powerful and free office suite, used by millions of people around the world. It includes several applications that make it the most versatile Free and Open Source office suite on the market.<br/>
text: qsTr("OpenRC base system.<br/>
Default option.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
@@ -50,76 +50,14 @@ Item {
wrapMode: Text.WordWrap
}
Switch {
id: element2
x: 500
y: 110
width: 187
height: 14
text: qsTr("LibreOffice")
checked: true
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element2.checked ? "#3498db" : "#B9B9B9"
border.color: element2.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element2.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element2.down ? "#cccccc" : "#ffffff"
border.color: element2.checked ? (element1.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "libreoffice"
}
}
}
Image {
id: image2
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/libreoffice.jpg"
}
}
Rectangle {
width: 700
height: 150
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("If you don't want to install an office suite, just select No Office Suite. You can always add one (or more) later on your installed system as the need arrives.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element1
x: 500
y: 110
width: 187
height: 14
text: qsTr("No Office Suite")
checked: false
text: qsTr("OpenRC")
checked: true
hoverEnabled: true
ButtonGroup.group: switchGroup
@@ -143,18 +81,80 @@ Item {
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "no_office_suite"
config.packageChoice = "elogind-openrc"
}
}
}
Image {
id: image
id: image1
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/no-selection.png"
source: "images/artix.png"
}
}
Rectangle {
width: 700
height: 150
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("Dinit base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element2
x: 500
y: 110
width: 187
height: 14
text: qsTr("Dinit")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element2.checked ? "#3498db" : "#B9B9B9"
border.color: element2.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element2.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element2.down ? "#cccccc" : "#ffffff"
border.color: element2.checked ? (element2.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "elogind-dinit"
}
}
}
Image {
id: image2
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/artix.png"
}
}
@@ -169,7 +169,7 @@ Item {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("Create a minimal Desktop install, remove all extra applications and decide later on what you would like to add to your system. Examples of what won't be on such an install, there will be no Office Suite, no media players, no image viewer or print support. It will be just a desktop, file browser, package manager, text editor and simple web-browser.")
text: qsTr("Runit base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
@@ -182,7 +182,7 @@ Item {
y: 110
width: 187
height: 14
text: qsTr("Minimal Install")
text: qsTr("Runit")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
@@ -207,7 +207,7 @@ Item {
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "minimal_install"
config.packageChoice = "elogind-runit"
}
}
}
@@ -218,7 +218,70 @@ Item {
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/plasma.png"
source: "images/artix.png"
}
}
Rectangle {
width: 700
height: 150
color: "#ffffff"
radius: 10
border.width: 0
Text {
width: 450
height: 104
anchors.centerIn: parent
text: qsTr("S6 base system.")
font.pointSize: 10
anchors.verticalCenterOffset: -10
anchors.horizontalCenterOffset: 100
wrapMode: Text.WordWrap
}
Switch {
id: element4
x: 500
y: 110
width: 187
height: 14
text: qsTr("S6")
checked: false
hoverEnabled: true
ButtonGroup.group: switchGroup
indicator: Rectangle {
implicitWidth: 40
implicitHeight: 14
radius: 10
color: element4.checked ? "#3498db" : "#B9B9B9"
border.color: element4.checked ? "#3498db" : "#cccccc"
Rectangle {
x: element4.checked ? parent.width - width : 0
y: (parent.height - height) / 2
width: 20
height: 20
radius: 10
color: element4.down ? "#cccccc" : "#ffffff"
border.color: element4.checked ? (element4.down ? "#3498db" : "#3498db") : "#999999"
}
}
onCheckedChanged: {
if ( checked ) {
config.packageChoice = "elogind-s6"
}
}
}
Image {
id: image4
x: 8
y: 25
height: 100
fillMode: Image.PreserveAspectFit
source: "images/artix.png"
}
}
@@ -230,7 +293,7 @@ Item {
Text {
height: 25
anchors.centerIn: parent
text: qsTr("Please select an option for your install, or use the default: LibreOffice included.")
text: qsTr("Please select an option for your install, or use the default: OpenRC.")
font.pointSize: 10
wrapMode: Text.WordWrap
}

View File

@@ -4,5 +4,6 @@
<file>images/libreoffice.jpg</file>
<file>images/no-selection.png</file>
<file>images/plasma.png</file>
<file>images/artix.png</file>
</qresource>
</RCC>