From 41c2a7e4e0f713c3100efd43b3714684710ef17d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 16 Jun 2019 22:42:53 +0200 Subject: [PATCH 1/5] [branding] Drop complicated machinery for one subdir --- src/branding/CMakeLists.txt | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/src/branding/CMakeLists.txt b/src/branding/CMakeLists.txt index b03127e39..981da1468 100644 --- a/src/branding/CMakeLists.txt +++ b/src/branding/CMakeLists.txt @@ -1,7 +1 @@ -file( GLOB SUBDIRECTORIES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "*" ) -foreach( SUBDIRECTORY ${SUBDIRECTORIES} ) - set( _sd "${CMAKE_CURRENT_SOURCE_DIR}/${SUBDIRECTORY}" ) - if( IS_DIRECTORY "${_sd}" AND EXISTS "${_sd}/branding.desc" ) - calamares_add_branding_subdirectory( ${SUBDIRECTORY} ) - endif() -endforeach() +calamares_add_branding_subdirectory( default ) From 593dcff40a561d50a6324ae62f7be9bd06c10a1f Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 16 Jun 2019 23:01:56 +0200 Subject: [PATCH 2/5] [branding] Enable translations for the default show - Just translate two simple strings, to avoid burdening translators, - Add Dutch translation already. These translations are not yet processed by ci/txpull and push. --- .../default/lang/calamares-default_en.ts | 17 +++++++++++++++++ .../default/lang/calamares-default_nl.ts | 17 +++++++++++++++++ src/branding/default/show.qml | 4 ++-- 3 files changed, 36 insertions(+), 2 deletions(-) create mode 100644 src/branding/default/lang/calamares-default_en.ts create mode 100644 src/branding/default/lang/calamares-default_nl.ts diff --git a/src/branding/default/lang/calamares-default_en.ts b/src/branding/default/lang/calamares-default_en.ts new file mode 100644 index 000000000..30474fc02 --- /dev/null +++ b/src/branding/default/lang/calamares-default_en.ts @@ -0,0 +1,17 @@ + + + + + show + + + This is a second Slide element. + + + + + This is a third Slide element. + + + + diff --git a/src/branding/default/lang/calamares-default_nl.ts b/src/branding/default/lang/calamares-default_nl.ts new file mode 100644 index 000000000..aad00eaf7 --- /dev/null +++ b/src/branding/default/lang/calamares-default_nl.ts @@ -0,0 +1,17 @@ + + + + + show + + + This is a second Slide element. + Dit is het tweede Dia element. + + + + This is a third Slide element. + Dit is het derde Dia element. + + + diff --git a/src/branding/default/show.qml b/src/branding/default/show.qml index cb98ecb0a..89ad354de 100644 --- a/src/branding/default/show.qml +++ b/src/branding/default/show.qml @@ -61,11 +61,11 @@ Presentation } Slide { - centeredText: "This is a second Slide element." + centeredText: qsTr("This is a second Slide element.") } Slide { - centeredText: "This is a third Slide element." + centeredText: qsTr("This is a third Slide element.") } Component.onCompleted: { From f3f8f3ea46e038ac5b11e5ccdc63047fb85a7a8d Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 16 Jun 2019 23:08:12 +0200 Subject: [PATCH 3/5] [branding] Make the default show nervously quick --- src/branding/default/show.qml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/branding/default/show.qml b/src/branding/default/show.qml index 89ad354de..83d47d9e7 100644 --- a/src/branding/default/show.qml +++ b/src/branding/default/show.qml @@ -31,7 +31,7 @@ Presentation Timer { id: advanceTimer - interval: 5000 + interval: 1000 running: false repeat: true onTriggered: nextSlide() From a08e7644672e0750d49aecadb149a0a2f8ccacb5 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 16 Jun 2019 23:38:44 +0200 Subject: [PATCH 4/5] CMake: add compiled branding translations to build dir - Copy the .qm files (compiled translations) into the build dir as part of the build process. This is independent of **installing** those same translations, but does allow the translations to be used by Calamares when run from the build dir for testing. --- CMakeModules/CalamaresAddBrandingSubdirectory.cmake | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeModules/CalamaresAddBrandingSubdirectory.cmake b/CMakeModules/CalamaresAddBrandingSubdirectory.cmake index 78330e245..344777eb0 100644 --- a/CMakeModules/CalamaresAddBrandingSubdirectory.cmake +++ b/CMakeModules/CalamaresAddBrandingSubdirectory.cmake @@ -107,7 +107,9 @@ function( calamares_add_branding_translations NAME ) file( GLOB BRANDING_TRANSLATION_FILES RELATIVE ${CMAKE_CURRENT_SOURCE_DIR} "${SUBDIRECTORY}/lang/calamares-${NAME}_*.ts" ) if ( BRANDING_TRANSLATION_FILES ) qt5_add_translation( QM_FILES ${BRANDING_TRANSLATION_FILES} ) - add_custom_target( branding-translation-${NAME} ALL DEPENDS ${QM_FILES} ) + add_custom_target( branding-translation-${NAME} ALL DEPENDS ${QM_FILES} + COMMAND ${CMAKE_COMMAND} -E copy ${QM_FILES} ${CMAKE_CURRENT_BINARY_DIR}/${SUBDIRECTORY}/lang/ + ) install( FILES ${QM_FILES} DESTINATION ${BRANDING_COMPONENT_DESTINATION}/lang/ ) list( LENGTH BRANDING_TRANSLATION_FILES _branding_count ) message( " ${Green}BRANDING_TRANSLATIONS:${ColorReset} ${_branding_count} language(s)" ) From ef2531b01d8bbb35ec385e1934f4e2aea2635406 Mon Sep 17 00:00:00 2001 From: Adriaan de Groot Date: Sun, 16 Jun 2019 23:46:32 +0200 Subject: [PATCH 5/5] [branding] Update documentation - mention that translations are included - point to external repo for fancy/ example. --- src/branding/README.md | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/src/branding/README.md b/src/branding/README.md index 1d816911e..146de0d5b 100644 --- a/src/branding/README.md +++ b/src/branding/README.md @@ -20,7 +20,9 @@ so that it can be run directly from the build directory for testing purposes: - `default/` is a sample brand for the Generic Linux distribution. It uses the default Calamares icons and a as start-page splash it provides a tag-cloud view of languages. The slideshow is a basic one with a few - slides of text and a single image. No translations are provided. + slides of text and a single image. Translations (done by hand, not via + the usual mechanism of Calamares translations) in English, Arabic, Dutch + and French are available. Since the slideshow can be **any** QML, it is limited only by your designers imagination and your QML experience. For straightforward presentations, @@ -37,6 +39,9 @@ Qt translation files are supported (`.ts` sources which get compiled into `.qm`). Inside the `lang` subdirectory all translation files must be named according to the scheme `calamares-_.ts`. +The example branding component, called *default*, therefore has translation +files names `calamares-default_nl.ts` (similar for other languages than Dutch). + Text in your `show.qml` (or whatever *slideshow* is set to in the descriptor file) should be enclosed in this form for translations @@ -83,7 +88,8 @@ Generally, you will add a few presentation-level elements first, then slides. - For visible navigation arrows, add elements of class *ForwardButton* and *BackwardButton*. Set the *source* property of each to a suitable - image. See the `fancy/` example. It is recommended to turn off other + image. See the `fancy/` example in the external branding-examples + repository. It is recommended to turn off other kinds of navigation when visible navigation is used. - To indicate where the user is, add an element of class *SlideCounter*. This indicates in "n / total" form where the user is in the slideshow.