[neon/neon/calamares-settings/slideshow-refactor] desktop/calamares/desktop/branding/neon: Got translations working!

Mike Stemle null at kde.org
Sat Apr 27 18:20:39 BST 2024


Git commit 3be8e720997e1e12992728091c22fb5e07c8cbb2 by Mike Stemle.
Committed on 27/04/2024 at 17:19.
Pushed by mstemle into branch 'slideshow-refactor'.

Got translations working!
- I corrected the structure of the `.ts` file and rebuilt it to a `.qm` file
- I also added the rest of the slides to `slides.qml`
- Finally, I added a `README.md` in order to make it easier to maintain this slideshow in the future.

A  +44   -0    desktop/calamares/desktop/branding/neon/README.md
M  +-    --    desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.qm
M  +2    -11   desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.ts
M  +73   -4    desktop/calamares/desktop/branding/neon/slides.qml

https://invent.kde.org/neon/neon/calamares-settings/-/commit/3be8e720997e1e12992728091c22fb5e07c8cbb2

diff --git a/desktop/calamares/desktop/branding/neon/README.md b/desktop/calamares/desktop/branding/neon/README.md
new file mode 100644
index 0000000..ca8138e
--- /dev/null
+++ b/desktop/calamares/desktop/branding/neon/README.md
@@ -0,0 +1,44 @@
+# Calamares Branding for KDE Neon
+
+This is the place where we do all of the branding for KDE Neon in Calamares.
+
+- `branding.desc` points to the Qml file we use for the Slideshow
+
+## Slideshow
+
+KDE Neon has a great slideshow to introduce new users to the distribution as they're installing. We have a few key priorities with this slideshow:
+
+1. The images and such should look nice inside of the Calamares window using the branding
+2. The slides should change every 30 seconds
+3. All of the translations should work
+
+### Building the translations
+
+For the translations, edit the `.ts` files and then use the following command to build them into `.qm` files.
+
+```sh
+for X in $(ls -1 lang/*.ts); do lrelease "$X"; done
+```
+
+This will run `lrelease` on all of the files in the `lang` folder.
+
+### Testing the slideshow
+
+Before you can test this, you'll need to install `calamares`.
+
+```sh
+sudo apt install calamares
+```
+
+Now you run:
+
+```sh
+qml \
+  --translation lang/calamares-neon_fr.qm \
+  -I /usr/share/calamares/qml \
+  slides.qml
+```
+
+You can change the lang file out for any language you would like to test. In order to test the different slides, you can just click inside the Qml runner window.
+
+It's probably a good idea to test the timer, too. In order to do that, you'll have to make a slight code change in the `slides.qml`. You'll need to change `advanceTimer.running` to be a literal `true` rather than pulling its value from the Calamares value (just make sure not to forget to revert this change prior to testing!).
diff --git a/desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.qm b/desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.qm
index 56a2213..fc31789 100644
Binary files a/desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.qm and b/desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.qm differ
diff --git a/desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.ts b/desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.ts
index b0dea82..aa371af 100644
--- a/desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.ts
+++ b/desktop/calamares/desktop/branding/neon/lang/calamares-neon_fr.ts
@@ -1,29 +1,20 @@
 <?xml version="1.0" encoding="utf-8"?>
 <!DOCTYPE TS>
-<TS>
+<TS version="2.1" language="fr">
 <context>
-    <name>ubiquity-slideshow/slides/kde.html:3</name>
+    <name>slides</name>
     <message>
         <source>One Blue Marble - a community of creators around the globe</source>
         <translation>One Blue Marble - une communauté de créateurs dans le monde entier</translation>
     </message>
-</context>
-<context>
-    <name>ubiquity-slideshow/slides/neon.html:3</name>
     <message>
         <source>KDE neon - the latest and greatest from the KDE community</source>
         <translation>KDE Neon - Le meilleur et les dernières nouveautés de la communauté KDE</translation>
     </message>
