New rules for localisation of software

sonarqube

(vicky) #1

Hi Team,

Nowadays every products need to be localized according to the different local market so it is a good idea to externalise all the strings which will be reflected to UI in a properties file so that one can maintain different files for storing different locales like english,japaneese e.t.c and take the values from those files whenever required.

So there should be one rule which will detect all the strings which is required to externalize. This rule should be applicable to all the languages but till now i have found just for c# which is close to this rule. Please refer this doc:https://github.com/SonarSource/sonar-csharp/blob/master/sonaranalyzer-dotnet/src/SonarAnalyzer.CSharp/Rules/LiteralsShouldNotBePassedAsLocalizedParameters.cs Rule : S4055

  • snippet of Noncompliant Code
    Any string values which is required to externalized for localisation. For example:

String a=“Hola”;

snippet of Compilant Code (fixing the above noncompliant code)

String a=properties.get(key_value);

  • type : Bug
  • tags : Globalization

Note: Lingoport Globalizer is being used for current localisation of software which has many rules for globalisation so that way it will help for overall good product.