Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


  • These are regular properties files with key/value pairs where you will put most translations
  • These files must be stored in the org.sonar.l10n package (usually in the src/main/resources/org/sonar/l10n directory)
  • The names of these files must follow the convention "<key of the plugin to translate>_<language>.properties", for example "" or "". See sonar-packaging-maven-plugin for details on plugin key derivation.
  • Messages can accept arguments. Such entries would look like:

    No Format is a message with 2 params: the first "{0}" and the second "{1}".

HTML files for Rule Descriptions

  • They are used for rule descriptions, which might be long and need HTML tags
  • The files should be stored in the org.sonar.l10n.<key of the plugin to translate>_<language>.rules.<repository key> package.
    • Before SonarQube 3.0, the location is org.sonar.l10n.<plugin key>_<language> package. Backward compatibility is ensured for l10n plugins which use this old location.
  • The names of these files should correspond to the keys of the rules they translate
  • Example: the French description of the Squid Architectural Constraint rule is: src/main/resources/org/sonar/l10n/squidjava_fr/rules/squid/ArchitecturalConstraint.html (since squidjava is the plugin key, and squid is the repository key)
    • Prior to SonarQube 3.0: src/main/resources/org/sonar/l10n/squidjava_fr/ArchitecturalConstraint.html
  • Supported tags are:
    • <p> for paragraphs. Must be used for each paragraph.
    • <ul> and <ul> for lists
    • <h2> and <h3> for titles and subtitles (since version 3.7.1)
    • <blockquote> for quotations (since version 3.7.1)
    • <code> for short code in paragraph
    • <pre> for block of code
    • <table class="rule-table">, with <thead><tr><th> and <tbody><tr><td> cells (since version 3.7.1)
titleUTF-8 encoding

In the Java API, properties files are supposed to be encoded in ISO-8859 charset. Without good tooling, it can be quite annoying to write translations for languages that do not fit in this charset.
This is why we decided 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.xml). This makes the process of writing translations with a standard editor far easier.
HTML files must also be encoded in UTF-8.