-</context>
-<context>
-    <name>ubiquity-slideshow/slides/plasma.html:3</name>
     <message>
         <source>Plasma Desktop, simple by default and powerful when needed</source>
         <translation>Le bureau Plasma, simple par défaut mais puissant lorsque c'est nécessaire</translation>
     </message>
-</context>
-<context>
-    <name>ubiquity-slideshow/slides/secure.html:3</name>
     <message>
         <source>Security, privacy and autonomy with KDE, Plasma and Neon</source>
         <translation>Sécurité, vie privée et autonomie avec KDE, Plasma et Neon</translation>
diff --git a/desktop/calamares/desktop/branding/neon/slides.qml b/desktop/calamares/desktop/branding/neon/slides.qml
index c494cbc..376b0e0 100644
--- a/desktop/calamares/desktop/branding/neon/slides.qml
+++ b/desktop/calamares/desktop/branding/neon/slides.qml
@@ -23,7 +23,9 @@ Presentation
     Timer {
         id: advanceTimer
         interval: 20000
-        running: presentation.activatedInCalamares
+        // Use the literal `true` for testing only.
+        running: true
+        // running: presentation.activatedInCalamares
         repeat: true
         onTriggered: nextSlide()
     }
@@ -32,9 +34,10 @@ Presentation
 
     //// KDE
     Slide {
+        id: kde_slide
 
         Image {
-            id: background
+            id: kde_background
             source: "assets/kde.png"
             anchors.fill: parent
             fillMode: Image.PreserveAspectFit
@@ -42,8 +45,8 @@ Presentation
             clip: true
         }
         Text {
-            anchors.horizontalCenter: background.horizontalCenter
-            anchors.top: background.bottom
+            anchors.horizontalCenter: kde_background.horizontalCenter
+            anchors.top: kde_background.bottom
             text: qsTr("One Blue Marble - a community of creators around the globe")
             wrapMode: Text.WordWrap
             width: presentation.width
@@ -51,6 +54,72 @@ Presentation
         }
     }
 
+    //// Neon
+    Slide {
+        id: neon_slide
+
+        Image {
+            id: neon_background
+            source: "assets/neon.png"
+            anchors.fill: parent
+            fillMode: Image.PreserveAspectFit
+            smooth: true
+            clip: true
+        }
+        Text {
+            anchors.horizontalCenter: neon_background.horizontalCenter
+            anchors.top: neon_background.bottom
+            text: qsTr("KDE neon - the latest and greatest from the KDE community")
+            wrapMode: Text.WordWrap
+            width: presentation.width
+            horizontalAlignment: Text.Center
+        }
+    }
+
+    //// Plasma
+    Slide {
+        id: plasma_slide
+
+        Image {
+            id: plasma_background
+            source: "assets/plasma.png"
+            anchors.fill: parent
+            fillMode: Image.PreserveAspectFit
+            smooth: true
+            clip: true
+        }
+        Text {
+            anchors.horizontalCenter: plasma_background.horizontalCenter
+            anchors.top: plasma_background.bottom
+            text: qsTr("Plasma Desktop, simple by default and powerful when needed")
+            wrapMode: Text.WordWrap
+            width: presentation.width
+            horizontalAlignment: Text.Center
+        }
+    }
+
+    //// Secure
+    Slide {
+        id: secure_slide
+
+        Image {
+            id: secure_background
+            source: "assets/secure.png"
+            anchors.fill: parent
+            fillMode: Image.PreserveAspectFit
+            smooth: true
+            clip: true
+        }
+        Text {
+            anchors.horizontalCenter: secure_background.horizontalCenter
+            anchors.top: secure_background.bottom
+            text: qsTr("Security, privacy and autonomy with KDE, Plasma and Neon")
+            wrapMode: Text.WordWrap
+            width: presentation.width
+            horizontalAlignment: Text.Center
+        }
+    }
+
     // When this slideshow is loaded as a V1 slideshow, only
     // activatedInCalamares is set, which starts the timer (see above).
     //


More information about the Neon-commits mailing list