Available since Sonar 2.10

This page gives guidelines to I18n for:

  • Plugin developers who would like to apply the i18n mechanism in their own plugin, so that this plugin can be available in several languages
  • People who would like to help the community by making the platform available in a new language


Although the basics of the i18n mechanism are the same for every part of the ecosystem, the packaging differs if you want to apply this mechanism to the Sonar core platform or to a plugin:

  • Sonar platform relies on plugins to get translations
  • Sonar plugins embed by themselves all the translations they need

Translation bundles

There are 2 types of files for localized messages:

Properties files

HTML files

In the Java API, properties files are supposed to be encoded in ISO-8859 charset. Without good tooling, this can be quite annoying to write translation for languages that do not fit in this charset.
This is why we deciced to encode the properties files in UTF-8, and let Maven turn them into ASCII at build time thanks to native2ascii-maven-plugin (check the French plugin POM). This makes the process of writing translations with a standard editor far easier.
HTML files must also be encoded in UTF-8.

Naming conventions for keys

Here are the conventions you have to know about keys :





Metric name

metric.ncloc.name=Lines of code


Metric description

metric.ncloc.description=Non Commenting Lines of Code

notification.channel.<channel key>

Name of notification channel


notification.dispatcher.<dispatcher key>

Subscription to notification channel

notification.dispatcher.ChangesInReviewAssignedToMeOrCreatedByMe=Changes in review assigned to me or created by me


Rule name

rule.pmd.StringInstantiation.name=String Instantiation

rule.<repository>.<key>.param.<param key>

Description of rule parameter

rule.pmd.VariableNamingConventions.param.memberSuffix=Suffix for member variables

dashboard.<key>.nameDashboard name, since 2.14.dashboard.Hotstpots.name=Point Chauds



Qualifier name, since 2.13.




Widget name



Widget description

widget.alerts.description=Display project alerts

widget.<key>.param.<property key>

Description of widget property



Any other widget message

widget.alerts.tooltip=Threshold is raised

<page key>.page

Page names shown in the left sidebar


<page key>.*

Any other keys used in a page



Category name of properties, since 2.11



Property name, since 2.11

property.sonar.sourceEncoding.name=Source encoding


Property description, since 2.11

property.sonar.sourceEncoding.description=Source encoding

<plugin key>.*

Any other keys used by plugin


How to use localized messages ?

Ruby on Rails API

This API is used when implementing Ruby widgets or pages. It's really simple, a single method must be used :

message(property_key, options={})

Options are :

Examples :

message('cloud.size', :default => 'Cloud')
message('with.arguments', :params => ['First', 'Two'])
message('with.arguments', :params => ['First', 'Two'], :default => 'Not found')

Of course the Rails framework provides other formatting methods like :

# localize dates or datetimes


GWT provides its own mechanisms to internationalize components. The static technique is the most efficient and must be used into Sonar GWT extensions. Read the Google documentation for more details.

Java API

The component org.sonar.api.i18n.I18n is available for server extensions. Batch extensions are not supported yet and can not load bundles.

How to contribute

How to localize a plugin

A plugin can embed its own bundles, for example to translate the labels used in its web extensions. Bundles must be added to src/main/resources with the following convention names :

The english bundle is mandatory. For example the plugin with key "technicaldebt" must define the following files in order to enable the french bundle :

How to create a language pack

A language pack defines bundles for the whole Sonar distribution. 

To create a new pack, it's recommended to copy the English bundles and to adapt them to the new language.

The language pack plugin must be executed in the same classloader than the English pack, so the property "basePlugin" must be set to "l10nen" into the configuration of sonar-packaging-maven-plugin (see example).