summaryrefslogtreecommitdiff
path: root/raveos-calamares-module
diff options
context:
space:
mode:
Diffstat (limited to 'raveos-calamares-module')
-rw-r--r--raveos-calamares-module/PKGBUILD2
-rw-r--r--raveos-calamares-module/desktopselect/DesktopSelectViewStep.cpp13
-rw-r--r--raveos-calamares-module/raveusers/RaveUsersViewStep.cpp9
-rw-r--r--raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp43
-rw-r--r--raveos-calamares-module/welcome/RaveWelcomeViewStep.h1
5 files changed, 61 insertions, 7 deletions
diff --git a/raveos-calamares-module/PKGBUILD b/raveos-calamares-module/PKGBUILD
index 6b6de00..6a128e9 100644
--- a/raveos-calamares-module/PKGBUILD
+++ b/raveos-calamares-module/PKGBUILD
@@ -1,7 +1,7 @@
# Maintainer: nippy <nippy@tuta.io>
pkgname=raveos-calamares-module
pkgver=2.0.0
-pkgrel=33
+pkgrel=34
pkgdesc="RaveOS Calamares modules: Wi-Fi, Welcome, Desktop Selector, Users"
arch=('x86_64')
options=('!debug')
diff --git a/raveos-calamares-module/desktopselect/DesktopSelectViewStep.cpp b/raveos-calamares-module/desktopselect/DesktopSelectViewStep.cpp
index a570f58..2c2691f 100644
--- a/raveos-calamares-module/desktopselect/DesktopSelectViewStep.cpp
+++ b/raveos-calamares-module/desktopselect/DesktopSelectViewStep.cpp
@@ -29,9 +29,18 @@ DesktopSelectViewStep::~DesktopSelectViewStep()
if (m_widget && m_widget->parent() == nullptr)
delete m_widget;
}
-
-QString DesktopSelectViewStep::prettyName() const
+QString
+DesktopSelectViewStep::prettyName() const
{
+ const QString locale = getLocale();
+ if (locale.startsWith("hu"))
+ {
+ return QStringLiteral("Asztali környezet");
+ }
+ if (locale.startsWith("de"))
+ {
+ return QStringLiteral("Desktop-Umgebung");
+ }
return tr("Desktop");
}
diff --git a/raveos-calamares-module/raveusers/RaveUsersViewStep.cpp b/raveos-calamares-module/raveusers/RaveUsersViewStep.cpp
index 4e21e65..4014429 100644
--- a/raveos-calamares-module/raveusers/RaveUsersViewStep.cpp
+++ b/raveos-calamares-module/raveusers/RaveUsersViewStep.cpp
@@ -40,6 +40,15 @@ RaveUsersViewStep::~RaveUsersViewStep()
QString
RaveUsersViewStep::prettyName() const
{
+ const QString locale = getLocale();
+ if ( locale.startsWith( QLatin1String( "hu" ) ) )
+ {
+ return QStringLiteral( "Felhasználó" );
+ }
+ if ( locale.startsWith( QLatin1String( "de" ) ) )
+ {
+ return QStringLiteral( "Benutzer" );
+ }
return tr( "User" );
}
diff --git a/raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp b/raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp
index b2108c6..86ab549 100644
--- a/raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp
+++ b/raveos-calamares-module/welcome/RaveWelcomeViewStep.cpp
@@ -55,9 +55,44 @@ RaveWelcomeViewStep::~RaveWelcomeViewStep()
QString RaveWelcomeViewStep::prettyName() const
{
+ const QString locale = getLocale();
+ if (locale.startsWith("hu"))
+ {
+ return QStringLiteral("Üdvözlés");
+ }
+ if (locale.startsWith("de"))
+ {
+ return QStringLiteral("Willkommen");
+ }
return tr("Welcome");
}
+QString RaveWelcomeViewStep::getLocale() const
+{
+ if (Calamares::JobQueue::instance())
+ {
+ Calamares::GlobalStorage* gs = Calamares::JobQueue::instance()->globalStorage();
+ if (gs)
+ {
+ if (gs->contains("locale"))
+ {
+ const QString loc = gs->value("locale").toString();
+ if (!loc.isEmpty())
+ return loc;
+ }
+
+ if (gs->contains("localeConf"))
+ {
+ const QString loc = gs->value("localeConf").toMap().value("LANG").toString();
+ if (!loc.isEmpty())
+ return loc;
+ }
+ }
+ }
+
+ return QLocale::system().name();
+}
+
void RaveWelcomeViewStep::buildWidget()
{
auto* bg = new BgWidget();
@@ -141,10 +176,6 @@ void RaveWelcomeViewStep::onLanguageChanged(int index)
m_currentLocaleIndex = index;
QString localeId = m_localeIds[index];
- // Install new translator - this changes the entire Calamares UI language
- Calamares::Locale::Translation::Id tid { localeId };
- Calamares::installTranslator(tid, brandingTranslationsPrefix());
-
// Store locale in GlobalStorage for the installed system.
// A localecfg a teljes localeConf-ot olvassa, ezért minden LC_* kulcsot
// beírunk, ne csak a LANG-ot.
@@ -174,6 +205,10 @@ void RaveWelcomeViewStep::onLanguageChanged(int index)
}
}
+ // Install new translator - this changes the entire Calamares UI language
+ Calamares::Locale::Translation::Id tid { localeId };
+ Calamares::installTranslator(tid, brandingTranslationsPrefix());
+
// Apply the matching live keyboard layout immediately, so the WiFi
// password input follows the selected language (before the keyboard page).
applyLiveKeyboardLayout(localeId);
diff --git a/raveos-calamares-module/welcome/RaveWelcomeViewStep.h b/raveos-calamares-module/welcome/RaveWelcomeViewStep.h
index af7bdff..87b42dd 100644
--- a/raveos-calamares-module/welcome/RaveWelcomeViewStep.h
+++ b/raveos-calamares-module/welcome/RaveWelcomeViewStep.h
@@ -36,6 +36,7 @@ private slots:
private:
void buildWidget();
+ QString getLocale() const;
QString brandingTranslationsPrefix() const;
void applyLiveKeyboardLayout(const QString& localeId);