Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Main Repositories
otb
Commits
be4c84e2
Commit
be4c84e2
authored
Aug 18, 2016
by
Stéphane Albert
Browse files
ENH: Added I18N support to Monteverdi modules.
parent
8cc4ee64
Changes
9
Hide whitespace changes
Inline
Side-by-side
CMake/i18n_qt4.cmake
View file @
be4c84e2
#
#
Declare and initialize variable to be present in parent scop
e.
# set( Monteverdi_I18N_SOURCE_FILES
#
""
# CACHE INTERNAL "" FORCE
# )
#
Reset Qt I18N source files cache variabl
e.
macro
(
reset_qt4_i18n_sources
)
set
(
OTB_QT_I18N_SOURCE_FILES
""
CACHE INTERNAL
""
FORCE
)
endmacro
()
#
#
Set locale human-readable
translation
files
.
#
Add source files to Qt I18n
translation
build
.
macro
(
add_to_qt4_i18n_sources SOURCE_FILES
)
foreach
(
SOURCE_FILE
${
ARGV
}
)
foreach
(
SOURCE_FILE
${
ARGV
}
)
get_filename_component
(
ABS_SOURCE_FILE
${
SOURCE_FILE
}
ABSOLUTE
)
set
(
Monteverdi_I18N_SOURCE_FILES
${
Monteverdi_I18N_SOURCE_FILES
}
${
ABS_SOURCE_FILE
}
set
(
OTB_QT_I18N_SOURCE_FILES
${
OTB_QT_I18N_SOURCE_FILES
}
${
ABS_SOURCE_FILE
}
CACHE INTERNAL
""
FORCE
)
endforeach
()
endmacro
()
CMakeLists.txt
View file @
be4c84e2
...
...
@@ -67,6 +67,9 @@ include(PreventInBuildInstalls)
include
(
OTBModuleMacros
)
include
(
OTBModuleRemote
)
include
(
OTBModuleTest
)
include
(
i18n_qt4
)
reset_qt4_i18n_sources
()
repository_status
(
${
PROJECT_SOURCE_DIR
}
OTB_GIT_STATUS_MESSAGE
)
...
...
@@ -361,7 +364,7 @@ add_subdirectory(Utilities/Doxygen)
add_subdirectory
(
Utilities/Completion
)
#----------------------------------------------------------------------
#----------------------------------------------------------------------
------
# Provide a target to generate the SuperBuild archive (only for Unix)
if
(
UNIX
)
add_custom_target
(
SuperBuild-archive
...
...
@@ -522,3 +525,7 @@ message("======================= End of OTB cmake summary ======================
#don't need this one anymore. so unset it.
unset
(
option_list
)
#----------------------------------------------------------------------------
# I18N
add_subdirectory
(
i18n
)
Modules/Visualization/Mapla/src/CMakeLists.txt
View file @
be4c84e2
...
...
@@ -45,6 +45,9 @@ qt4_wrap_cpp( OTBMapla_SRC_MOC ${OTBMapla_HEADERS_MOC} )
qt4_wrap_ui
(
OTBMapla_FORMS_HEADERS
${
OTBMapla_FORMS
}
)
qt4_add_resources
(
OTBMapla_RESOURCES_RCC
${
OTBMapla_RESOURCES
}
)
#############################################################################
add_to_qt4_i18n_sources
(
${
OTBMapla_SRCS
}
)
##########################[Mapla library]####################################
add_library
(
OTBMapla
STATIC
...
...
Modules/Visualization/Mapla/src/mvdMaplaApplication.cxx
View file @
be4c84e2
...
...
@@ -46,7 +46,7 @@ namespace mvd
{
/*
TRANSLATOR mvd::Application
TRANSLATOR mvd::
Mapla
Application
Necessary for lupdate to be aware of C++ namespaces.
...
...
Modules/Visualization/Mapla/src/mvdMaplaMainWindow.cxx
View file @
be4c84e2
...
...
@@ -59,7 +59,7 @@ namespace mvd
{
/*
TRANSLATOR mvd::MainWindow
TRANSLATOR mvd::
Mapla
MainWindow
Necessary for lupdate to be aware of C++ namespaces.
...
...
Modules/Visualization/Monteverdi/src/CMakeLists.txt
View file @
be4c84e2
...
...
@@ -28,7 +28,10 @@ qt4_wrap_cpp( OTBMonteverdi_SRC_MOC ${OTBMonteverdi_HEADERS_MOC} )
qt4_wrap_ui
(
OTBMonteverdi_FORMS_HEADERS
${
OTBMonteverdi_FORMS
}
)
qt4_add_resources
(
OTBMonteverdi_RESOURCES_RCC
${
OTBMonteverdi_RESOURCES
}
)
#############################################################################
add_to_qt4_i18n_sources
(
${
OTBMonteverdi_SRCS
}
)
#############################################################################
add_library
(
OTBMonteverdi
STATIC
${
OTBMonteverdi_SRCS
}
...
...
Modules/Visualization/MonteverdiCore/src/CMakeLists.txt
View file @
be4c84e2
...
...
@@ -70,7 +70,9 @@ if( OTBApplicationEngine_ENABLED )
endif
()
#############################################################################
add_to_qt4_i18n_sources
(
${
OTBMonteverdiCore_SRCS
}
)
#############################################################################
qt4_wrap_cpp
(
OTBMonteverdiCore_SRC_MOC
${
OTBMonteverdiCore_HEADERS_MOC
}
)
add_library
(
OTBMonteverdiCore
${
OTBMonteverdiCore_SRCS
}
${
OTBMonteverdiCore_SRC_MOC
}
)
...
...
Modules/Visualization/MonteverdiGui/src/CMakeLists.txt
View file @
be4c84e2
...
...
@@ -155,6 +155,9 @@ qt4_wrap_cpp( OTBMonteverdiGUI_SRC_MOC ${OTBMonteverdiGUI_HEADERS_MOC} )
qt4_wrap_ui
(
OTBMonteverdiGUI_FORMS_HEADERS
${
OTBMonteverdiGUI_FORMS
}
)
qt4_add_resources
(
OTBMonteverdiGUI_RESOURCES_RCC
${
OTBMonteverdiGUI_RESOURCES
}
)
#############################################################################
add_to_qt4_i18n_sources
(
${
OTBMonteverdiGUI_SRCS
}
)
#############################################################################
add_library
(
OTBMonteverdiGUI
${
OTBMonteverdiGUI_SRCS
}
...
...
i18n/CMakeLists.txt
View file @
be4c84e2
...
...
@@ -2,39 +2,50 @@
# Qt4 translations.
#----------------------------------------------------------------------------
# Locale human-readable translation files.
set
(
Monteverdi
_TS_TRANSLATIONS
set
(
OTB
_TS_TRANSLATIONS
# en_US.ts
fr_FR.ts
)
#
#----------------------------------------------------------------------------
# Configuration option to enable creation/merging of source .ts files
# Default value is: OFF.
option
(
MERGE_TS
"Create/merge .ts source translation files. WARNING: 'make clean' will delete the source .ts files!"
OFF
)
#
# Sources to translate.
if
(
MERGE_TS
)
message
(
AUTHOR_WARNING
"WARNING: MERGE_TS:BOOL option is ON. 'make clean' will delete .ts files from source directory!"
)
message
(
STATUS
"I18N source files: "
${
Monteverdi_I18N_SOURCE_FILES
}
)
qt4_create_translation
(
Monteverdi_QM_TRANSLATIONS
${
Monteverdi_I18N_SOURCE_FILES
}
${
Monteverdi_TS_TRANSLATIONS
}
)
else
()
#
# Locale binary translation files.
qt4_add_translation
(
Monteverdi_QM_TRANSLATIONS
${
Monteverdi_TS_TRANSLATIONS
}
option
(
OTB_I18N_MERGE_TS
"Create/merge .ts source translation files. WARNING: If ON, 'make clean' will delete the .ts files from source directory!"
OFF
)
endif
()
#
# Custom build target.
add_custom_target
(
i18n ALL DEPENDS
${
Monteverdi_QM_TRANSLATIONS
}
)
#
#----------------------------------------------------------------------------
# Locale human-readable translation files.
install
(
FILES
${
Monteverdi_QM_TRANSLATIONS
}
DESTINATION
${
Monteverdi_INSTALL_DATA_DIR
}
/i18n
COMPONENT Resources
)
if
(
OTBQt4_ENABLED
)
# Generate commands to build Qt translations according to option.
if
(
OTB_I18N_MERGE_TS
)
message
(
AUTHOR_WARNING
"WARNING: OTB_I18N_MERGE_TS:BOOL option is set to ON. 'make clean' will delete .ts files from source directory!"
)
message
(
STATUS
"Qt I18N source files: "
${
OTB_QT_I18N_SOURCE_FILES
}
)
qt4_create_translation
(
OTB_QM_TRANSLATIONS
${
OTB_QT_I18N_SOURCE_FILES
}
${
OTB_TS_TRANSLATIONS
}
)
else
()
qt4_add_translation
(
OTB_QM_TRANSLATIONS
${
OTB_TS_TRANSLATIONS
}
)
endif
()
# Custom build targets.
add_custom_target
(
i18n ALL DEPENDS i18n_qt
)
add_custom_target
(
i18n_qt DEPENDS
${
OTB_QM_TRANSLATIONS
}
)
# Locale human-readable translation files.
install
(
FILES
${
OTB_QM_TRANSLATIONS
}
DESTINATION
${
OTB_INSTALL_DATA_DIR
}
/i18n
COMPONENT Resources
)
endif
()
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment