Permalink
Browse files

COMP: Add option allowing to enable internationalization support.

STATUS
 Internationalization support has been discussed during March 26th 2013
developer hangout.

 We reach consensus: Official support for i18n will be disabled. A CMake
option named Slicer_BUILD_I18N_SUPPORT will be added and the option
won't be actively supported or tested.

 Why? Supporting internationalization properly would require to test
all ITK/VTK/Teem/.. readers and we don't have the funding or resources
to support that effort. If it is something you are interested in, make
sure to drop an email on the developer list. We will be happy to provide
 more information.

DISCUSSION
 http://slicer-devel.65872.n3.nabble.com/Re-Rounding-to-integer-tt4027985.html
 http://slicer-devel.65872.n3.nabble.com/Re-slicer-users-Slicer4-can-t-really-use-it-yet-td4028040.html
 http://slicer-users.65878.n3.nabble.com/Slicer4-DICOM-many-problems-td4025919.html

ISSUES
 3029 - Image spacing not read correctly in Slicer 4.2.2

git-svn-id: http://svn.slicer.org/Slicer4/trunk@21856 3bd1e089-480b-0410-8dfb-8563597acbee
  • Loading branch information...
jcfr committed Apr 2, 2013
1 parent 4778780 commit d061a8f3c84f267c2516868aa3341883574991c8
@@ -43,6 +43,7 @@
// - Slicer_BUILD_EXTENSIONMANAGER_SUPPORT
// - Slicer_BUILD_WIN32_CONSOLE
// - Slicer_BUILD_CLI_SUPPORT
+// - Slicer_BUILD_I18N_SUPPORT
// - Slicer_ORGANIZATION_DOMAIN
// - Slicer_ORGANIZATION_NAME
// - SLICER_REVISION_SPECIFIC_USER_SETTINGS_FILEBASENAME
@@ -1415,6 +1416,7 @@ void qSlicerCoreApplication::terminate(int returnCode)
//----------------------------------------------------------------------------
void qSlicerCoreApplication::loadTranslations(const QString& dir)
{
+#ifdef Slicer_BUILD_I18N_SUPPORT
qSlicerCoreApplication * app = qSlicerCoreApplication::application();
Q_ASSERT(app);
@@ -1438,11 +1440,15 @@ void qSlicerCoreApplication::loadTranslations(const QString& dir)
}
app->installTranslator(translator);
}
+#else
+ Q_UNUSED(dir)
+#endif
}
//----------------------------------------------------------------------------
void qSlicerCoreApplication::loadLanguage()
{
+#ifdef Slicer_BUILD_I18N_SUPPORT
qSlicerCoreApplication * app = qSlicerCoreApplication::application();
Q_ASSERT(app);
@@ -1460,4 +1466,5 @@ void qSlicerCoreApplication::loadLanguage()
app->loadTranslations(qmDir);
}
}
+#endif
}
View
@@ -76,8 +76,6 @@ set(KIT_SRCS
qSlicerSettingsCachePanel.h
qSlicerSettingsGeneralPanel.cxx
qSlicerSettingsGeneralPanel.h
- qSlicerSettingsInternationalizationPanel.cxx
- qSlicerSettingsInternationalizationPanel.h
qSlicerSettingsModulesPanel.cxx
qSlicerSettingsModulesPanel.h
qSlicerStyle.cxx
@@ -104,6 +102,13 @@ if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
)
endif()
+if(Slicer_BUILD_I18N_SUPPORT)
+ list(APPEND KIT_SRCS
+ qSlicerSettingsInternationalizationPanel.cxx
+ qSlicerSettingsInternationalizationPanel.h
+ )
+endif()
+
if(Slicer_USE_PYTHONQT)
list(APPEND KIT_SRCS
qSlicerScriptedLoadableModuleFactory.cxx
@@ -174,7 +179,6 @@ set(KIT_MOC_SRCS
qSlicerSaveDataDialog_p.h
qSlicerSettingsCachePanel.h
qSlicerSettingsGeneralPanel.h
- qSlicerSettingsInternationalizationPanel.h
qSlicerSettingsModulesPanel.h
qSlicerViewersToolBar.h
qSlicerViewersToolBar_p.h
@@ -191,6 +195,12 @@ if(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT)
)
endif()
+if(Slicer_BUILD_I18N_SUPPORT)
+ list(APPEND KIT_MOC_SRCS
+ qSlicerSettingsInternationalizationPanel.h
+ )
+endif()
+
if(Slicer_USE_PYTHONQT)
list(APPEND KIT_MOC_SRCS
qSlicerScriptedLoadableModule.h
@@ -23,7 +23,7 @@
#include <QDebug>
#include <QMainWindow>
-#include "vtkSlicerConfigure.h" // For Slicer_USE_QtTesting
+#include "vtkSlicerConfigure.h" // For Slicer_USE_*, Slicer_BUILD_*_SUPPORT
// CTK includes
#include <ctkColorDialog.h>
@@ -54,7 +54,9 @@
#endif
#include "qSlicerSettingsCachePanel.h"
#include "qSlicerSettingsGeneralPanel.h"
-#include "qSlicerSettingsInternationalizationPanel.h"
+#ifdef Slicer_BUILD_I18N_SUPPORT
+# include "qSlicerSettingsInternationalizationPanel.h"
+#endif
#ifdef Slicer_USE_QtTesting
# include "qSlicerSettingsQtTestingPanel.h"
#endif
@@ -187,9 +189,11 @@ void qSlicerApplicationPrivate::init()
cachePanel->setCacheManager(this->MRMLScene->GetCacheManager());
this->SettingsDialog->addPanel("Cache", cachePanel);
+#ifdef Slicer_BUILD_I18N_SUPPORT
qSlicerSettingsInternationalizationPanel* qtInternationalizationPanel =
new qSlicerSettingsInternationalizationPanel;
this->SettingsDialog->addPanel("Internationalization", qtInternationalizationPanel);
+#endif
#ifdef Slicer_USE_QtTesting
qSlicerSettingsQtTestingPanel* qtTestingPanel = new qSlicerSettingsQtTestingPanel;
@@ -59,6 +59,7 @@
#cmakedefine Slicer_BUILD_DICOM_SUPPORT
#cmakedefine Slicer_BUILD_DIFFUSION_SUPPORT
+#cmakedefine Slicer_BUILD_I18N_SUPPORT
#cmakedefine Slicer_BUILD_CLI_SUPPORT
#cmakedefine Slicer_BUILD_CLI
View
@@ -195,6 +195,7 @@ option(WITH_COVERAGE "Enable/Disable coverage" OFF)
option(Slicer_USE_VTK_DEBUG_LEAKS "Enable VTKs Debug Leaks functionality in both VTK and Slicer." ON)
option(Slicer_BUILD_DICOM_SUPPORT "Build Slicer with DICOM support" ON)
option(Slicer_BUILD_DIFFUSION_SUPPORT "Build Slicer with diffusion (DWI, DTI) support" ON)
+option(Slicer_BUILD_I18N_SUPPORT "Build Slicer with Internationalization support" OFF)
option(Slicer_BUILD_QTLOADABLEMODULES "Build Slicer QT Loadable Modules" ON)
mark_as_advanced(Slicer_BUILD_QTLOADABLEMODULES)
option(Slicer_USE_PYTHONQT "Integrate a python-QT interpreter into Slicer." ON)
@@ -212,7 +213,7 @@ CMAKE_DEPENDENT_OPTION(
"Slicer_BUILD_CLI" OFF
)
option(Slicer_BUILD_EXTENSIONMANAGER_SUPPORT "Build Slicer extension manager" ON)
-option(Slicer_UPDATE_TRANSLATION "update translation" OFF )
+CMAKE_DEPENDENT_OPTION(Slicer_UPDATE_TRANSLATION "update translation" OFF "Slicer_BUILD_I18N_SUPPORT" OFF)
mark_as_advanced(Slicer_UPDATE_TRANSLATION)
set(Slicer_FORCED_WC_REVISION "" CACHE STRING "Overwrite value of auto-discovered Slicer_WC_REVISION")

0 comments on commit d061a8f

Please sign in to comment.