Edit this page

NA-MIC Project Weeks

Back to Projects List

Globalization in 3D Slicer and OHIF

Key Investigators

Project Description

The software globalization is the translation process of software from a source language into a target language. The process is divided into two steps: software internationalization (i18n) and software localization (L10n). The former is the task of designing software without a specific location i.e. building it independent of any specific language or culture. The latter is the process of adapting a software for a specific location.

The aim of this project is to develop/improve the 3D Slicer internationalization (i18n) and localization (l10n) support. This project is a next step in the one presented during 30th PW NA-MIC.

Also, we will discuss about the globalization in OHIF.

Objectives

  1. Improving the I18n support in the 3d Slicer core.
  2. Supporting the I18n in scripted module.
  3. Discussing the number and date formats in the dependence libraries and 3D Slicer core.
  4. Defining the step for translation of a module.

Approach and Plan

  1. Enhancing the contexts for the text displayed in GUI for the translation files (ts).
    1. Removing the QObject::tr and q->tr
    2. Removing the lupdate warnings:
      1. Cannot invoke tr() like this.
      2. Class MyClass lacks Q_OBJECT macro.
  2. Designing a WEB page so as to store the language files.
  3. Developing the i18n support for scripted module.

Progress and Next Steps

  1. The following fixes have been integrated into Slicer source:
    • r28338: STYLE: i18n: Remove unneeded translation of empty strings
    • r28339: BUG: i18n: Fix use of tr() function in pimpl of Base and MRML Qt classes
    • r28340: BUG: i18n: Fix buildsystem to fix generation of .ts files for loadable module
    • r28341: BUG: i18n: Fix use of tr() function in loadable module classes
    • r28342: ENH: i18n: Update buildsystem to support generation of .ts files for ModuleWidgets
    • r28343: BUG: i18n: Fix use of tr() function in loadable module Qt widget classes
    • r28344: ENH: i18n: Add support for node combox, 3d view controller and qSlicerApp
    • r28345: STYLE: Remove translation files with old-style suffix
  2. Support for i18n was improved.
    • See the PR-1162: improve-i18n-support
    • Support for translating scripted modules (slicer.i18n.tr())
    • Generation of <ModuleName>_untranslated.ts files
    • Add targets GenerateSlicerTranslationTemplates and GenerateSlicerTranslationQMFiles
    • Support for generating and updating translation files in extension.
  3. Discussed several proposals to organize the translation effort and manage associated infrastructures
    • Created project https://github.com/Slicer/SlicerTranslations
    • Proposed plan:
      • create a SlicerTranslations extension to install languages files for Slicer core
      • Still need to refine and document the approach for maintaining and distributing translation files for extensions
  4. Support for localization:
    • Displaying numbers with correct local format) is postponed for several months
    • A nightly build of Slicer will be setup in our lab in Canary Islands on system with different language and local.

Illustrations

Fig. 1: Spanish Slicer GUI

Fig. 2: French Slicer GUI

Background and References