Sonar

Internationalization

Details

  • Type: New Feature New Feature
  • Status: Closed Closed
  • Priority: Major Major
  • Resolution: Fixed
  • Affects Version/s: None
  • Fix Version/s: 2.10
  • Component/s: i18n
  • Labels:
    None
  • Number of attachments :
    0

Description

Any roadmap on internationalization ? The Sonar dashboard is great, especially for developers but it is almost impossible to provide such a dashboard in English for French managers of most traditional companies for ie.

If needed, I can help on FR l10n.

from:bflorat

Issue Links

Activity

Hide
Simon Brandhof added a comment -

The best library seems to be globalite.

Show
Simon Brandhof added a comment - The best library seems to be globalite.
Hide
philippe sigaud added a comment -

I did manage to "manually" translate Sonar 1.4.3 to French but I'm having issues with 1.5.
Seems like touching anything in the database tables metrics or rule_categories either crashes sonar or is overridden by Sonar.
I've only translated the html parts but cannot do the same in the database.
I'd kill for an easier way since each upgrade is a lot of work and tricky (database issues).

Show
philippe sigaud added a comment - I did manage to "manually" translate Sonar 1.4.3 to French but I'm having issues with 1.5. Seems like touching anything in the database tables metrics or rule_categories either crashes sonar or is overridden by Sonar. I've only translated the html parts but cannot do the same in the database. I'd kill for an easier way since each upgrade is a lot of work and tricky (database issues).
Hide
philippe sigaud added a comment -

This is not a minor issue for my users.

Show
philippe sigaud added a comment - This is not a minor issue for my users.
Hide
philippe sigaud added a comment -

Thanks for the update.

Show
philippe sigaud added a comment - Thanks for the update.
Hide
Jorge Hidalgo added a comment -

Besides internationalization, I would suggest including localization in this issue, specially number formats.

Show
Jorge Hidalgo added a comment - Besides internationalization, I would suggest including localization in this issue, specially number formats.
Hide
Freddy Mallet added a comment -

localization of number formats should be fixed in Sonar 1.10 (see SONAR-646)

Show
Freddy Mallet added a comment - localization of number formats should be fixed in Sonar 1.10 (see SONAR-646)
Hide
Taciano Tres added a comment -

When supported, I can help translating to pt_BR.
Seems like the votes are growing up ....

Show
Taciano Tres added a comment - When supported, I can help translating to pt_BR. Seems like the votes are growing up ....
Hide
Simon Brandhof added a comment -

Here are some proposals :

Internationalization is a large domain, but I assume that the current scope is to support :

  • regional languages
  • non-latin typography
  • regional numeric and date formats

Generally localization (l10n) is excluded, so we don't care about different cultures, for example to know if some colors/texts/symbols are subjects to misinterpretation or viewed as insensitive. Read this article for more details. Moreover right-to-left texts will not be implemented in the first version.

Let's talk now about technical implementation. Sonar 1.11 already supports numeric and date formats. It uses the locale sent by the browser. There are no server-side mechanisms to store the user locale (session, preferences, ...). The locale can be overridden with the parameter 'locale'. See the analysis date of these examples : english and french.
Because GWT includes its own easy-to-use mechanism, translations in french are already done on some pages (see hotspots).

Most of the current extension points are written in Java, so I'd rather use the java.util.ResourceBundle lib than the Ruby on Rails default lib. It will be more easy to re-use, and writing properties files is a lot more usual than writing YAML/ruby hash files.
It's crazy, but Java5 bundles does not support UTF-8 properties files ! It has been fixed in Java6. For example all the chinese characters must be written with their unicode : \uxxx. The workaround is keep the file in UTF-8 then convert it to latin encoding during the build : see the native maven plugin.

A convention must be chosen to name message keys : page.message, PAGE_MESSAGE, ... ? Examples : hostpots.title, HOTSPOTS_TITLE, ... Which format is usually recommended ? Is it page oriented ?

The ruby on rails API must be used to implement a backend that loads java bundles and the core rails bundles (see config/locales/defaults/). Messages are declared in ruby views with <%= t ''message.key" %>. The default rails implementation loads all languages in memory. It would be better if bundles are loaded on demand. New version of the Globalize plugin can be a good starting point.
In a first step we can assume that there is only one bundle in classpath : /sonar/Message_xx.properties. Then we could define one bundle by plugin, so that each plugin defines its own translations (for example /sonar/technical-debt/Message_xx.properties).

