Merge branch 'default-branding-i18n'

This commit is contained in:
Adriaan de Groot 2019-06-16 23:48:12 +02:00
commit c80b56380d
6 changed files with 49 additions and 13 deletions

View File

@ -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)" )

View File

@ -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 )

View File

@ -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-<component name>_<language>.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.

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="en_US">
<context>
<name>show</name>
<message>
<location filename="../show.qml" line="64"/>
<source>This is a second Slide element.</source>
<translation type="unfinished"></translation>
</message>
<message>
<location filename="../show.qml" line="68"/>
<source>This is a third Slide element.</source>
<translation type="unfinished"></translation>
</message>
</context>
</TS>

View File

@ -0,0 +1,17 @@
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE TS>
<TS version="2.1" language="nl">
<context>
<name>show</name>
<message>
<location filename="../show.qml" line="64"/>
<source>This is a second Slide element.</source>
<translation>Dit is het tweede Dia element.</translation>
</message>
<message>
<location filename="../show.qml" line="68"/>
<source>This is a third Slide element.</source>
<translation>Dit is het derde Dia element.</translation>
</message>
</context>
</TS>

View File

@ -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: {