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)" ) 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 ) 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. 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..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() @@ -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: {