Defining all languages of core messages in the sonar project, not in a i18n independent plugin, does not bother me. Anyway it's inevitably the case with GWT pages (need all bundles all compile time).

Two problems remain :

  • some maven plugins generate messages that are directly saved in database, for example Checkstyle violations. It currently uses the default system locale. I think that using a global sonar locale would be better. It could be defined in a global parameter, and it could be overridden on projects.
  • name/description of metrics and coding rules are hardcoded in Java or XML files. They have to be loaded by new Sonar extensions like MetricsReferential and RulesReferential. API could include :
    public MetricInfo getMetricInfo(String metricKey, Locale locale), and MetricInfo defines localized name and description. Default implementations load messages from classpath, whereas advanced plugins could connect to remote servers (wikis ?).
Show
Simon Brandhof added a comment - Here are some proposals : Internationalization is a large domain, but I assume that the current scope is to support :
  • regional languages
  • non-latin typography
  • regional numeric and date formats
Generally localization (l10n) is excluded, so we don't care about different cultures, for example to know if some colors/texts/symbols are subjects to misinterpretation or viewed as insensitive. Read this article for more details. Moreover right-to-left texts will not be implemented in the first version. Let's talk now about technical implementation. Sonar 1.11 already supports numeric and date formats. It uses the locale sent by the browser. There are no server-side mechanisms to store the user locale (session, preferences, ...). The locale can be overridden with the parameter 'locale'. See the analysis date of these examples : english and french. Because GWT includes its own easy-to-use mechanism, translations in french are already done on some pages (see hotspots). Most of the current extension points are written in Java, so I'd rather use the java.util.ResourceBundle lib than the Ruby on Rails default lib. It will be more easy to re-use, and writing properties files is a lot more usual than writing YAML/ruby hash files. It's crazy, but Java5 bundles does not support UTF-8 properties files ! It has been fixed in Java6. For example all the chinese characters must be written with their unicode : \uxxx. The workaround is keep the file in UTF-8 then convert it to latin encoding during the build : see the native maven plugin. A convention must be chosen to name message keys : page.message, PAGE_MESSAGE, ... ? Examples : hostpots.title, HOTSPOTS_TITLE, ... Which format is usually recommended ? Is it page oriented ? The ruby on rails API must be used to implement a backend that loads java bundles and the core rails bundles (see config/locales/defaults/). Messages are declared in ruby views with <%= t ''message.key" %>. The default rails implementation loads all languages in memory. It would be better if bundles are loaded on demand. New version of the Globalize plugin can be a good starting point. In a first step we can assume that there is only one bundle in classpath : /sonar/Message_xx.properties. Then we could define one bundle by plugin, so that each plugin defines its own translations (for example /sonar/technical-debt/Message_xx.properties). Defining all languages of core messages in the sonar project, not in a i18n independent plugin, does not bother me. Anyway it's inevitably the case with GWT pages (need all bundles all compile time). Two problems remain :
  • some maven plugins generate messages that are directly saved in database, for example Checkstyle violations. It currently uses the default system locale. I think that using a global sonar locale would be better. It could be defined in a global parameter, and it could be overridden on projects.
  • name/description of metrics and coding rules are hardcoded in Java or XML files. They have to be loaded by new Sonar extensions like MetricsReferential and RulesReferential. API could include : public MetricInfo getMetricInfo(String metricKey, Locale locale), and MetricInfo defines localized name and description. Default implementations load messages from classpath, whereas advanced plugins could connect to remote servers (wikis ?).
Hide
Antonio Calero added a comment -

I can help translating to es_ES. Internationalization will be a big improvement

Show
Antonio Calero added a comment - I can help translating to es_ES. Internationalization will be a big improvement
Hide
Taciano Tres added a comment -

Any improvement in this issue?

Show
Taciano Tres added a comment - Any improvement in this issue?
Hide
Freddy Mallet added a comment -

no work in progress

Show
Freddy Mallet added a comment - no work in progress
Hide
Simon Brandhof added a comment -

Feature will be provided by David Festal from Serli

Show
Simon Brandhof added a comment - Feature will be provided by David Festal from Serli

People

Vote (22)
Watch (15)

Dates

  • Created:
    Updated:
    Resolved: